/*
 * Speaker declarations (/speaker-forms/) — the guest lecturer's signing page.
 *
 * Lifted from `Website Redesign/speaker-forms/mockups/speaker-form.html`, which was
 * calibrated against thl-theme 0.6.16: style.css :root tokens verbatim, contact.css form
 * grammar, sla.css written-page head. The mockup's own chrome (the state switcher and the
 * implementation notes) is not here, and neither are the tokens: :root in style.css owns
 * those and redefining them here would be the drift the Design Guide warns about.
 *
 * 🔴 ENQUEUED ON `is_page_template('page-speaker-forms.php') || is_page('speaker-forms')`.
 * The template renders on the slug alone, but `is_page_template()` reads post meta and
 * returns FALSE when the template was never chosen in the editor, so a slug-only page
 * would load none of this. See `reference_wp_page_template_slug_trap`.
 *
 * 🔴 NO DOWNLOAD BUTTONS ON THE CONFIRMATION. D4 (5 Sep 2026): nothing is stored on the
 * server, so there is nothing to serve. The `.dl` rules the mockup carried are gone
 * deliberately; do not restore them without restoring the storage decision first.
 *
 * 🔴 THIS PAGE RENDERS ITS OWN DOCUMENT SHELL, without the site header or footer (P10).
 * That is why `body` and the reset are redefined below: style.css is still loaded, but the
 * page-level classes it targets are not present.
 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--t-mid);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 14px; }

/* ---- Slim header -------------------------------------------------------- */
.sf-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: var(--nav-h); padding: 0 48px;
  border-bottom: 1px solid var(--line); background: var(--bg-deep);
}
.brandlock { display: inline-flex; align-items: center; gap: 12px; }
.brandmark { display: grid; gap: 2.5px; width: 30px; }
.brandmark i { display: block; height: 6px; border-radius: 1px; }
.brandmark i:nth-child(1) { background: #cfd3d4; }
.brandmark i:nth-child(2) { background: var(--navy); }
.brandmark i:nth-child(3) { background: var(--blue); }
.brandword { font-size: 14px; font-weight: 600; letter-spacing: 0.1em; color: var(--t-strong); }
.sf-head .who { font-size: 12.5px; color: var(--t-soft); }

/* ---- Page head ---------------------------------------------------------- */
.sf-phead {
  padding: 72px 48px 48px;
  background:
    radial-gradient(ellipse 60% 120% at 88% 0%, rgba(122,175,201,0.10) 0%, transparent 58%),
    linear-gradient(180deg, #16202e 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--line);
}
.sf-inner { max-width: 820px; margin: 0 auto; }
.kicker {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--blue-bright); margin-bottom: 14px;
}
.sf-phead h1 {
  margin: 0 0 16px; font-size: clamp(30px, 4.4vw, 46px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1; color: var(--t-strong);
}
.sf-phead .lede { font-size: 16px; line-height: 1.7; color: var(--t-mid); margin: 0; }
.sf-phead .lede b { color: var(--t-strong); font-weight: 600; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--t-mid);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 14px;
}
.chip svg { width: 14px; height: 14px; color: var(--blue); }

/* ---- Body ---- */
.sf-wrap { padding: 44px 48px 90px; }
.sf-col { max-width: 820px; margin: 0 auto; }

.step { margin-bottom: 26px; }
.step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.step-n {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--t-soft);
}
.step h2 {
  margin: 0 0 8px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 700;
  letter-spacing: -0.01em; color: var(--t-strong); line-height: 1.25;
}
.step .sub { font-size: 14.5px; color: var(--t-soft); margin: 0 0 18px; }

.panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 30px;
}
.panel + .panel { margin-top: 14px; }

/* Declaration text: plain prose on a deeper ground, no accent edge. */
.deed {
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 24px;
  font-size: 14.5px; line-height: 1.75; color: var(--t-mid);
}
.deed p:last-child { margin-bottom: 0; }
.deed .ins { color: var(--t-strong); font-weight: 600; border-bottom: 1px solid var(--line-2); }

/* Fields */
.row { margin-bottom: 20px; }
.row:last-child { margin-bottom: 0; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--t-strong); margin-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--t-soft); margin: 7px 0 0; }
input[type="text"], input[type="email"], textarea {
  width: 100%; font-family: inherit; font-size: 15px; line-height: 1.5;
  color: var(--t-strong); background: var(--bg-deep);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: var(--t-soft); }
input:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(122,175,201,0.18); background: #0f141d;
}
input[readonly] { color: var(--t-mid); background: rgba(255,255,255,0.02); border-style: dashed; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Required marker. A quiet asterisk, not a red flag: the submit button is what
   actually enforces completeness, and the site has no red-on-dark convention. */
.req { color: var(--blue-bright); font-weight: 700; margin-left: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.err { display: none; margin: 7px 0 0; font-size: 12.5px; color: #e79a9a; }
.row.bad .err { display: block; }
.row.bad input { border-color: rgba(217,154,154,0.6); box-shadow: 0 0 0 3px rgba(217,154,154,0.14); }

/* Choice rows */
.choice {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 16px 18px; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s;
}
.choice + .choice { margin-top: 12px; }
.choice:hover { border-color: rgba(122,175,201,0.4); }
.choice input { margin: 4px 0 0; accent-color: var(--blue); width: 17px; height: 17px; flex: 0 0 auto; }
.choice span { font-size: 14.5px; line-height: 1.65; color: var(--t-mid); }
.choice.sel { border-color: var(--blue); background: rgba(122,175,201,0.06); }
.choice.sel span { color: var(--t-strong); }

/* Affiliation grid */
.aff { margin-top: 20px; }
.aff[hidden] { display: none; }
.aff-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--t-soft); padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.aff-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.aff-row label.t { display: flex; gap: 11px; align-items: center; font-size: 14.5px; color: var(--t-mid); cursor: pointer; margin: 0; font-weight: 400; }
.aff-row input[type="checkbox"] { accent-color: var(--blue); width: 17px; height: 17px; flex: 0 0 auto; }
.aff-row input[type="text"] { padding: 9px 12px; font-size: 14px; }
.aff-row input[type="text"]:disabled { opacity: 0.35; cursor: not-allowed; }

/* Acknowledgement + consent ticks */
.tick { display: flex; gap: 13px; align-items: flex-start; cursor: pointer; }
.tick input { margin: 3px 0 0; accent-color: var(--blue); width: 18px; height: 18px; flex: 0 0 auto; }
.tick span { font-size: 14.5px; line-height: 1.65; color: var(--t-mid); }

/* Disclosure */
details.pol { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
details.pol summary {
  cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-bright);
}
details.pol summary::-webkit-details-marker { display: none; }
details.pol summary::after { content: ' +'; }
details.pol[open] summary::after { content: ' −'; }
details.pol .polbody { margin-top: 14px; font-size: 13.5px; line-height: 1.7; color: var(--t-soft); }
details.pol ul { margin: 10px 0 0; padding-left: 18px; }
details.pol li { margin-bottom: 9px; }

/* ---- Signature pad ------------------------------------------------------ */
.padwrap { position: relative; }
.pad {
  width: 100%; height: 210px; display: block;
  background: var(--bg-deep);
  border: 1px solid var(--line-2); border-radius: 12px;
  touch-action: none; cursor: crosshair;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.pad.inked { border-color: rgba(122,175,201,0.45); }
.pad:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(122,175,201,0.18); }
.padhint {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; font-size: 14px; color: var(--t-soft); letter-spacing: 0.02em;
}
.padhint.gone { display: none; }
.padrule {
  position: absolute; left: 26px; right: 26px; bottom: 46px;
  height: 1px; background: var(--line); pointer-events: none;
}
.padbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.padtools { display: flex; gap: 8px; }
.tbtn {
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--t-mid);
  background: transparent; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; transition: all .2s var(--ease);
}
.tbtn:hover { border-color: var(--blue); color: var(--t-strong); }
.tbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.tbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(122,175,201,0.18); }
.padstate { font-size: 12.5px; color: var(--t-soft); }
.padstate.ok { color: #7fcf9b; }

/* ---- Submit ------------------------------------------------------------- */
.submit-row { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: var(--navy-deeper); background: var(--blue);
  border: 0; border-radius: 9px; padding: 14px 26px; cursor: pointer;
  transition: background .2s, transform .15s var(--ease-out), box-shadow .2s;
}
.btn-cta:hover { background: var(--blue-bright); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(122,175,201,0.25); }
.btn-cta:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-cta:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; }
.btn-cta svg { width: 18px; height: 18px; }
.submit-note { font-size: 12.5px; color: var(--t-soft); max-width: 380px; line-height: 1.6; }

