/* funnel.css — shared by pilot.html, admin.html and access.html.
   Sits on top of styles.css: same tokens, same type, same colour
   semantics (green = Zara's voice, indigo = the customer, amber =
   waiting, coral = end/error). Every funnel hook is .fun-* so it
   cannot cancel page styles from styles.css. */

:root {
  /* fallbacks keep the pages whole if a token is renamed upstream */
  --fun-ink: var(--ink, #101725);
  --fun-muted: var(--muted, #5d6572);
  --fun-line: var(--line, #e8e7ee);
  --fun-paper: var(--bg, #ffffff);
  --fun-navy: var(--navy, #0a1022);
  --fun-night: var(--night, #0d1c3d);
  --fun-cream: var(--cream, #f2efe6);
  --fun-zara: var(--voice, #16946b);
  --fun-zara-bright: var(--green-bright, #3fd6a4);
  --fun-customer: var(--accent, #4452c9);
  --fun-amber: var(--amber, #f0b35c);
  --fun-coral: var(--coral, #e2543e);
  --fun-radius: var(--radius, 26px);
  --fun-col: 46rem;
  /* the dusk canvas, as the hero and pilot panel use it */
  --fun-dusk: var(--dusk,
    radial-gradient(ellipse 50% 60% at 80% 14%, rgba(186, 198, 226, 0.35), transparent 62%),
    radial-gradient(ellipse 48% 58% at 16% 26%, rgba(120, 146, 184, 0.30), transparent 60%),
    radial-gradient(ellipse 58% 55% at 60% 98%, rgba(150, 190, 170, 0.32), transparent 64%),
    radial-gradient(ellipse 42% 42% at 94% 84%, rgba(236, 210, 168, 0.24), transparent 60%),
    linear-gradient(155deg, #46596d 0%, #50657c 40%, #607a88 72%, #71908c 100%));
}

* { box-sizing: border-box; }

/* hidden must beat every display: rule in this sheet */
[hidden] { display: none !important; }

body { background: var(--fun-paper); }

main {
  padding: clamp(2.2rem, 5vw, 4rem) 1.5rem clamp(3rem, 7vw, 5rem);
}

.fun-wrap {
  width: 100%;
  max-width: var(--fun-col);
  margin: 0 auto;
}

.fun-wrap-wide {
  width: 100%;
  max-width: min(72rem, 92vw);
  margin: 0 auto;
}

/* ---------- shared header ---------- */

/* ---------- shared footer ---------- */

.fun-foot {
  border-top: 1px solid var(--fun-line);
  padding: 1.6rem 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--fun-muted);
}

.fun-foot-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--fun-ink);
  font-weight: 500;
}

.fun-foot a { color: var(--fun-ink); }

/* ---------- statements ---------- */

.fun-hero { margin: 0 0 clamp(2rem, 4.5vw, 3rem); }

.fun-hero h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  line-height: 1.04;
  margin: 0 0 1.1rem;
}

.fun-hero .fun-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  color: var(--fun-muted);
  max-width: 46ch;
}

/* one quiet entrance for the prospect's welcome, the page's only
   staged motion; everything else answers an action */
html.js .fun-rise { opacity: 0; transform: translateY(16px); }
html.js.is-ready .fun-rise {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.9, 0.3, 1);
}
html.motion-stopped .fun-rise { opacity: 1; transform: none; transition: none; }

/* ---------- status LED ---------- */

.fun-led {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  margin-right: 0.6rem;
  vertical-align: 0.08em;
  background: var(--fun-zara-bright);
  box-shadow: 0 0 0 3px rgba(63, 214, 164, 0.28);
}

.fun-led.is-waiting { background: var(--fun-amber); box-shadow: 0 0 0 3px rgba(240, 179, 92, 0.3); }
.fun-led.is-off { background: var(--fun-muted); box-shadow: 0 0 0 3px rgba(93, 101, 114, 0.18); }

/* ---------- buttons ---------- */

.fun-btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--fun-navy);
  color: var(--fun-cream);
  font: 600 1rem/1 "Hanken Grotesk", system-ui, sans-serif;
  min-height: 3rem;
  padding: 0 1.8rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.fun-btn:hover { background: #1c2540; }
.fun-btn:active { transform: translateY(1px); }
.fun-btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.fun-btn.is-danger { background: var(--fun-coral); }
.fun-btn.is-danger:hover { background: #c8462f; }

.fun-btn.is-ghost {
  background: transparent;
  color: var(--fun-ink);
  box-shadow: inset 0 0 0 1.5px var(--fun-line);
}
.fun-btn.is-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--fun-muted); background: transparent; }

/* on the dark console the ghost pill keeps the hero's glass voice */
.fun-btn.is-dark-ghost {
  background: rgba(251, 250, 247, 0.13);
  color: var(--fun-cream);
  box-shadow: inset 0 0 0 1px rgba(251, 250, 247, 0.32);
}
.fun-btn.is-dark-ghost:hover { background: rgba(251, 250, 247, 0.22); }

.fun-btn.is-small { min-height: 2.4rem; padding: 0 1.05rem; font-size: 0.9rem; }

/* ---------- forms ---------- */

.fun-field { display: grid; gap: 0.4rem; margin: 0 0 1.25rem; }

.fun-field > label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fun-ink);
}

.fun-field .fun-optional { font-weight: 400; color: var(--fun-muted); }

.fun-input {
  width: 100%;
  font: 400 1rem/1.45 "Hanken Grotesk", system-ui, sans-serif;
  color: var(--fun-ink);
  background: var(--fun-paper);
  border: 1px solid #d6d5e0;
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  min-height: 3rem;
}

.fun-input:hover { border-color: #b9b8c7; }

.fun-input:focus-visible {
  outline: 2px solid var(--fun-customer);
  outline-offset: 1px;
  border-color: var(--fun-customer);
}

textarea.fun-input { min-height: 7.5rem; resize: vertical; }

select.fun-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #5d6572 50%), linear-gradient(135deg, #5d6572 50%, transparent 50%); background-position: calc(100% - 21px) 55%, calc(100% - 15px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.6rem; }

.fun-input[aria-invalid="true"] { border-color: var(--fun-coral); }

.fun-field-error {
  color: var(--fun-coral);
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0;
}

/* two compact fields share a row where they are kin */
.fun-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; }

.fun-grid .fun-field { margin-bottom: 1.25rem; }

/* ---------- languages: Zara's pill wall ----------
   The page's colour moment: a pill fills with Zara's green while it
   is selected — the colour the site already gives her voice. */

.fun-langs {
  border: 0;
  padding: 0;
  margin: 0 0 1.6rem;
  min-inline-size: auto;
}

.fun-langs legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fun-ink);
  padding: 0;
  margin-bottom: 0.75rem;
}

.fun-langs .fun-hint { font-weight: 400; color: var(--fun-muted); }

.fun-lang-set {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.fun-lang { position: relative; }

.fun-lang input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.fun-lang span {
  display: inline-block;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid #d6d5e0;
  background: var(--fun-paper);
  color: var(--fun-ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.fun-lang input:checked + span {
  background: var(--fun-zara);
  border-color: var(--fun-zara);
  color: #fff;
}

.fun-lang input:checked + span::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--fun-zara-bright);
  margin-right: 0.5rem;
  vertical-align: 0.1em;
}

.fun-lang input:checked:hover + span { background: #0f7f5b; border-color: #0f7f5b; }

.fun-lang input:hover + span { border-color: #b9b8c7; }

.fun-lang input:focus-visible + span {
  outline: 2px solid var(--fun-customer);
  outline-offset: 2px;
}

/* ---------- consent: the notice and its one required answer ---------- */

.fun-consent {
  margin: 1.7rem 0 1.6rem;
  border: 1px solid var(--fun-line);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  background: var(--fun-cream);
}

.fun-consent summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fun-ink);
}

.fun-consent summary::marker { color: var(--fun-muted); }

.fun-consent[open] summary { margin-bottom: 0.75rem; }

.fun-notice { font-size: 0.9rem; line-height: 1.55; color: var(--fun-ink); }

.fun-notice dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 1rem; row-gap: 0.55rem; margin: 0 0 0.8rem; }

.fun-notice dt { font-weight: 600; }

.fun-notice dt::after { content: ":"; }

.fun-notice dd { margin: 0; color: var(--fun-muted); }

.fun-notice p { margin: 0 0 0.8rem; }
.fun-notice p:last-child { margin-bottom: 0; }

.fun-agree {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.9rem;
}

.fun-agree input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.18rem 0 0;
  accent-color: var(--fun-zara);
  cursor: pointer;
  flex: none;
}

/* ---------- form footer + error line ---------- */

.fun-form-foot { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.4rem; }

.fun-aside { font-size: 0.9rem; color: var(--fun-muted); }
.fun-aside a { color: var(--fun-ink); }

.fun-form-error {
  margin: 1rem 0 0;
  color: var(--fun-coral);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- success ---------- */

.fun-done { margin: 0; }

.fun-done h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  color: var(--fun-ink);
}

.fun-done p { color: var(--fun-muted); line-height: 1.6; }

/* ---------- admin: the ledger ---------- */

#admin-login .fun-field { max-width: 26rem; }

.fun-ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.fun-ledger-head h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  line-height: 1.05;
  margin: 0;
}

.fun-signout {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: 500 0.92rem/1.4 "Hanken Grotesk", system-ui, sans-serif;
  color: var(--fun-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fun-signout:hover { color: var(--fun-ink); }

/* status filter: plain words with counts, an underline on the active one */
.fun-tabs {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--fun-line);
  margin-bottom: 0.4rem;
}

.fun-tab {
  background: none;
  border: 0;
  padding: 0.65rem 0.15rem 0.75rem;
  margin-bottom: -1px;
  cursor: pointer;
  font: 500 0.98rem/1.3 "Hanken Grotesk", system-ui, sans-serif;
  color: var(--fun-muted);
  border-bottom: 2px solid transparent;
}

.fun-tab:hover { color: var(--fun-ink); }

.fun-tab[aria-pressed="true"] {
  color: var(--fun-ink);
  border-bottom-color: var(--fun-navy);
  font-weight: 600;
}

.fun-tab .fun-count { color: var(--fun-muted); font-weight: 400; }
.fun-tab[aria-pressed="true"] .fun-count { color: var(--fun-muted); }

/* one request per row; hairlines between, no cards. Every column gets a
   bounded share so a long access link cannot blow the row open. */
.fun-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.9fr) minmax(0, 1.4fr);
  column-gap: 2rem;
  padding: 1.5rem 0.15rem;
  border-bottom: 1px solid var(--fun-line);
}

