/* ════════════════════════════════════════════════════════════════════════
   The look of the pages a parent sees
   ════════════════════════════════════════════════════════════════════════
   Loaded by intake.html and declare.html. It was inline in intake.html,
   and the second page that needed it would have arrived as a copy — the
   same move that gave the admin app and the intake form two different
   sets of terms, and left attendance/config.js and the root one as two
   files that have to be kept the same by hand.

   One file instead. A colour changed here changes on both pages, which
   is the only way a parent can be shown one thing twice and have it look
   like one thing.
   ════════════════════════════════════════════════════════════════════════ */

:root{
  --bg:#F7F6FB;
  --surface:#FFFFFF;
  --surface-2:#F3F1F8;
  --border:#E8E6F0;
  --border-2:#E0DDE9;
  --text:#1A1530;
  --text-2:#42384F;
  --text-3:#6F6580;
  --primary:#6D5BD0;
  --primary-soft:#EDE9FB;
  --primary-on-soft:#4A3CA3;
  --green-bg:#DCFCE7;
  --green-tx:#15803D;
  --green-bd:#86EFAC;
  --amber-bg:#FEF3C7;
  --amber-tx:#92400E;
  --amber-bd:#FCD34D;
  --red-bg:#FEE2E2;
  --red-tx:#B91C1C;
  --red-bd:#FCA5A5;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;min-height:100%;-webkit-font-smoothing:antialiased}
body{padding:0;line-height:1.5}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--primary-on-soft)}

.page{max-width:760px;margin:0 auto;padding:24px 18px 80px}
.brand-card{background:linear-gradient(135deg,#6D5BD0 0%,#9B8BE3 100%);color:#fff;padding:24px 24px 22px;border-radius:18px;box-shadow:0 12px 40px rgba(109,91,208,.28);text-align:center;margin-bottom:18px;display:flex;flex-direction:column;align-items:center;gap:10px}
.brand-logo{width:72px;height:72px;border-radius:50%;background:#fff;padding:6px;object-fit:contain;display:block;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.brand-title{font-size:24px;font-weight:800;letter-spacing:-.4px;margin-bottom:4px}
.brand-sub{font-size:14px;opacity:.92}

.card{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:22px 22px 20px;margin-bottom:14px;box-shadow:0 2px 8px rgba(20,12,40,.04)}
.section-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.9px;color:var(--text-3);margin-bottom:14px;display:flex;align-items:center;gap:10px}
.section-title:before{content:'';display:inline-block;width:18px;height:2px;background:var(--primary);border-radius:2px}
.optional-tag{font-size:9px;text-transform:uppercase;letter-spacing:.6px;background:var(--surface-2);color:var(--text-3);padding:2px 7px;border-radius:4px;font-weight:600}
.section-hint{font-size:12px;color:var(--text-3);margin-bottom:10px;line-height:1.5}
/* Compact referral / discount code card — single horizontal row */
.referral-card{padding:14px 18px}
.referral-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.referral-text{flex:0 0 auto;min-width:0}
.referral-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.7px;color:var(--text-3);display:inline-flex;align-items:center;gap:8px}
.referral-hint{font-size:11px;color:var(--text-3);margin-top:2px}
.referral-input{flex:1;min-width:180px;text-transform:uppercase;letter-spacing:.5px;font-weight:600}

.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.field:last-child{margin-bottom:0}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field-row-3{display:grid;grid-template-columns:155px 72px 120px;gap:14px;align-items:end;justify-content:start}
label{font-size:13px;font-weight:700;color:var(--text-2)}
label .req{color:var(--red-tx);margin-left:3px}
label .opt-label{color:var(--text-3);font-size:9.5px;font-weight:400;margin-left:3px}
.input,.select{width:100%;height:48px;padding:0 14px;border:1.5px solid var(--border-2);background:var(--surface);border-radius:10px;font-size:15px;font-weight:500;color:var(--text);transition:border-color .15s, box-shadow .15s;outline:none}
.input:focus,.select:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(109,91,208,.12)}
.input:disabled{background:var(--surface-2);color:var(--text-3);cursor:not-allowed}
.input[type=date]{font-family:inherit}

