/* ============================================================
   form.css — Child Information Form styles
   Extends main2.css; matches James Nisbet Nursery School theme
   ============================================================ */

/* ── CSS custom properties (site palette) ─────────────────── */
:root {
    --green: #6FBF45;
    --green-light: #B0D951;
    --blue: #5BB9E0;
    --blue-dark: #1579BD;
    --text: #444;
    --border: #c8c8c8;
    --bg-field: #fafafa;
    --bg-section: #f4f9ee;
    --error: #c0392b;
    --error-bg: #fdf0ef;
    --success-bg: #eaf7e0;
    --success-brd: #6FBF45;
    --radius: 4px;
    --transition: 0.18s ease;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.form-page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    box-sizing: border-box;
}

/* ── Page title ────────────────────────────────────────────── */
.form-page-title {
    color: var(--green);
    font-size: 26px;
    margin: 16px 0 4px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--green-light);
}

/* ── Intro paragraph ──────────────────────────────────────── */
.form-intro {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    background: var(--bg-section);
    border-left: 4px solid var(--green);
    padding: 10px 14px;
    margin-bottom: 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Alert banners ────────────────────────────────────────── */
.alert-success,
.alert-error {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-brd);
    color: #2d6e0f;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
}

/* ── Fieldset / section card ──────────────────────────────── */
.form-section {
    border: 1px solid #dde9cc;
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 28px;
    padding: 0 20px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-section legend {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: var(--green);
    padding: 5px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.permissions-section legend {
    background: var(--blue);
}

/* ── Section note ─────────────────────────────────────────── */
.section-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin: 2px 0 14px;
    line-height: 1.5;
}

.small-note {
    font-size: 11px;
    margin-top: 10px;
}

/* ── Sub-section heading ──────────────────────────────────── */
.sub-section-heading {
    color: var(--blue-dark);
    font-size: 13px;
    margin: 18px 0 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #d8edf8;
}

/* ── Grid rows ────────────────────────────────────────────── */
.form-row {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.form-row.one-col {
    grid-template-columns: 1fr;
}

.form-row.two-col {
    grid-template-columns: 1fr 1fr;
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ── Individual field ─────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-field);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: var(--text);
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(111, 191, 69, 0.18);
    background: #fff;
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
    border-color: var(--error);
    background: var(--error-bg);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* Required asterisk */
.req {
    color: var(--error);
    margin-left: 2px;
}

/* Inline error text */
.field-error {
    font-size: 11px;
    color: var(--error);
    min-height: 14px;
}

/* ── Radio groups ─────────────────────────────────────────── */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: var(--green);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ── Checkbox groups ──────────────────────────────────────── */
.checkbox-group.stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--green);
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.sig-checkbox {
    background: var(--bg-section);
    border: 1px solid #dde9cc;
    border-radius: var(--radius);
    padding: 12px;
}

/* ── Conditional block (hidden by default) ────────────────── */
.conditional-block {
    display: none;
    border-top: 1px dashed #dde9cc;
    padding-top: 16px;
    margin-top: 8px;
}

.conditional-block.is-visible {
    display: block;
}

/* ── Permission items ─────────────────────────────────────── */
.permission-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-item p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    margin: 0 0 8px;
}

/* ── yn-group label (bold question) ──────────────────────── */
.yn-group>label {
    font-size: 13px;
    font-weight: bold;
    color: var(--text);
}

/* ── Submit area ──────────────────────────────────────────── */
.form-submit-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 10px;
}

.btn-submit {
    display: inline-block;
    background: var(--green);
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 15px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 16px;
    letter-spacing: 0.03em;
    transition: background var(--transition), transform var(--transition);
    text-transform: uppercase;
}

.btn-submit:hover {
    background: #5dad36;
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
    transform: none;
}

.g-recaptcha {
    display: inline-block;
    margin: 0 auto 6px;
}

.submit-note {
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    font-style: italic;
}

/* ── Program selection cards (Pre-Registration form) ─────── */
.program-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

