/* ==========================================================================
   Youth's Corner — Forms
   Used by every public lead form (Services "Get Started", Get Involved,
   event registration) and reused by the CMS. Depends on tokens.css.
   ========================================================================== */

.form{display:grid;gap:var(--sp-4);}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-4);}
@media (max-width:720px){.form-grid{grid-template-columns:1fr;}}

.field{display:grid;gap:8px;}
.field--full{grid-column:1/-1;}

.field label,.label{
  font-family:var(--f-mono);font-size:var(--t-meta);font-weight:600;
  letter-spacing:.08em;text-transform:uppercase;color:var(--forest-3);
}
/* Three surfaces again: the darkened coral is for cream forms, the bright one
   for the dark forms on the service and event pages. */
.field label .req{color:var(--coral-ink);margin-left:3px;}
.form--on-dark .field label .req,.ground-dark .field label .req{color:var(--coral);}
/* Hint text. Scoped to .field originally, but it is used on its own on five
   other screens — outside a field the rule never reached it, and the hint
   rendered at full body weight, indistinguishable from the content it was
   meant to be subordinate to. */
.hint{font-size:.8rem;color:var(--muted);line-height:1.5;}
.field .hint{margin:0;}

.input,.select,.textarea{
  width:100%;
  background:#fff;
  border:1.5px solid var(--line-2);
  border-radius:var(--r-sm);
  padding:14px 16px;
  font-family:var(--f-body);font-size:.94rem;color:var(--ink);
  transition:border-color var(--dur-fast),box-shadow var(--dur-fast),background var(--dur-fast);
}
.textarea{min-height:140px;resize:vertical;line-height:1.6;}
.select{
  appearance:none;cursor:pointer;padding-right:44px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%2312100C' stroke-width='2'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 16px center;
}
.input::placeholder,.textarea::placeholder{color:var(--muted-2);}
.input:hover,.select:hover,.textarea:hover{border-color:var(--forest-3);}
/* Two rules, because they answer different questions.

   The first is the soft state for a pointer user who clicked into a field: a
   coloured border and a faint halo, no hard ring.

   The second is the keyboard indicator, and it has to be here rather than
   inherited from base.css. That rule is written with :where(), which has zero
   specificity, so `.input:focus{outline:none}` above beat it and fields were
   left with only a 22%-alpha halo to show focus — not enough to see, and not
   enough to meet the 3:1 a focus indicator needs. Same two-tone ring as
   everything else, at a specificity that actually applies. */
.input:focus,.select:focus,.textarea:focus{
  outline:none;border-color:var(--teal-ink);
  box-shadow:0 0 0 4px rgba(15,116,108,.22);
}
.input:focus-visible,.select:focus-visible,.textarea:focus-visible{
  outline:3px solid var(--ink);
  outline-offset:2px;
  box-shadow:0 0 0 6px var(--hivis);
}
.form--on-dark .input:focus-visible,.form--on-dark .select:focus-visible,
.form--on-dark .textarea:focus-visible,.ground-dark .input:focus-visible{
  outline-color:var(--hivis);
  box-shadow:0 0 0 6px rgba(18,16,12,.55);
}

/* On dark grounds the field ground goes glassy rather than white */
.ground-dark .input,.ground-dark .select,.ground-dark .textarea,
.form--on-dark .input,.form--on-dark .select,.form--on-dark .textarea{
  background:rgba(255,255,255,.07);
  border-color:rgba(255,255,255,.24);
  color:#fff;
}
.ground-dark .input::placeholder,.form--on-dark .input::placeholder,
.ground-dark .textarea::placeholder,.form--on-dark .textarea::placeholder{color:rgba(255,255,255,.42);}
.ground-dark .field label,.form--on-dark .field label{color:var(--hivis);}
.form--on-dark .select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
}

/* ---- Validation states ---- */
.field.has-error .input,.field.has-error .select,.field.has-error .textarea{
  border-color:var(--danger);box-shadow:0 0 0 4px var(--danger-soft);
}
.field-error{
  display:flex;align-items:center;gap:7px;
  font-size:.82rem;color:var(--danger);font-weight:600;
}
.form-note{
  padding:16px 18px;border-radius:var(--r-sm);font-size:.9rem;
  display:flex;gap:12px;align-items:flex-start;
}
.form-note--ok{background:var(--ok-soft);color:var(--ok);border:1px solid rgba(0,117,58,.24);}
.form-note--error{background:var(--danger-soft);color:var(--danger);border:1px solid rgba(200,16,46,.24);}
.form-note--warn{background:var(--warn-soft);color:var(--warn);border:1px solid rgba(180,117,11,.24);}

