:root {
    --navy: #071a3d;
    --blue: #1358d8;
    --cyan: #1bb8df;
    --teal: #18a999;
    --ink: #17223a;
    --muted: #6b7890;
    --line: #dbe4f0;
    --surface: rgba(255, 255, 255, .94);
    --danger: #c93838;
    --success: #16865c;
    --shadow: 0 30px 80px rgba(7, 26, 61, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: linear-gradient(145deg, #edf7ff 0%, #f8fbff 45%, #eaf5ff 100%);
}
button, input { font: inherit; }

.page-shell {
    position: relative;
    min-height: 100vh;
    padding: 48px 20px;
    overflow: hidden;
}
.ambient { position: fixed; border-radius: 50%; filter: blur(1px); pointer-events: none; animation: float 9s ease-in-out infinite; }
.ambient-one { width: 420px; height: 420px; top: -170px; right: -120px; background: radial-gradient(circle, rgba(27,184,223,.28), transparent 70%); }
.ambient-two { width: 520px; height: 520px; left: -220px; bottom: -230px; background: radial-gradient(circle, rgba(19,88,216,.18), transparent 70%); animation-delay: -4s; }
@keyframes float { 50% { transform: translate3d(0, 22px, 0) scale(1.04); } }

.registration-card, .success-card {
    position: relative;
    width: min(940px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
    animation: rise .65s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* IRIA 2027 quiz registration header banner */
.quiz-banner-header {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid rgba(7, 26, 61, .08);
    padding: 0;
    overflow: hidden;
}

.quiz-banner-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
}

@media (max-width: 760px) {
    .quiz-banner-header {
        padding: 0;
    }

    .quiz-banner-image {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: cover;
        border-radius: 0;
    }
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.hero {
    display: flex;
    gap: 22px;
    align-items: center;
    padding: 42px 48px 34px;
    color: white;
    background: linear-gradient(120deg, var(--navy), #0c3c86 56%, #0e79a9);
    position: relative;
    isolation: isolate;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle at 84% 24%, rgba(255,255,255,.17) 0 2px, transparent 3px), radial-gradient(circle at 74% 70%, rgba(255,255,255,.11) 0 2px, transparent 3px);
    background-size: 36px 36px, 52px 52px;
}
.brand-mark {
    flex: 0 0 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    font-weight: 800;
    letter-spacing: -.04em;
    font-size: 24px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 1px rgba(255,255,255,.25);
}
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; color: #87e8ff; }
.hero h1, .success-card h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -.04em; }
.hero-copy { margin: 12px 0 0; color: rgba(255,255,255,.76); }

.alert { margin: 26px 48px 0; padding: 16px 18px; border-radius: 14px; font-size: 14px; }
.alert-error { color: #8e2525; background: #fff1f1; border: 1px solid #f2c9c9; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }

.progress-wrap { padding: 32px 48px 10px; }
.progress-track { height: 4px; background: #e4eaf2; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .4s ease; }
.step-indicators { display: flex; justify-content: space-between; margin-top: -14px; }
.step-dot { border: 0; background: transparent; color: var(--muted); display: grid; justify-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.step-dot span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: white; border: 2px solid #dce4ef; transition: .3s ease; }
.step-dot.active { color: var(--blue); }
.step-dot.active span, .step-dot.complete span { color: white; border-color: var(--blue); background: var(--blue); box-shadow: 0 5px 16px rgba(19,88,216,.26); }

form { padding: 16px 48px 38px; }
.form-step { display: none; opacity: 0; transform: translateX(18px); }
.form-step.active { display: block; animation: stepIn .38s ease forwards; }
@keyframes stepIn { to { opacity: 1; transform: translateX(0); } }
.section-heading { display: flex; gap: 16px; align-items: center; margin: 14px 0 26px; }
.section-number { flex: 0 0 48px; height: 48px; display: grid; place-items: center; color: var(--blue); border-radius: 15px; background: #edf4ff; font-weight: 800; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #34425b; }
.field label span, .upload-card em { color: var(--danger); font-style: normal; }
.field input:not([type="checkbox"]), .input-prefix {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.field input:not([type="checkbox"]) { padding: 0 15px; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(19,88,216,.10); }
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(201,56,56,.08); }
.input-prefix { display: flex; align-items: center; overflow: hidden; }
.input-prefix > span { padding: 0 12px; color: var(--muted); font-size: 13px; border-right: 1px solid var(--line); }
.input-prefix input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.field-error { display: block; min-height: 17px; margin-top: 6px; color: var(--danger); font-size: 12px; }

.student-panel { margin: 0 0 24px; padding: 24px; border: 1px solid #e0e8f2; border-radius: 18px; background: linear-gradient(180deg, #fff, #fbfdff); }
.student-panel legend { padding: 0 10px; font-weight: 800; color: var(--navy); }
.student-panel legend span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 9px; background: var(--navy); color: white; font-size: 13px; }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.upload-card { position: relative; min-height: 220px; padding: 24px 18px 18px; border: 1.5px dashed #bdcbe0; border-radius: 18px; background: #fbfdff; text-align: center; cursor: pointer; transition: .25s ease; overflow: hidden; }
.upload-card:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(19,88,216,.09); }
.upload-card.has-file { border-style: solid; border-color: var(--teal); background: #f2fffb; }
.upload-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 48px; height: 48px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 14px; background: #eaf2ff; color: var(--blue); font-size: 25px; font-weight: 700; }
.upload-card strong, .upload-card small, .file-name { display: block; }
.upload-card strong { line-height: 1.35; font-size: 14px; }
.upload-card small { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.file-name { margin-top: 15px; padding: 8px 10px; border-radius: 9px; background: white; color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-card .field-error { white-space: normal; }
.consent-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding: 16px; border-radius: 13px; background: #f4f8fc; color: #4d5b70; font-size: 13px; line-height: 1.5; }
.consent-row input { margin-top: 3px; accent-color: var(--blue); }
.consent-error { margin-left: 16px; }

.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 22px; border: 0; border-radius: 13px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, opacity .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: linear-gradient(110deg, var(--blue), #0e82bd); box-shadow: 0 10px 22px rgba(19,88,216,.22); }
.btn-secondary { color: var(--navy); background: #eaf0f7; }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.submit-btn { display: none; margin-left: auto; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card-footer { padding: 18px 48px; border-top: 1px solid #e8edf4; color: var(--muted); background: #fbfcfe; font-size: 12px; text-align: center; }

.success-shell { display: grid; place-items: center; }
.success-card { max-width: 620px; padding: 54px; text-align: center; }
.success-check { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--success), #31c18d); font-size: 40px; box-shadow: 0 16px 35px rgba(22,134,92,.25); animation: pop .5s .2s ease both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.success-card .eyebrow { color: var(--blue); }
.success-card p { color: var(--muted); line-height: 1.7; }
.registration-code { margin: 28px 0 18px; padding: 18px; border: 1px dashed #aac3ea; border-radius: 15px; background: #f4f8ff; }
.registration-code span, .registration-code strong { display: block; }
.registration-code span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.registration-code strong { margin-top: 7px; color: var(--blue); font-size: 24px; letter-spacing: .04em; }
.note { font-size: 13px; }

.admin-body { background: #f1f5fa; }
.admin-shell { width: min(1280px, calc(100% - 32px)); margin: 28px auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.admin-topbar h1 { margin: 0; font-size: 28px; }
.admin-topbar p { margin: 5px 0 0; color: var(--muted); }
.admin-actions { display: flex; gap: 10px; }
.admin-panel { background: white; border: 1px solid #e1e8f0; border-radius: 18px; box-shadow: 0 12px 36px rgba(7,26,61,.07); overflow: hidden; }
.admin-filter { display: flex; gap: 10px; padding: 18px; border-bottom: 1px solid #e8edf4; }
.admin-filter input { min-height: 44px; flex: 1; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: top; }
th { color: #536179; background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
td strong { color: var(--navy); }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; color: var(--success); background: #e8fbf3; font-size: 11px; font-weight: 800; }
.doc-links { display: grid; gap: 5px; }
.doc-links a { color: var(--blue); text-decoration: none; font-size: 12px; }
.pagination { display: flex; justify-content: center; gap: 7px; padding: 18px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; text-decoration: none; background: #edf2f8; color: var(--navy); }
.pagination .current { background: var(--blue); color: white; }
.login-card { max-width: 430px; margin: 10vh auto; padding: 34px; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 0; }
.login-card .field { margin-bottom: 16px; }

@media (max-width: 760px) {
    .page-shell { padding: 18px 10px; }
    .registration-card { border-radius: 20px; }
    .progress-wrap, form { padding-left: 22px; padding-right: 22px; }
    .alert { margin-left: 22px; margin-right: 22px; }
    .field-grid, .upload-grid { grid-template-columns: 1fr; }
    .student-panel { padding: 18px; }
    .upload-card { min-height: 190px; }
    .card-footer { padding: 16px 22px; }
    .success-card { padding: 36px 22px; }
    .admin-topbar, .admin-filter { align-items: stretch; flex-direction: column; }
    .admin-actions { flex-wrap: wrap; }
}

@media (max-width: 430px) {
    .registration-card { border-radius: 16px; }
    .quiz-banner-header { background: #f8fbff; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Version 2: per-student documents and final review step */
.document-panel {
    margin: 0 0 26px;
    padding: 24px;
    border: 1px solid #e0e8f2;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f8fbff);
}
.document-panel legend {
    padding: 0 10px;
    color: var(--navy);
    font-weight: 800;
}
.document-panel legend span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    border-radius: 9px;
    color: white;
    background: var(--blue);
    font-size: 13px;
}
.upload-card.invalid {
    border-color: var(--danger);
    background: #fff8f8;
}
.review-notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #cbdcf5;
    border-radius: 13px;
    color: #31527f;
    background: #f3f8ff;
    font-size: 13px;
    line-height: 1.5;
}
.review-section {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid #e1e8f1;
    border-radius: 17px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}
.review-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.review-heading h3 {
    margin: 0;
    color: var(--navy);
    font-size: 16px;
}
.review-edit {
    padding: 7px 12px;
    border: 0;
    border-radius: 9px;
    color: var(--blue);
    background: #eaf2ff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.review-edit:hover { background: #dceaff; }
.review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}
.review-grid > div {
    min-width: 0;
    padding: 13px 14px;
    border-radius: 12px;
    background: #f5f8fc;
}
.review-grid dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.review-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}
.review-documents {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.review-documents li {
    display: grid;
    grid-template-columns: minmax(170px, .8fr) minmax(0, 1.2fr);
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 11px;
    background: #f5f8fc;
}
.review-documents span {
    color: var(--muted);
    font-size: 12px;
}
.review-documents strong {
    overflow-wrap: anywhere;
    color: var(--blue);
    font-size: 12px;
    text-align: right;
}
.doc-group {
    display: grid;
    gap: 4px;
    padding-bottom: 9px;
    margin-bottom: 9px;
    border-bottom: 1px solid #edf1f5;
}
.doc-group:last-child { margin: 0; padding: 0; border: 0; }
.doc-group strong { font-size: 11px; }
.document-unavailable { color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
    .document-panel { padding: 17px; }
    .review-grid { grid-template-columns: 1fr; }
    .review-documents li { grid-template-columns: 1fr; gap: 5px; }
    .review-documents strong { text-align: left; }
    .step-dot { font-size: 10px; }
}

@media (max-width: 430px) {
    .step-dot { gap: 5px; font-size: 0; }
    .step-dot span { font-size: 11px; }
}