:root {
    color-scheme: light;
    --brand-primary: #294923;
    --brand-secondary: #afc600;
    --brand-accent: #d6e45a;
    --surface: #ffffff;
    --surface-muted: #f3f6eb;
    --text: #1e2b21;
    --text-muted: #4d5c50;
    --border: #cbd6c5;
    --focus: #995000;
}

* { box-sizing: border-box; }

html { background: var(--surface-muted); }

body {
    margin: 0;
    min-width: 0;
    color: var(--text);
    font: 1rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
    border-top: 5px solid var(--brand-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: calc(100% - 2rem);
    max-width: 52rem;
    min-height: 5.5rem;
    margin: 0 auto;
    padding: 0.65rem 0;
}

.school-logo {
    display: block;
    flex: none;
    width: 3.75rem;
    height: auto;
}

.site-header__identity { display: grid; min-width: 0; gap: 0.2rem; }
.site-header__school { font-size: 0.8rem; font-weight: 720; line-height: 1.3; }
.site-header__council { color: var(--brand-primary); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.page-shell {
    width: calc(100% - 2rem);
    max-width: 52rem;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.page-shell--narrow { max-width: 42rem; }
.intro-section { margin-bottom: 1.6rem; }
.section-kicker { margin: 0 0 0.5rem; color: var(--brand-primary); font-size: 0.82rem; font-weight: 780; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { max-width: 19ch; margin: 0; font-size: clamp(2rem, 7vw, 3rem); font-weight: 720; line-height: 1.12; letter-spacing: -0.025em; }
h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.intro { max-width: 40rem; margin: 0.9rem 0 0; color: var(--text-muted); }
.rate-note { margin: 1.25rem 0 0; padding: 0.9rem 1rem; border-left: 4px solid var(--brand-secondary); border-radius: 0 0.5rem 0.5rem 0; background: #eef3d4; color: var(--text); font-weight: 600; }

.payment-form, .summary-card, .notice {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
}

.payment-form { padding: 1.15rem; box-shadow: 0 8px 28px rgb(28 49 24 / 5%); }
.form-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.form-heading p { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.95rem; }

.child-card {
    min-width: 0;
    margin: 1.35rem 0 0;
    padding: 1.05rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
}

.child-card legend { padding: 0 0.4rem; color: var(--brand-primary); font-size: 0.97rem; font-weight: 760; }
.field-grid { display: grid; gap: 0.9rem; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 0.35rem; font-size: 0.94rem; font-weight: 650; }

input, select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid #758775;
    border-radius: 0.55rem;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

input:hover, select:hover { border-color: var(--brand-primary); }
button, .back-link { min-height: 48px; border-radius: 0.55rem; font: inherit; font-weight: 720; cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.add-child {
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--brand-primary);
    background: var(--surface);
    color: var(--brand-primary);
    text-align: center;
}

.add-child:hover { background: var(--surface-muted); }
.add-child[hidden] { display: none; }
.remove-child { display: block; margin-top: 0.75rem; padding: 0.5rem 0.65rem; border: 0; background: transparent; color: var(--brand-primary); text-decoration: underline; text-underline-offset: 0.2em; }
.remove-child:hover { background: var(--surface-muted); }

.total {
    display: grid;
    gap: 0.1rem;
    margin: 1.5rem 0 1rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--brand-accent);
    border-radius: 0.75rem;
    background: #edf3d5;
}

.total__label { font-size: 0.9rem; font-weight: 700; }
.total strong { font-size: clamp(1.8rem, 7vw, 2.3rem); line-height: 1.2; }
.total small { margin-top: 0.25rem; color: var(--text-muted); font-size: 0.85rem; }
.submit-button, .back-link { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.2rem; border: 1px solid var(--brand-primary); background: var(--brand-primary); color: #ffffff; text-decoration: none; }
.submit-button { width: 100%; }
.submit-button:hover, .back-link:hover { background: #203b1b; }

.summary-card { margin-top: 1.6rem; padding: 0.5rem 1.2rem; box-shadow: 0 8px 28px rgb(28 49 24 / 5%); }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.summary-row + .summary-row { border-top: 1px solid var(--border); }
.summary-row span { color: var(--text-muted); }
.summary-row strong { flex: none; text-align: right; }
.summary-row--total strong { color: var(--brand-primary); font-size: 1.6rem; }
.notice { margin: 1.2rem 0 0; padding: 1rem 1.2rem; background: #edf3d5; }
.notice--error { border-left: 4px solid var(--brand-secondary); background: var(--surface); }
.back-link { margin-top: 1.2rem; }
.payment-action { margin-top: 1.5rem; }
.test-note { margin: 0.85rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.test-banner { margin: 1.5rem 0 0; padding: 0.85rem 1rem; border: 2px solid var(--brand-primary); border-radius: 0.65rem; background: var(--brand-accent); color: var(--text); font-weight: 800; }
.simulator-actions { display: grid; gap: 0.8rem; margin-top: 1.5rem; }
.simulator-actions .add-child { margin-top: 0; }
.quiet-link { display: inline-flex; align-items: center; min-height: 48px; margin-top: 1rem; color: var(--brand-primary); font-weight: 650; }

@media (min-width: 42rem) {
    .site-header__inner { gap: 1.15rem; min-height: 6.5rem; }
    .school-logo { width: 4.5rem; }
    .site-header__school { font-size: 0.96rem; }
    .site-header__council { font-size: 0.82rem; }
    .page-shell { padding-top: 3.5rem; }
    .payment-form { padding: 1.8rem; }
    .child-card { padding: 1.35rem; }
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field:last-child { max-width: 14rem; }
    .add-child { width: auto; }
}

@media (min-width: 52rem) {
    .field-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 9rem; }
}