/* ==========================================================================
   CONSENT CHECKBOX
   Required on every form that collects personal data (GDPR Art. 6/7 and
   Kenya DPA 2019 s.32). Rendered unchecked; never pre-ticked, never bundled
   with other permissions.
   ========================================================================== */
.consent{
  display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start;
  padding:18px 20px;border:1.5px solid var(--line-2);border-radius:var(--r-sm);
  background:rgba(23,163,152,.05);
}
.ground-dark .consent,.form--on-dark .consent{
  background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.2);
}
.consent input[type=checkbox]{
  appearance:none;width:22px;height:22px;flex-shrink:0;margin-top:2px;
  border:2px solid var(--forest-3);border-radius:6px;background:#fff;
  cursor:pointer;position:relative;
  transition:background var(--dur-fast),border-color var(--dur-fast);
}
.consent input[type=checkbox]:checked{background:var(--hivis);border-color:var(--hivis-2);}
.consent input[type=checkbox]:checked::after{
  content:"";position:absolute;left:6px;top:2px;width:6px;height:11px;
  border:solid var(--forest);border-width:0 2.5px 2.5px 0;transform:rotate(45deg);
}
.consent label{
  font-family:var(--f-body);font-size:.86rem;line-height:1.6;
  color:var(--muted);text-transform:none;letter-spacing:0;font-weight:400;cursor:pointer;
}
.ground-dark .consent label,.form--on-dark .consent label{color:var(--on-dark);}
.consent label a{text-decoration:underline;font-weight:600;color:var(--forest-3);}
.ground-dark .consent label a,.form--on-dark .consent label a{color:var(--hivis);}
.field.has-error .consent{border-color:var(--danger);}

/* ---- Honeypot: hidden from people, visible to naive bots ---- */
.hp-field{
  position:absolute!important;left:-9999px!important;
  width:1px;height:1px;overflow:hidden;
}

/* ---- Radio card group (used for Get Involved paths, service pickers) ---- */
.radio-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;}
.radio-card{position:relative;}
.radio-card input{position:absolute;opacity:0;width:0;height:0;}
.radio-card span{
  display:block;padding:18px 20px;border:1.5px solid var(--line-2);
  border-radius:var(--r-sm);cursor:pointer;font-weight:600;font-size:.92rem;
  transition:border-color var(--dur-fast),background var(--dur-fast),transform var(--dur-fast);
}
.radio-card span small{display:block;font-weight:400;font-size:.8rem;color:var(--muted);margin-top:4px;}
.radio-card:hover span{border-color:var(--forest-3);transform:translateY(-2px);}
.radio-card input:checked + span{border-color:var(--hivis-2);background:rgba(207,227,63,.14);}
.radio-card input:focus-visible + span{outline:3px solid var(--ink);outline-offset:2px;box-shadow:0 0 0 6px var(--hivis);}

/* ---- Form footer: primary action plus a quiet reassurance line ---- */
.form-actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap;}
.form-actions .reassure{font-size:.8rem;color:var(--muted);max-width:36ch;line-height:1.5;}
.ground-dark .form-actions .reassure,.form--on-dark .form-actions .reassure{color:var(--on-dark-soft);}

/* ==========================================================================
   COOKIE CONSENT BANNER
   Categorised. No analytics or marketing script runs before a choice is
   recorded. Styling kept calm — no full-screen block, no dark pattern.
   ========================================================================== */
.cookie-bar{
  position:fixed;left:18px;right:18px;bottom:18px;z-index:var(--z-banner);
  max-width:560px;margin-left:auto;
  background:rgba(14,31,23,.88);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  border:1px solid rgba(255,255,255,.2);border-radius:var(--r);
  padding:26px 26px 22px;color:#fff;
  box-shadow:0 24px 60px rgba(0,0,0,.4);
  transform:translateY(20px);opacity:0;pointer-events:none;
  transition:transform .4s var(--ease),opacity .4s var(--ease);
}
.cookie-bar.show{transform:none;opacity:1;pointer-events:auto;}
.cookie-bar h2{font-size:1.1rem;margin-bottom:10px;}
.cookie-bar p{font-size:.86rem;color:var(--on-dark);margin-bottom:16px;}
.cookie-bar p a{color:var(--hivis);text-decoration:underline;}
.cookie-cats{display:grid;gap:10px;margin-bottom:20px;}
.cookie-cat{
  display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:start;
  padding:12px 14px;border:1px solid rgba(255,255,255,.16);border-radius:var(--r-sm);
  background:rgba(255,255,255,.05);
}
.cookie-cat b{font-size:.85rem;display:block;}
.cookie-cat small{font-size:.76rem;color:var(--on-dark-soft);line-height:1.5;}
/* Both buttons carry equal visual weight — refusing must be no harder
   than accepting. */