.age-display{display:flex;align-items:center;justify-content:center;height:48px;padding:0 14px;background:var(--surface-2);border:1.5px solid var(--border-2);border-radius:10px;font-weight:800;color:var(--text);font-size:15px;min-width:80px}
.age-display.is-empty{color:var(--text-3);font-weight:500}

.gender-toggle{display:flex;width:100%;border:1.5px solid var(--border-2);border-radius:10px;overflow:hidden;height:48px}
.gender-opt{flex:1;min-width:0;padding:0 6px;background:transparent;border:none;cursor:pointer;font-size:12px;font-weight:700;color:var(--text-3);transition:.15s ease;border-right:1px solid var(--border-2);white-space:nowrap;text-align:center}
.gender-opt:last-child{border-right:none}
.gender-opt:hover{background:var(--surface-2)}
.gender-opt.active{background:var(--primary-soft);color:var(--primary-on-soft)}

.child-card{position:relative;background:var(--surface-2);border:1px solid var(--border-2);border-radius:14px;padding:16px;margin-bottom:12px}
.child-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.child-num{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--primary);color:#fff;font-size:12px;font-weight:800}
.child-label{font-size:13px;font-weight:800;color:var(--text-2);display:flex;align-items:center;gap:8px}
.child-remove{background:transparent;border:1px solid var(--border-2);color:var(--text-3);border-radius:8px;width:32px;height:32px;cursor:pointer;font-size:16px;line-height:1}
.child-remove:hover{background:var(--red-bg);border-color:var(--red-bd);color:var(--red-tx)}
.add-child-btn{width:100%;padding:14px;background:var(--primary-soft);border:1.5px dashed var(--primary);color:var(--primary-on-soft);border-radius:12px;font-weight:700;font-size:14px;cursor:pointer;transition:.15s ease}
.add-child-btn:hover{background:var(--primary);color:#fff}

.check-row{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;background:var(--surface-2);border:1px solid var(--border-2);border-radius:12px;cursor:pointer;transition:.15s ease;margin-bottom:12px}
.check-row:hover{border-color:var(--primary)}
.check-row.is-on{background:var(--primary-soft);border-color:var(--primary)}
.check-row input[type=checkbox]{margin-top:2px;width:20px;height:20px;flex-shrink:0;accent-color:var(--primary);cursor:pointer}
.check-row-text{font-size:14px;color:var(--text-2);line-height:1.45}
.check-row-text strong{color:var(--text);font-weight:700}

.tc-toggle{width:100%;display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:transparent;border:1.5px solid var(--border-2);border-radius:12px;color:var(--text);font-size:14px;font-weight:700;cursor:pointer;text-align:left;margin-bottom:12px}
.tc-toggle:hover{border-color:var(--primary)}
.tc-chev{font-size:14px;color:var(--text-3)}
.tc-doc{max-height:340px;overflow-y:auto;padding:18px 18px;background:var(--surface-2);border:1px solid var(--border-2);border-radius:12px;margin-bottom:12px;font-size:13px;color:var(--text-2);line-height:1.6}
.tc-doc h1{font-size:16px;font-weight:800;color:var(--text);margin:0 0 4px}
.tc-doc h2{font-size:13px;font-weight:600;color:var(--text-3);margin:0 0 14px;padding-bottom:10px;border-bottom:1px solid var(--border-2)}
.note-found{background:#E4F6EC;border:1px solid #BFE8CF;color:#0F6B40;
            border-radius:10px;padding:10px 12px;font-size:13px}
.note-found .health-note{color:#13764A}
.linkish{background:none;border:0;padding:0;font:inherit;color:inherit;
         text-decoration:underline;cursor:pointer}
.health-block{margin-top:14px;padding:14px 14px 12px;background:var(--surface-2);
              border:1px solid var(--border-2);border-radius:12px}
.health-title{font-size:13px;font-weight:800;color:var(--text);margin-bottom:4px}
.health-note{font-size:12px;color:var(--text-3);line-height:1.6;margin-bottom:10px}
.health-q{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;
          padding:9px 0;border-top:1px solid var(--border-2)}
.health-q-text{font-size:12.5px;line-height:1.55;color:var(--text-2);flex:1;min-width:0}
/* The Yes/No toggle sits on the same element as .gender-toggle, which is
   width:100% for its normal use in a form field. Here that width is what
   flex-basis:auto resolves to, so the toggle claimed the whole row and
   .health-q-text — min-width:0, so nothing stopped it — collapsed to
   zero. Every health question rendered as a column of single letters.
   A fixed width, stated after .gender-toggle so it wins, and no growing. */
.health-yn{flex:0 0 132px;width:132px}
.health-q.is-yes .health-q-text{color:var(--text);font-weight:600}
.health-details{min-height:72px;resize:vertical;font-family:inherit}
@media (max-width:560px){
  .health-q{flex-direction:column;gap:8px}
  .health-yn{align-self:flex-start}
}
.tc-doc h3{font-size:13px;font-weight:800;color:var(--text);margin:14px 0 4px}
.tc-doc h2.tc-doc-title{font-size:14px;font-weight:800;color:var(--text);letter-spacing:.3px;margin:16px 0 10px;padding:0;border:0}
.tc-doc p{margin:0 0 8px;white-space:pre-wrap}

.submit-btn{width:100%;padding:18px;background:var(--primary);color:#fff;border:none;border-radius:14px;font-size:16px;font-weight:800;cursor:pointer;transition:.15s ease;box-shadow:0 6px 20px rgba(109,91,208,.32);letter-spacing:.2px}
.submit-btn:hover:not(:disabled){background:#5C4BBF;box-shadow:0 8px 28px rgba(109,91,208,.38);transform:translateY(-1px)}
.submit-btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}

.err-banner{padding:12px 14px;background:var(--red-bg);border:1px solid var(--red-bd);color:var(--red-tx);border-radius:10px;font-size:13px;font-weight:600;margin-bottom:12px}

.success-card{background:linear-gradient(135deg,#15803D 0%,#22C55E 100%);color:#fff;padding:32px 24px;border-radius:18px;text-align:center;box-shadow:0 12px 40px rgba(22,163,74,.28)}
.success-icon{font-size:54px;line-height:1;margin-bottom:12px}
.success-title{font-size:22px;font-weight:800;margin-bottom:8px}
.success-sub{font-size:14px;opacity:.95;margin-bottom:18px;line-height:1.55}
.success-list{background:rgba(255,255,255,.16);border-radius:12px;padding:14px 18px;margin-bottom:18px;text-align:left;display:inline-block;min-width:260px}
.success-list-item{font-size:15px;font-weight:600;padding:4px 0}
.success-reset{background:#fff;color:#15803D;border:none;padding:12px 28px;border-radius:10px;font-weight:800;cursor:pointer;font-size:14px}

.footer-note{margin-top:24px;text-align:center;font-size:11px;color:var(--text-3)}
.print-pdf-row{display:flex;flex-direction:column;align-items:center;gap:5px;margin-top:18px;padding-top:16px;border-top:1px dashed var(--border-2)}
.print-pdf-link{background:none;border:none;font-family:inherit;font-size:13px;font-weight:700;color:var(--text-3);cursor:pointer;display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:7px;transition:.15s ease;text-decoration:none}
.print-pdf-link:hover{background:var(--surface-2);color:var(--text)}
.print-pdf-hint{font-size:10.5px;color:var(--text-3)}

@media (max-width:520px){
  .page{padding:14px 12px 60px}
  .brand-card{padding:22px 18px}
  .brand-title{font-size:20px}
  .card{padding:18px 16px}
  .field-row,.field-row-3{grid-template-columns:1fr;gap:10px}
  .input,.select,.gender-toggle,.age-display{height:46px}
  .submit-btn{padding:16px}
}
