@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #f4f4f4;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding: 20px 0;
}

body::before {
   content: '';
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: 
       radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
       radial-gradient(circle at 80% 70%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
       linear-gradient(rgba(15, 52, 96, 0.80), rgba(26, 26, 46, 0.9)),
       url('/images/hogwarts-bg.png');
   background-position: center center;
   background-size: cover;
   background-repeat: no-repeat;
   pointer-events: none;
   z-index: -1;
   animation: sparkle 20s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.container, .magical-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 30px;
    text-align: center;
}

.magical-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-top: 40px; 
    animation: float 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 35px;
    text-align: left;
    padding: 35px 30px;
}

.form-header {
    flex: 1;
    min-width: 280px;
    padding-right: 20px;
}

.form-content {
    flex: 1;
    min-width: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.2em; 
    margin-bottom: 25px;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6em;
    margin-bottom: 18px; 
    color: #ffd700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

p {
    font-size: 1.1em; 
    line-height: 1.6;
    margin-bottom: 12px; 
    color: #e8e8e8;
}

.magical-text {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: 600;
}

.spell-text {
    font-style: italic;
    color: #c9a96e;
    font-size: 1.05em; 
}

.highlight {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 404 Error Styling */
.error-404 {
    font-family: 'Cinzel', serif;
    font-size: 6em !important;
    font-weight: 700;
    background: linear-gradient(45deg, #dc143c, #ff6b6b, #dc143c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    margin: 20px 0;
    animation: pulse 2s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.error-page h2 {
    color: #ff6b6b;
    font-size: 1.8em;
    margin-bottom: 20px;
}

/* Navigation Styles */
.navigation-section {
    padding: 30px 30px 20px 30px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px; 
    margin: 0;
    flex-wrap: wrap;
}

.main-nav a, .magical-button {
    display: inline-block;
    padding: 16px 30px;
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
    color: #ffd700;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.05em;
    border: 2px solid #ffd700;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
}

.main-nav a::before, .magical-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.main-nav a:hover, .magical-button:hover {
    background: linear-gradient(135deg, #a0522d 0%, #cd853f 50%, #a0522d 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.main-nav a:hover::before, .magical-button:hover::before {
    left: 100%;
}

/* Form Styles */
form {
    width: 100%
    background: rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    margin: 0 auto;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: #ffd700;
    font-size: 1.05em;
    text-align: left;
}

input[type="text"], select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 18px; 
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1em;
    font-family: 'Crimson Text', serif;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

select option {
    background: #1a1a2e;
    color: #fff;
}

input[type="submit"] {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 50%, #8b0000 100%);
    color: white;
    padding: 14px 35px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.15em;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
    margin-top: 10px;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

input[type="submit"]:hover {
    background: linear-gradient(135deg, #ff1744 0%, #d32f2f 50%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

/* Hogwarts Crest */
.hogwarts-crest {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

/* Houses container */
.houses-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 15px 0 35px 0;
}

.house-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.house-logo {
    width: 83px;
    height: 83px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    object-fit: cover;
    transition: all 0.3s ease;
}

.house-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* House Text Styling */
.gryffindor, .hufflepuff, .ravenclaw, .slytherin {
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    font-weight: 600;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px 30px 20px 30px;
    border-radius: 15px;
    margin-top: 0;
    margin-bottom: 2px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* Response Pages */
.response-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Single Column Layout for Result Pages */
.single-column {
    display: block !important;
    text-align: center;
    max-width: 600px;
    gap: 0;
}

.single-column .registration-details {
    margin: 25px 0;
    text-align: left;
}

.registration-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 22px; 
    border-radius: 10px;
    margin: 18px 0; 
    margin: 25px 0;
    text-align: left;
    border-left: 4px solid #ffd700;
}

.registration-details p {
    margin-bottom: 10px;
    text-align: left;
    font-size: 1.05em; 
}

.registration-details strong {
    color: #ffd700;
    font-family: 'Cinzel', serif;
}

.error-page .magical-container {
    border-color: #dc143c;
    box-shadow: 
        0 20px 40px rgba(220, 20, 60, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.error-page h1 {
    background: linear-gradient(45deg, #dc143c, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 22px;
    border-radius: 10px;
    margin: 18px 0;
    border-left: 4px solid #dc143c;
}

.error-details p {
    margin-bottom: 10px;
    text-align: left;
    font-size: 1.05em;
    color: #ffcccb;
}

/* Animations */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container, .magical-container {
        padding: 25px 18px;
        flex-direction: column;
        text-align: center;
        gap: 25px; 
        max-width: 95%; 
    }
    
    .form-header {
        padding-right: 0;
        margin-bottom: 0;
        min-width: auto;
    }
    
    .form-content {
        min-width: auto;
    }
    
    .navigation-section {
        padding: 22px; 
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .main-nav a, .magical-button {
        padding: 14px 22px;
        font-size: 1em;
    }
    
    h1 {
        font-size: 1.9em;
    }
    
    .error-404 {
        font-size: 4em !important;
    }
    
    form {
        padding: 22px 18px;
    }
    
    .info-section {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .container, .magical-container {
        padding: 18px 12px;
        margin-top: 15px; 
        gap: 18px; 
        max-width: 98%; 
    }
    
    .navigation-section {
        padding: 18px; 
    }
    
    .main-nav a, .magical-button {
        padding: 12px 18px;
        font-size: 0.95em;
    }
    
    h1 {
        font-size: 1.7em; 
    }
    
    .error-404 {
        font-size: 3em !important;
    }
    
    form {
        padding: 15px 18px; 
    }
    
    .info-section {
        padding: 18px; 
    }
    
    .form-header {
        min-width: auto;
    }
    
    .form-content {
        min-width: auto;
    }
}
