/* =====================================================================
   KASSOBA — Kabalega SS Old Boys Association
   Public site stylesheet: registration form, confirmation, print.
   Palette sampled from the association crest (red #ED1B24 / gold #FDC500).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* --- Brand palette --- */
    --red: #ED1B24;
    --red-dark: #B8121A;
    --red-tint: #FDEAEA;
    --gold: #FDC500;
    --gold-dark: #C99A00;
    --gold-tint: #FFF6DA;
    --cream: #FBF6EA;
    --cream-deep: #F3EBD8;
    --ink: #2B2420;
    --muted: #6E645C;
    --line: #E7DFCD;
    --white: #FFFFFF;
    --success: #2E7D46;
    --success-tint: #E8F5EC;
    --error: #C6272B;
    --error-tint: #FCEAEA;

    /* --- Type --- */
    --font-heading: 'Poppins', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    /* --- Spacing scale (airy/spacious) --- */
    --space-1: 0.5rem;
    --space-2: 0.875rem;
    --space-3: 1.5rem;
    --space-4: 2.25rem;
    --space-5: 3.25rem;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-card: 0 10px 30px -12px rgba(43, 36, 32, 0.16), 0 2px 8px -2px rgba(43, 36, 32, 0.08);
    --shadow-soft: 0 4px 14px -6px rgba(43, 36, 32, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--red-dark); }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 var(--space-1);
    color: var(--ink);
}

p { margin: 0 0 var(--space-2); }

:focus-visible {
    outline: 3px solid var(--gold-dark);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------
   Top navbar
   --------------------------------------------------------------------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.navbar {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-2) var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink);
}

.brand img { height: 44px; width: auto; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-heading); font-size: 1.02rem; }
.brand-text span { font-size: 0.78rem; color: var(--muted); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--ink); }

.nav-links { display: flex; align-items: center; gap: var(--space-3); }
.nav-links a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.94rem;
}
.nav-links a:hover { color: var(--red); }

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-2) var(--space-3);
        border-bottom: 1px solid var(--line);
        gap: var(--space-2);
        display: none;
    }
    .nav-links.is-open { display: flex; }
}

/* ---------------------------------------------------------------------
   Page shell
   --------------------------------------------------------------------- */
.page-header {
    max-width: 780px;
    margin: var(--space-4) auto var(--space-3);
    padding: 0 var(--space-3);
    text-align: center;
}
.page-header h1 { font-size: 1.7rem; }
.page-header p { color: var(--muted); font-size: 0.98rem; margin: 0; }

.form-shell {
    max-width: 780px;
    margin: 0 auto var(--space-5);
    padding: 0 var(--space-3);
}

/* ---------------------------------------------------------------------
   Progress bar
   --------------------------------------------------------------------- */
.progress-wrap { margin: var(--space-3) 0 var(--space-4); }

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.progress-labels .step-label {
    flex: 1;
    text-align: center;
    position: relative;
}
.progress-labels .step-label.active { color: var(--red-dark); font-weight: 600; }
.progress-labels .step-label:first-child { text-align: left; }
.progress-labels .step-label:last-child { text-align: right; }

.progress-track {
    height: 8px;
    background: var(--cream-deep);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.progress-fill {
    height: 100%;
    width: 14%;
    background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
    border-radius: 99px;
    transition: width 0.4s ease;
}
.progress-percent {
    text-align: right;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

/* ---------------------------------------------------------------------
   Section cards
   --------------------------------------------------------------------- */
.form-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    display: none;
    animation: sectionIn 0.35s ease;
}
.form-section.is-active { display: block; }

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .form-section { animation: none; }
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--red-dark);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.section-eyebrow svg { width: 20px; height: 20px; stroke: var(--red-dark); fill: none; stroke-width: 1.6; }

.form-section h2 { font-size: 1.28rem; margin-bottom: 0.2rem; }
.section-desc { color: var(--muted); font-size: 0.92rem; margin-bottom: var(--space-3); }

/* ---------------------------------------------------------------------
   Fields
   --------------------------------------------------------------------- */
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) {
    .field-grid, .field-grid.cols-3 { grid-template-columns: 1fr; }
}

.field { margin-bottom: var(--space-3); }
.field:last-child { margin-bottom: 0; }

.field label {
    display: block;
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
    color: var(--ink);
}
.field label .req { color: var(--red); margin-left: 2px; }
.field label .opt { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--cream);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.field textarea { resize: vertical; min-height: 110px; }