/* ---- Terminal states ---------------------------------------------------- */
.terminal { max-width: 620px; margin: 0 auto; text-align: left; }
.tstate-icon { width: 46px; height: 46px; margin-bottom: 22px; }
.tstate-icon.ok { color: #7fcf9b; }
.tstate-icon.off { color: var(--t-soft); }
.terminal h2 { margin: 0 0 14px; font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; color: var(--t-strong); }
.terminal p { font-size: 15px; line-height: 1.7; }
.terminal a.lnk { color: var(--blue-bright); }
.terminal a.lnk:hover { text-decoration: underline; text-underline-offset: 3px; }


/* ---- Footer ------------------------------------------------------------- */
.sf-foot {
  background: #090c12; border-top: 1px solid var(--line);
  padding: 34px 48px; font-size: 12.5px; color: var(--t-soft);
}
.sf-inner { max-width: 820px; margin: 0 auto; }
.sf-foot a { color: var(--t-mid); }
.sf-foot a:hover { color: var(--blue-bright); }

@media (max-width: 820px) {
  .sf-head, .sf-phead, .sf-wrap, .sf-foot { padding-left: 24px; padding-right: 24px; }
  .sf-phead { padding-top: 52px; padding-bottom: 36px; }
  .sf-wrap { padding-top: 32px; padding-bottom: 64px; }
  .panel { padding: 22px 20px; }
  .two { grid-template-columns: 1fr; }
  .aff-head { display: none; }
  .aff-row { grid-template-columns: 1fr; gap: 9px; padding: 14px 0; }
  .pad { height: 180px; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .btn-cta { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Added for the real page (not in the mockup) ------------------------- */

/*
 * The honeypot. Positioned off-screen rather than display:none, because some bots
 * skip fields they can tell are hidden and fill the ones they cannot.
 */
.sf-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/*
 * Server-side validation summary. Only ever rendered when a POST failed validation,
 * which on this page means somebody got past the disabled button: JavaScript off, a
 * stale tab, or a hand-made POST. It has to explain itself, because the client-side
 * hints they would normally have seen never ran.
 */
.sf-alert {
  border: 1px solid rgba(217,154,154,0.45); background: rgba(217,154,154,0.07);
  border-radius: 12px; padding: 18px 20px; margin: 0 0 26px; color: var(--t-mid);
}
.sf-alert p { margin: 0 0 10px; }
.sf-alert strong { color: var(--t-strong); font-weight: 600; }
.sf-alert ul { margin: 0; padding-left: 20px; font-size: 14.5px; }
.sf-alert li { margin-bottom: 6px; }
.sf-alert li:last-child { margin-bottom: 0; }

/* The terminal states sit inside .sf-wrap without the form's column. */
.sf-wrap .terminal { padding-top: 8px; }

/*
 * Submitting state. The POST renders two PDFs through mPDF and sends two emails, so it
 * is not instant. Without this the lecturer taps a button that appears to do nothing and
 * taps it again; the write-once guard handles the double POST correctly, but the right
 * fix is to stop it looking broken in the first place.
 */
.btn-cta.busy { opacity: 0.65; cursor: progress; }

/*
 * The privacy notice, sitting under the submit button at the point of collection.
 *
 * 🔴 Quiet, not hidden. It is smaller and softer than the form's own copy because it is
 * reference rather than instruction, but it is plain text on the page, not a disclosure
 * anyone has to open. A notice behind a <details> is a notice most people never read,
 * which defeats the reason it is on the page at all.
 */
.privacy {
  margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.7; color: var(--t-soft); max-width: 68ch;
}
.privacy strong { color: var(--t-mid); font-weight: 600; }
.privacy a.lnk { color: var(--blue-bright); }
.privacy a.lnk:hover { text-decoration: underline; text-underline-offset: 3px; }

/*
 * The error state's icon (thl-core missing). Amber rather than the closed state's grey:
 * this is not one of the three normal endings and must not read as one.
 */
.tstate-icon.warn { color: #e6b277; }