.fun-row-main { min-width: 0; }

.fun-row-name {
  margin: 0 0 0.15rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--fun-ink);
  line-height: 1.3;
}

.fun-row-company { font-size: 0.95rem; color: var(--fun-muted); line-height: 1.4; }

.fun-row-use { margin: 0.55rem 0 0; font-size: 0.93rem; line-height: 1.55; color: var(--fun-ink); }

.fun-row-meta { display: grid; gap: 0.28rem; align-content: start; font-size: 0.9rem; line-height: 1.45; }

.fun-row-meta a { color: var(--fun-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(16, 23, 37, 0.25); }
.fun-row-meta a:hover { text-decoration-color: var(--fun-ink); }

.fun-row-meta .fun-dim { color: var(--fun-muted); }

.fun-langs-inline { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.fun-langs-inline span {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
  background: var(--fun-cream);
  color: var(--fun-ink);
}

.fun-row-side { display: grid; gap: 0.7rem; align-content: start; justify-items: start; min-width: 0; }

.fun-grant { max-width: 100%; }

.fun-status { display: flex; align-items: center; font-size: 0.9rem; font-weight: 500; color: var(--fun-muted); }

.fun-row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* the approved grant: its private link, its copy button, the email note */
.fun-grant {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(63, 214, 164, 0.42);
  border-radius: 14px;
  background: rgba(82, 117, 104, 0.06);
  min-width: 0;
}

.fun-grant-link {
  font-size: 0.9rem;
  color: var(--fun-ink);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(16, 23, 37, 0.3);
}

.fun-grant-note { font-size: 0.85rem; line-height: 1.5; color: var(--fun-muted); }

.fun-row.is-rejected .fun-row-name,
.fun-row.is-rejected .fun-row-use { color: var(--fun-muted); }

/* two-step confirm replaces the clicked button in place */
.fun-btn.is-armed { background: var(--fun-coral); }

/* ---------- access: welcome and the two ways ---------- */

.fun-info {
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin: 0 0 clamp(1.6rem, 3.5vw, 2.4rem);
  font-size: 0.98rem;
  color: var(--fun-muted);
}

.fun-info b { color: var(--fun-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* the two choices never mirror each other: the product guide is a
   page of paper; the mock call is a slip torn from the receipt book,
   echoing the site's promise slip with demo data */
.fun-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.fun-choice {
  border: 1px solid var(--fun-line);
  border-radius: var(--fun-radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  background: var(--fun-paper);
  display: grid;
  gap: 1rem;
  align-content: start;
}

.fun-choice h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  line-height: 1.1;
  margin: 0;
  color: var(--fun-ink);
}

.fun-choice p { margin: 0; color: var(--fun-muted); font-size: 0.98rem; line-height: 1.6; }

/* the line where you take the customer's side: indigo, the colour the
   site already assigns to the customer's voice */
.fun-customer-side { color: var(--fun-customer); font-weight: 500; }

.fun-try-line { font-size: 0.9rem; color: var(--fun-muted); }
.fun-try-line q { quotes: "“" "”"; font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 1.05em; color: var(--fun-ink); }

.fun-choice-foot { margin-top: auto; padding-top: 0.4rem; }

/* the demo slip: torn from the site's promise slip, on paper instead
   of the dusk footage, carrying only what a mock call would show */
.fun-slip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  align-items: start;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--fun-line);
  border-radius: 14px;
  background: var(--fun-cream);
}

.fun-slip-label { font-size: 0.8rem; font-weight: 600; color: var(--fun-muted); margin-bottom: 0.15rem; }

.fun-slip-name { font-size: 1.02rem; font-weight: 600; color: var(--fun-ink); }

.fun-slip-amount {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.9rem;
  line-height: 1.05;
  color: var(--fun-ink);
  font-variant-numeric: tabular-nums;
}

.fun-slip-due {
  justify-self: end;
  text-align: center;
  border: 1px solid var(--fun-line);
  border-radius: 10px;
  background: var(--fun-paper);
  padding: 0.35rem 0.7rem;
}

.fun-slip-due .due-word { display: block; font-size: 0.72rem; font-weight: 600; color: var(--fun-coral); }
.fun-slip-due .due-date { display: block; font-family: "Instrument Serif", Georgia, serif; font-size: 1.25rem; color: var(--fun-ink); white-space: nowrap; }

.fun-demo-note { font-size: 0.82rem; color: var(--fun-muted); line-height: 1.5; }

/* the fixed facts, stated once, not editable */
.fun-fixed-facts { margin-top: 1.6rem; font-size: 0.9rem; color: var(--fun-muted); }

/* ---------- the call console: the dusk panel, live ---------- */

.fun-console {
  border-radius: var(--fun-radius);
  color: var(--fun-cream);
  background: var(--fun-dusk);
  background-size: 100% 100%;
  padding: clamp(1.8rem, 4vw, 2.6rem);
  display: grid;
  gap: 1.4rem;
}

.fun-console-head { display: flex; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }

.fun-console-who { display: grid; gap: 0.25rem; min-width: 0; }

.fun-console-name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }

.fun-console-state { font-size: 0.92rem; line-height: 1.4; color: rgba(242, 239, 230, 0.9); }

/* the countdown is the slip's amount, ticking: serif numerals */
.fun-clock {
  margin-left: auto;
  text-align: right;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.fun-clock.is-ending { color: var(--fun-amber); }

.fun-clock-label { font-size: 0.78rem; font-family: "Hanken Grotesk", system-ui, sans-serif; font-weight: 500; color: rgba(242, 239, 230, 0.75); margin-top: 0.3rem; }

.fun-console-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.fun-console-note { font-size: 0.85rem; line-height: 1.5; color: rgba(242, 239, 230, 0.78); margin: 0; }

.fun-console .fun-form-error { color: #ffd7cd; }

/* on the dusk panel the site's cream focus ring reads better than indigo */
.fun-console :focus-visible { outline-color: var(--fun-cream); }

/* ---------- gates: what the link says when it cannot open ---------- */

.fun-gate { display: grid; gap: 1rem; max-width: 46rem; }

.fun-gate h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 0.4rem;
}

.fun-gate p { margin: 0; color: var(--fun-muted); line-height: 1.6; max-width: 52ch; }

/* ---------- empty and error, in the interface's voice ---------- */

.fun-empty { padding: 2.2rem 0.15rem 3rem; color: var(--fun-muted); font-size: 0.98rem; line-height: 1.6; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .fun-choices { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .fun-row { grid-template-columns: 1fr; row-gap: 1rem; }
  .fun-row-side { justify-items: flex-start; }
  .fun-grid { grid-template-columns: 1fr; }
  .fun-tabs { gap: 1rem; }
  .fun-ledger-head { align-items: flex-start; }
  .fun-clock { margin-left: 0; text-align: left; order: 3; width: 100%; }
}