.field input:hover, .field select:hover, .field textarea:hover { border-color: #D9CDB0; }

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--red);
    border-bottom: 3px solid var(--red);
    background: var(--white);
}

.field.is-valid input, .field.is-valid select, .field.is-valid textarea {
    border-color: var(--gold-dark);
}

.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
    border-color: var(--error);
    background: var(--error-tint);
}

.field-error {
    display: none;
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}
.field.is-invalid .field-error { display: block; }

.field-hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem 1rem;
}
@media (max-width: 620px) { .checkbox-grid { grid-template-columns: 1fr; } }

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--cream);
    cursor: pointer;
    font-size: 0.9rem;
}
.checkbox-item:has(input:checked) {
    border-color: var(--gold-dark);
    background: var(--gold-tint);
}
.checkbox-item input { margin-top: 0.2rem; accent-color: var(--red); }

.radio-pill-group { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.radio-pill {
    border: 1.5px solid var(--line);
    border-radius: 99px;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    cursor: pointer;
    background: var(--cream);
}
.radio-pill:has(input:checked) {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    font-weight: 600;
}
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }

.conditional-block {
    display: none;
    border-top: 1px dashed var(--line);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
}
.conditional-block.is-visible { display: block; }

.counter {
    text-align: right;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.35rem;
}
.counter.is-over { color: var(--error); }

/* ---------------------------------------------------------------------
   Review step
   --------------------------------------------------------------------- */
.review-group { margin-bottom: var(--space-3); }
.review-group h3 {
    font-size: 0.95rem;
    color: var(--red-dark);
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.4rem;
    margin-bottom: 0.6rem;
}
.review-row { display: flex; gap: 0.75rem; font-size: 0.9rem; padding: 0.25rem 0; }
.review-row dt { flex: 0 0 42%; color: var(--muted); }
.review-row dd { margin: 0; flex: 1; font-weight: 500; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 99px;
    padding: 0.8rem 1.7rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--red); color: var(--white); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--gold); color: var(--ink); }

.btn-secondary { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--red); color: var(--red-dark); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.form-actions .spacer { flex: 1; }

/* ---------------------------------------------------------------------
   Alerts
   --------------------------------------------------------------------- */
.alert {
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
    font-size: 0.92rem;
}
.alert-error { background: var(--error-tint); color: var(--error); border: 1px solid #F3C6C6; }
.alert-success { background: var(--success-tint); color: var(--success); border: 1px solid #C7E6CF; }

/* ---------------------------------------------------------------------
   Confirmation screen
   --------------------------------------------------------------------- */
.confirmation-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    max-width: 620px;
    margin: var(--space-4) auto;
}
.confirmation-icon {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: var(--gold-tint);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-3);
}
.confirmation-icon svg { width: 34px; height: 34px; stroke: var(--red); }
.reference-box {
    display: inline-block;
    background: var(--cream);
    border: 1.5px dashed var(--gold-dark);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.4rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--red-dark);
    letter-spacing: 0.03em;
    margin: var(--space-2) 0 var(--space-3);
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--cream-deep);
    border-top: 1px solid var(--line);
    margin-top: var(--space-5);
}
.footer-row {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-row.credit {
    border-top: 1px solid var(--line);
    justify-content: center;
    font-size: 0.8rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); font-weight: 600; }
.footer-brand img { height: 30px; }

/* ---------------------------------------------------------------------
   Print styles (used on the standalone print view)
   --------------------------------------------------------------------- */
@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: var(--white); }
}


/* --- Teacher / classmate name lists ------------------------------------ */
.subsection-title { font-family: var(--font-heading); font-size: 1rem; margin: 1.6rem 0 0.9rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.name-list { display: flex; flex-direction: column; gap: 0.55rem; }
.name-row { display: flex; gap: 0.5rem; align-items: center; }
.name-row input { flex: 1; min-width: 0; }
.name-row .btn-remove-name { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.name-row .btn-remove-name:hover { border-color: var(--red); color: var(--red-dark); }
.btn-add-name { margin-top: 0.6rem; background: none; border: 1.5px dashed var(--gold-dark); color: var(--ink); padding: 0.55rem 1rem; border-radius: 10px; font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer; }
.btn-add-name:hover { background: var(--gold-tint); }
.btn-add-name[disabled] { opacity: 0.5; cursor: not-allowed; }
.field.is-invalid .name-row input { border-color: var(--error); }
