:root {
    --navy-950: #071a33;
    --navy-900: #0d2748;
    --navy-800: #15385f;
    --blue-700: #2b6ca6;
    --blue-600: #3a83c4;
    --blue-100: #eaf4fc;
    --blue-50: #f5faff;
    --white: #ffffff;
    --off-white: #f6f8fb;
    --ink: #162438;
    --muted: #68788d;
    --line: #dce5ee;
    --success: #197252;
    --success-bg: #e9f7f1;
    --warning: #825f0e;
    --warning-bg: #fff7e3;
    --danger: #913333;
    --danger-bg: #fff0f0;
    --shadow: 0 18px 45px rgba(12, 40, 73, .09);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: var(--off-white);
}

body {
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

.student-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 5%, rgba(58, 131, 196, .08), transparent 25%),
        var(--off-white);
}

.student-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 72px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.student-brand {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.student-brand img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 13px;
}

.student-brand strong,
.student-brand span {
    display: block;
}

.student-brand strong {
    color: var(--navy-950);
    font-size: 14px;
}

.student-brand span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.student-main {
    width: min(980px, calc(100% - 30px));
    margin: 28px auto 120px;
}

.student-card,
.schedule-header-card,
.subject-card,
.success-card {
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 22px;
}

.form-card {
    max-width: 720px;
    margin-inline: auto;
    padding: clamp(20px, 5vw, 38px);
}

.step-header {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--navy-900);
    color: #fff;
    font-weight: 800;
}

.step-header h1,
.schedule-header-card h1,
.success-card h1 {
    margin: 0;
    color: var(--navy-950);
}

.step-header p,
.schedule-header-card p,
.success-card p {
    color: var(--muted);
    margin: 6px 0 0;
}

.student-form {
    display: grid;
    gap: 20px;
}

.student-field {
    display: grid;
    gap: 8px;
}

.student-field > span,
.gender-fieldset legend {
    font-size: 13px;
    font-weight: 800;
    color: #34485f;
}

.student-field input,
.student-field select {
    min-height: 50px;
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #cad7e4;
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.student-field input:focus,
.student-field select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(58,131,196,.12);
}

.student-field small {
    color: var(--muted);
    line-height: 1.7;
}

.gender-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.gender-fieldset legend {
    margin-bottom: 9px;
}

.gender-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gender-option {
    position: relative;
}

.gender-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gender-option > span {
    min-height: 78px;
    border: 1px solid #d4dfe9;
    border-radius: 15px;
    padding: 14px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    transition: .16s ease;
}

.gender-option strong,
.gender-option small {
    display: block;
}

.gender-option small {
    color: var(--muted);
    margin-top: 4px;
    font-size: 11px;
}

.gender-option input:checked + span {
    background: var(--blue-50);
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(58,131,196,.09);
}

.upload-box {
    min-height: 145px;
    border: 1.5px dashed #b9c9d9;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    background: #fbfdff;
    cursor: pointer;
    text-align: center;
    padding: 18px;
}

.upload-box input {
    display: none;
}

.upload-box.has-file {
    border-color: var(--success);
    background: var(--success-bg);
}

.upload-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--blue-100);
    color: var(--blue-700);
    font-size: 23px;
}

.upload-box small {
    color: var(--muted);
}

.form-actions,
.success-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.student-button {
    min-height: 48px;
    padding: 11px 18px;
    border-radius: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
}

.student-button.primary {
    background: var(--navy-900);
    color: #fff;
}

.student-button.primary:hover {
    background: var(--navy-800);
}

.student-button.ghost {
    background: #fff;
    color: var(--navy-900);
    border-color: var(--line);
}

.student-button.large {
    min-height: 56px;
    padding-inline: 28px;
    font-size: 15px;
}

.student-alert {
    max-width: 980px;
    margin: 0 auto 18px;
    padding: 14px 16px;
    border-radius: 15px;
    border: 1px solid;
    line-height: 1.8;
}

.student-alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #f0caca;
}

.student-alert.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: #f0dfac;
}

.student-alert ul {
    margin: 7px 0 0;
}

.schedule-header-card {
    padding: 22px 24px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.step-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--blue-100);
    color: var(--blue-700);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 8px;
}

.schedule-header-card h1 {
    font-size: 26px;
}

.progress-summary {
    min-width: 110px;
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--blue-50);
    text-align: center;
}

.progress-summary span,
.progress-summary small {
    display: block;
}

.progress-summary span {
    color: var(--navy-900);
    font-size: 20px;
    font-weight: 800;
}