.program-card {
    border: 2px solid #dde9cc;
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.program-card:has(input:checked) {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(111, 191, 69, 0.18);
}

.program-card-header {
    background: var(--green);
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    padding: 8px 14px;
    letter-spacing: 0.02em;
}

.program-card-body {
    padding: 12px 14px;
    background: var(--bg-section);
}

.program-detail {
    font-size: 13px;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.5;
}

.pref-row {
    display: flex;
    gap: 16px;
}

.fee-notice {
    background: #fff8e6;
    border: 1px solid #f0d080;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-top: 14px;
}

.fee-notice p {
    font-size: 12px;
    color: #665500;
    margin: 0 0 4px;
    line-height: 1.5;
}

.fee-notice p:last-child {
    margin-bottom: 0;
}

@media (max-width: 540px) {
    .program-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Override wrap width for the form page ────────────────── */
/* Below 1025px: override main2.css fixed widths so the form is always fluid */
@media (max-width: 1024px) {

    #wrap,
    #container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Footer: swap fixed pixel widths for fluid ones */
    #footer {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 6px 16px !important;
    }

    .foot-left,
    .foot-right {
        width: auto !important;
        max-width: 100% !important;
        float: none !important;
        flex: 1 1 auto !important;
        box-sizing: border-box !important;
    }

    .foot-right {
        text-align: right !important;
    }
}

@media (min-width: 1025px) {

    #wrap,
    #container {
        width: 1024px !important;
    }
}

/* ── Rounded bottom corners + drop shadow (replaces footer image) ── */
#wrap {
    border-radius: 0 0 18px 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
    overflow: hidden;
    /* clips container to the rounded corners */
}

/* ── Hamburger menu — banner layout overrides ─────────────── */

/* Make banner a flex row at all sizes; logo left, nav right */
#banner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: auto !important;
    padding: 8px 16px !important;
    box-sizing: border-box !important;
}

/* Logo always left, fixed size */
#banner>a img {
    width: 160px !important;
    height: auto !important;
    display: block;
}

/* Hamburger button — hidden on wide screens */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 2px solid var(--green);
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    order: 3;
    /* always rightmost */
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--green);
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

/* Animate to X when open */
.hamburger-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav div sits in the middle/right flex area */
#nav {
    float: none !important;
    margin: 0 !important;
    order: 2;
}

/* Keep the image-based nav inline on wide screens */
#nav #main-nav {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Hide text labels on desktop — images serve as the nav */
.nav-label {
    display: none;
}

/* ── Below 900px: switch to hamburger ────────────────────── */
@media (max-width: 900px) {
    .hamburger-btn {
        display: flex !important;
        /* show the ≡ button */
    }

    /* Hide the image-based nav list by default */
    #nav #main-nav {
        display: none !important;
    }

    /* Slide-down text menu when open */
    #nav #main-nav.nav-open {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 3px solid var(--green);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        z-index: 999;
        padding: 8px 0 26px;
    }

    /* Hide the bullet <li> items, show only link items */
    #nav #main-nav li:has(img:not([alt])),
    #nav #main-nav li:has(img[alt=""]) {
        display: none;
        /* hide bullet separators */
    }

    /* Replace each nav image with the text alt label */
    #nav #main-nav li a {
        display: block;
        padding: 20px 20px;
        text-decoration: none;
        font-size: 14px;
        font-weight: bold;
        color: var(--green);
        width: 100%;
        box-sizing: border-box;
    }

    #nav #main-nav li a:hover {
        background: var(--bg-section);
        color: var(--blue-dark);
    }

    /* Hide the <img> inside each nav link; show the text label span instead */
    #nav #main-nav li a img {
        display: none;
    }

    #nav #main-nav.nav-open li a .nav-label {
        display: inline;
    }

    /* Position banner relatively so menu can drop below it */
    #banner {
        position: relative !important;
    }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════════════ */

/* Tablet: collapse to two-col max */
@media (max-width: 768px) {

    #wrap,
    #container {
        width: 100% !important;
    }

    #banner {
        height: auto !important;
        width: 100% !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        box-sizing: border-box;
    }

    #banner img[alt="James Nisbet Nursery School Inc."] {
        width: 160px !important;
        height: auto !important;
    }

    #nav {
        float: none !important;
        margin: 0 !important;
    }

    #nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
    }

    /* #nav ul li img — bullet separator images, no overrides needed */

    #foot-bottom {
        width: 100% !important;
    }

    #footer {
        width: 100% !important;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 8px;
    }

    .foot-left,
    .foot-right {
        width: auto !important;
        float: none !important;
        text-align: center;
    }

    .form-row.three-col {
        grid-template-columns: 1fr 1fr;
    }

    .form-page-wrap {
        padding: 14px 16px 32px;
    }
}

/* Mobile: single column */
@media (max-width: 540px) {
    #banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #nav ul {
        justify-content: flex-start;
    }

    .form-row.two-col,
    .form-row.three-col {
        grid-template-columns: 1fr;
    }

    .form-page-title {
        font-size: 20px;
    }

    .form-section {
        padding: 0 12px 16px;
    }

    .btn-submit {
        width: 100%;
        padding: 14px 20px;
    }

    .g-recaptcha {
        transform: scale(0.9);
        transform-origin: center;
    }
}