.cookie-actions{display:flex;gap:10px;flex-wrap:wrap;}
.cookie-actions .btn{flex:1;min-width:140px;padding:12px 20px;font-size:.85rem;}
/* Refusing is styled to the same prominence as accepting — same size, same
   position, legible contrast. No greyed-out "reject", no buried link. */
.cookie-actions .btn--ghost{
  border-color:rgba(255,255,255,.5);color:#fff;background:rgba(255,255,255,.06);
}
.cookie-actions .btn--ghost:hover{background:#fff;color:var(--forest);border-color:#fff;}
.cookie-toggle{
  appearance:none;width:42px;height:24px;border-radius:var(--pill);
  background:rgba(255,255,255,.2);border:none;position:relative;cursor:pointer;
  transition:background var(--dur-fast);flex-shrink:0;margin-top:2px;
}
.cookie-toggle::after{
  content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;
  border-radius:50%;background:#fff;transition:transform var(--dur-fast);
}
.cookie-toggle:checked{background:var(--hivis);}
.cookie-toggle:checked::after{transform:translateX(18px);}
.cookie-toggle:disabled{opacity:.55;cursor:not-allowed;background:var(--hivis-2);}
/* ---- Category disclosure --------------------------------------------------
   On a wide screen the toggles are always visible and the disclosure label is
   hidden. On a narrow one the toggles fold away, because the full banner grew
   to roughly four fifths of the viewport — which reads as a full-screen block
   however it is worded.

   What never folds away is the choice itself: "Accept all" and "Reject
   non-essential" remain first-level buttons at every width. Only the granular
   per-category detail moves behind one tap, and the Cookie Policy carries the
   same information in full.
   ------------------------------------------------------------------------ */
.cookie-customise{display:none;}
.cookie-disclosure:focus-visible + .cookie-customise{outline:3px solid var(--hivis);outline-offset:2px;}

@media (max-width:600px){
  .cookie-bar{left:12px;right:12px;bottom:12px;padding:20px 18px 16px;}
  .cookie-bar h2{font-size:1rem;}
  .cookie-bar p{font-size:.82rem;margin-bottom:14px;}

  .cookie-customise{
    display:inline-flex;align-items:center;gap:8px;cursor:pointer;
    font-family:var(--f-mono);font-size:.74rem;letter-spacing:.08em;
    text-transform:uppercase;color:var(--hivis);
    padding:10px 0;margin-bottom:6px;
  }
  .cookie-customise svg{transition:transform var(--dur-fast);}
  .cookie-disclosure:checked + .cookie-customise svg{transform:rotate(180deg);}

  .cookie-cats{display:none;gap:8px;margin-bottom:16px;}
  .cookie-disclosure:checked ~ .cookie-cats{display:grid;}
  .cookie-cat{padding:10px 12px;align-items:center;}
  .cookie-cat small{display:none;}

  /* "Save my choices" only means anything once the toggles are on screen. */
  .cookie-actions .btn[value="custom"]{display:none;}
  .cookie-disclosure:checked ~ .cookie-actions .btn[value="custom"]{display:inline-flex;flex-basis:100%;}
  .cookie-actions .btn{min-width:0;flex:1;font-size:.8rem;padding:12px 14px;}
}

/* Hard ceiling. Whatever the copy or the viewport, the banner never takes
   more than two thirds of the screen — it scrolls inside itself instead of
   growing into a full-screen block. */
.cookie-bar{max-height:min(66vh,560px);overflow-y:auto;overscroll-behavior:contain;}

/* Error summary above a public form. The per-field messages say what is
   wrong where; this catches anything that is not tied to one field —
   a missing consent tick, or an event that filled up while the form was open. */
.form-error-list{margin-top:7px;display:grid;gap:5px;}
.form-error-list li{font-size:.85rem;padding-left:15px;position:relative;line-height:1.5;}
.form-error-list li::before{content:"";position:absolute;left:0;top:.6em;width:5px;height:5px;border-radius:50%;background:currentColor;}