.progress-summary small {
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
}

.subjects-list {
    display: grid;
    gap: 14px;
}

.subject-card {
    padding: 20px;
    transition: .18s ease;
}

.subject-card.is-complete {
    border-color: #b7d8c9;
}

.subject-card.is-not-enrolled {
    background: #fbfcfd;
}

.subject-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.subject-card-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subject-index {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--blue-100);
    color: var(--blue-700);
    font-weight: 800;
    font-size: 12px;
}

.subject-card h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: 18px;
}

.subject-status {
    border-radius: 999px;
    padding: 5px 9px;
    background: #eef2f6;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.subject-status.complete {
    background: var(--success-bg);
    color: var(--success);
}

.subject-status.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.subject-status.muted {
    background: #eef1f4;
    color: #7a8797;
}

.participation-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.participation-switch label {
    position: relative;
}

.participation-switch input {
    position: absolute;
    opacity: 0;
}

.participation-switch span {
    min-height: 45px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #516174;
    font-weight: 700;
}

.participation-switch input:checked + span {
    color: var(--navy-900);
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.subject-details {
    display: none;
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}

.subject-details.show {
    display: grid;
    gap: 14px;
}

.groups-label {
    font-size: 13px;
    font-weight: 800;
    color: #34485f;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.groups-placeholder {
    grid-column: 1 / -1;
    padding: 18px;
    border: 1px dashed #cbd7e3;
    border-radius: 13px;
    color: var(--muted);
    background: #fafcfe;
    text-align: center;
}

.group-option {
    min-height: 78px;
    width: 100%;
    border: 1px solid #d7e1ea;
    border-radius: 14px;
    padding: 12px;
    background: #fff;
    color: var(--ink);
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    text-align: right;
    cursor: pointer;
}

.group-option:hover:not(:disabled) {
    border-color: #9fc7e7;
    background: var(--blue-50);
}

.group-option.selected {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
}

.group-option.disabled {
    cursor: not-allowed;
    background: #f7f8fa;
    color: #8a96a4;
}

.group-option.is-full .group-main {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.group-check {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid #bfcbd7;
    font-size: 12px;
    font-weight: 900;
}

.group-option.selected .group-check {
    background: var(--navy-900);
    color: #fff;
    border-color: var(--navy-900);
}

.group-main strong,
.group-main small {
    display: block;
}

.group-main small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.group-badge {
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.group-badge.open {
    background: var(--success-bg);
    color: var(--success);
}

.group-badge.full {
    background: var(--warning-bg);
    color: var(--warning);
}

.group-badge.conflict {
    background: #edf1f5;
    color: #647386;
}

.schedule-sticky-bar {
    position: sticky;
    bottom: 14px;
    z-index: 25;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(190,204,218,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(15px);
    box-shadow: 0 16px 45px rgba(18,43,72,.17);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}

.schedule-sticky-bar strong,
.schedule-sticky-bar small {
    display: block;
}

.schedule-sticky-bar small {
    color: var(--muted);
    margin-top: 2px;
    font-size: 10px;
}

.success-card {
    max-width: 850px;
    margin-inline: auto;
    padding: clamp(22px, 5vw, 40px);
    text-align: center;
}

.success-mark {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    font-size: 30px;
    font-weight: 900;
}

.application-number-box {
    margin: 24px auto;
    padding: 16px;
    max-width: 460px;
    background: var(--blue-50);
    border: 1px solid #d5e9f8;
    border-radius: 17px;
}

.application-number-box span,
.application-number-box strong {
    display: block;
}

.application-number-box span {
    color: var(--muted);
    font-size: 11px;
}

.application-number-box strong {
    direction: ltr;
    margin: 6px 0 10px;
    color: var(--navy-900);
    font-size: 22px;
    letter-spacing: .6px;
}

.application-number-box button {
    border: 0;
    background: transparent;
    color: var(--blue-700);
    font-weight: 800;
    cursor: pointer;
}

.student-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 25px;
    text-align: right;
}

.student-summary-grid > div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
}

.student-summary-grid span,
.student-summary-grid strong {
    display: block;
}

.student-summary-grid span {
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 4px;
}

.schedule-result {
    text-align: right;
    margin-top: 22px;
}

.schedule-result h2 {
    color: var(--navy-900);
    font-size: 17px;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px 3px;
    border-bottom: 1px solid var(--line);
}

.result-row strong,
.result-row span {
    display: block;
}

.result-row span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

.success-actions {
    margin-top: 25px;
}

/* Landing */
.landing-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 18%, rgba(58,131,196,.13), transparent 28%),
        radial-gradient(circle at 80% 85%, rgba(21,56,95,.12), transparent 26%),
        linear-gradient(150deg, #f8fbfe, #eef5fb);
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    justify-items: center;
    background: linear-gradient(145deg, var(--navy-950), var(--navy-800));
    transition: opacity .55s ease, transform .55s ease;
}

.intro-screen.hide {
    opacity: 0;
    transform: scale(1.025);
    pointer-events: none;
}

.intro-logo-wrap {
    position: relative;
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    animation: introPop .8s cubic-bezier(.2,.8,.2,1) both;
}

.intro-ring {
    position: absolute;
    inset: -8px;
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,.22);
    animation: ringPulse 1.4s ease-in-out infinite;
}

