/* ============================================
   Oxford International School — Registration
   Bright, Mobile-First Premium Design
   ============================================ */

:root {
    /* Oxford Official Colors */
    --primary: #001251;       /* Dark Blue */
    --primary-light: #1a2a6b;
    --primary-dark: #000c3b;
    
    /* Accent — Oxford Orange */
    --accent: #FF8F14;
    --accent-light: #ffa94a;
    --accent-dark: #e57900;
    --accent-glow: rgba(255, 143, 20, 0.3);
    
    /* Bright Neutrals */
    --bg: #fdfdfd;            /* Brighter background */
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #5e6b7d;
    --border: #e6e9ee;
    
    /* Feedback */
    --success: #10b981;
    --error: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,18,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,18,0.12);
    --shadow-glow: 0 6px 20px var(--accent-glow);
    
    /* Spacing */
    --radius: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── App Container ── */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

/* ── Top Bar ── */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
    border-bottom: none;
}

.top-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ── Modern Language Toggle ── */
.lang-toggle-modern {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-full);
    padding: 4px;
    position: relative;
    box-shadow: var(--shadow-sm);
    width: 90px;
}

.lang-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 41px;
    height: 28px;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.lang-btn {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    z-index: 2;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.lang-btn.active {
    color: #fff;
}

.lang-toggle-modern[data-active="ru"] .lang-slider {
    transform: translateX(41px);
}

/* ── Hero Slider Section ── */
.hero-slider {
    position: relative;
    width: 100%;
    height: 30vh;
    min-height: 200px;
    max-height: 260px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary);
}

.slides {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slider-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 60%,
        rgba(0, 18, 81, 0.85) 100%
    );
    z-index: 2;
}

.hero-content {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    padding: 0 20px;
    z-index: 3;
    text-align: center;
}

.school-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.school-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.slider-indicators {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 3;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

/* ── Form Section ── */
.form-section {
    flex: 1;
    padding: 24px 20px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 4;
    margin-top: -24px;
}

.form-header {
    text-align: center;
    margin-bottom: 16px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Progress Bar ── */
.progress-bar {
    margin-bottom: 20px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    background: var(--surface);
    transition: all 0.4s ease;
}

.step-dot.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 18, 81, 0.2);
    transform: scale(1.1);
}

.step-dot.done {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* ── Form Steps ── */
.form-step {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: slideIn 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
    display: flex;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 18, 81, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--primary);
}

/* ── Inputs ── */
.input-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-align: center;
}

.input-group {
    width: 100%;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 18, 81, 0.08);
}

.form-input::placeholder {
    color: #a0abbc;
}

/* Phone Input */
.phone-input-group {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.country-code {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: rgba(0, 18, 81, 0.04);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.phone-input {
    flex: 1;
    min-width: 0;
}

/* ── Grade Selection (Chips/Pills) ── */
.grade-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
    justify-content: center;
}

.grade-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.grade-card:active {
    transform: scale(0.95);
}

.grade-card .grade-number {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.grade-card .grade-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.grade-card.selected {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 18, 81, 0.15);
}

.grade-card.selected .grade-number,
.grade-card.selected .grade-label {
    color: #fff;
}

/* ── Language Cards ── */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.lang-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-card:active {
    transform: scale(0.98);
}

.lang-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.lang-card-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.3s ease;
}

.lang-card.selected {
    border-color: var(--primary);
    background: rgba(0, 18, 81, 0.02);
}

.lang-card.selected .lang-card-name {
    color: var(--primary);
}

.lang-card.selected .lang-card-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Error Messages ── */
.error-message {
    display: none;
    font-size: 0.8rem;
    color: var(--error);
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    animation: shake 0.4s ease;
}

.error-message.visible {
    display: block;
}

/* ── Buttons ── */
.btn-next,
.btn-submit {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 16px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 24px rgba(255, 143, 20, 0.3);
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 143, 20, 0.4);
}

.btn-next:active,
.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(255, 143, 20, 0.2);
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
}

.btn-back {
    padding: 18px 28px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
    border-color: var(--text-secondary);
    color: var(--text);
}

.btn-back:active {
    transform: scale(0.96);
    background: rgba(0,0,0,0.02);
}

.step-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
}

.step-buttons .btn-next,
.step-buttons .btn-submit {
    flex: 1;
    margin-top: 0;
}

/* ── Success Screen ── */
.success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    animation: fadeInUp 0.6s ease;
}

.success-screen.hidden {
    display: none;
}

.success-animation {
    margin-bottom: 24px;
}

/* Animated checkmark */
.checkmark {
    width: 88px;
    height: 88px;
}

.checkmark-circle {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--success);
    stroke-width: 3;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 8px;
}

.success-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 32px;
}

.submitted-info {
    width: 100%;
    background: rgba(0, 18, 81, 0.02);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.submitted-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.9rem;
}

.submitted-info .info-row:not(:last-child) {
    border-bottom: 1px dashed var(--border);
}

.submitted-info .info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.submitted-info .info-value {
    color: var(--primary);
    font-weight: 700;
    text-align: right;
}

.btn-new {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-new:active {
    background: var(--primary);
    color: #fff;
}

/* ── Footer ── */
.app-footer {
    text-align: center;
    padding: 12px 16px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--surface);
    margin-top: auto;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes strokeCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
    to { stroke-dashoffset: 0; }
}

/* ── Loading Spinner for Submit ── */
.btn-submit.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive: Tablets & Desktop ── */
@media (min-width: 481px) {
    .app-container {
        margin: 40px auto;
        border-radius: var(--radius-lg);
        overflow: hidden;
        min-height: calc(100dvh - 80px);
    }
    
    .hero-slider {
        height: 380px;
    }
    
    .school-name {
        font-size: 2rem;
    }
    
    .form-section {
        padding: 40px 48px;
    }
    
    .grade-grid {
        gap: 16px;
    }
}