.intro-logo {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 28px;
    box-shadow: 0 22px 60px rgba(0,0,0,.3);
}

.intro-text {
    margin-top: 18px;
    text-align: center;
    color: #fff;
    animation: introText .7s .35s both;
}

.intro-text strong,
.intro-text span {
    display: block;
}

.intro-text strong {
    font-size: 20px;
}

.intro-text span {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.66);
}

.landing-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
}

.landing-page.show {
    opacity: 1;
    transform: translateY(0);
}

.landing-card {
    width: min(620px, 100%);
    padding: clamp(28px, 6vw, 52px);
    border-radius: 30px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(207,221,234,.9);
    box-shadow: 0 28px 80px rgba(17,49,82,.14);
    backdrop-filter: blur(10px);
    text-align: center;
}

.landing-logo-box img {
    width: 108px;
    height: 108px;
    border-radius: 25px;
    object-fit: cover;
    box-shadow: 0 14px 34px rgba(12,42,75,.14);
}

.landing-kicker {
    display: inline-block;
    margin-top: 20px;
    color: var(--blue-700);
    font-size: 11px;
    font-weight: 800;
}

.landing-card h1 {
    margin: 7px 0 9px;
    color: var(--navy-950);
    font-size: clamp(27px, 6vw, 38px);
}

.landing-subtitle {
    margin: 0 auto;
    max-width: 460px;
    color: var(--muted);
    line-height: 1.9;
}

.season-chip {
    width: fit-content;
    margin: 22px auto;
    padding: 8px 13px;
    border-radius: 999px;
    background: var(--blue-50);
    border: 1px solid #dbeaf6;
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
}

.season-chip strong {
    color: var(--navy-900);
}

.landing-note {
    color: var(--muted);
    font-size: 11px;
    margin: 13px 0 0;
}

.registration-closed {
    margin-top: 24px;
    border-radius: 14px;
    padding: 14px;
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 800;
}

@keyframes introPop {
    from {
        opacity: 0;
        transform: scale(.78) translateY(12px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes introText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ringPulse {
    0%, 100% {
        opacity: .35;
        transform: scale(.98);
    }
    50% {
        opacity: .8;
        transform: scale(1.04);
    }
}

@media (max-width: 720px) {
    .student-main {
        width: min(100% - 22px, 980px);
        margin-top: 16px;
    }

    .form-card,
    .subject-card,
    .schedule-header-card,
    .success-card {
        border-radius: 17px;
    }

    .schedule-header-card {
        align-items: stretch;
        flex-direction: column;
    }

    .progress-summary {
        width: fit-content;
    }

    .groups-grid {
        grid-template-columns: 1fr;
    }

    .schedule-sticky-bar {
        bottom: 8px;
    }

    .student-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .student-topbar {
        height: 64px;
    }

    .student-brand {
        width: calc(100% - 24px);
    }

    .student-brand img {
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }

    .gender-options,
    .participation-switch {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions,
    .success-actions {
        flex-direction: column-reverse;
    }

    .form-actions .student-button,
    .success-actions .student-button {
        width: 100%;
    }

    .group-option {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .group-badge {
        grid-column: 2;
        width: fit-content;
    }

    .schedule-sticky-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-sticky-bar .student-button {
        width: 100%;
    }

    .result-row {
        grid-template-columns: 1fr;
    }

    .landing-card {
        border-radius: 24px;
    }
}

@media print {
    .student-topbar,
    .success-actions {
        display: none !important;
    }

    .student-body,
    .student-main {
        background: #fff;
        margin: 0;
        width: 100%;
    }

    .success-card {
        box-shadow: none;
        border: 0;
    }
}
