/* Event Engine 2.0 — one stylesheet, no build step.
   --brand is injected per install from the settings table (base.html), so this
   file never hardcodes an organisation's colour. */

:root {
  --brand: #1a73e8;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --ok: #188038;
  --err: #c5221f;
  --warn: #b06000;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(60, 64, 67, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Rubik, "Segoe UI", Arial, sans-serif;
}

a { color: var(--brand); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap--narrow { max-width: 460px; padding-top: 64px; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.topbar__brand { font-weight: 600; color: var(--ink); text-decoration: none; }
.topbar__nav { display: flex; gap: 16px; }
.topbar__nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.topbar__nav a:hover { color: var(--brand); }

/* blocks */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.card--center { text-align: center; }
.card h1 { margin-top: 0; font-size: 22px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 24px; }

.empty {
  background: var(--card); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 48px 24px; text-align: center;
}
.muted { color: var(--muted); }

/* forms */
.field { display: block; margin-bottom: 20px; text-align: start; }
.field__label { display: block; font-weight: 500; margin-bottom: 6px; }
.field__hint { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }

.input {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
}
.input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.input--code { text-align: center; letter-spacing: .5em; font-size: 24px; }
.input--color { height: 44px; padding: 4px; }

.btn {
  display: inline-block; padding: 10px 20px; font: inherit; font-weight: 500;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  text-decoration: none; text-align: center;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { filter: brightness(.94); }
.btn--block { display: block; width: 100%; margin-top: 16px; }
.btn.is-disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* table */
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td {
  padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border);
}
.table th { font-size: 13px; color: var(--muted); font-weight: 500; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; background: #e8f0fe; color: #1557b0;
}
.badge--draft { background: #fef7e0; color: var(--warn); }
.badge--canceled { background: #fce8e6; color: var(--err); }

/* flashes */
.flashes { margin-bottom: 20px; }
.flash {
  margin: 0 0 8px; padding: 10px 14px; border-radius: 8px;
  background: #e6f4ea; color: var(--ok);
}
.flash--err { background: #fce8e6; color: var(--err); }

.foot {
  text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --card: #172033; --ink: #e8eaed;
    --muted: #9aa0a6; --border: #2b3448;
  }
  /* Anything that sets its own ink colour has to be named explicitly — a token
     swap cannot reach a hardcoded value, and the failure mode is invisible text
     that no test can see. */
  .input { background: #101827; color: var(--ink); }
  .table { background: var(--card); }
  .flash { background: #14321f; }
  .flash--err { background: #3a1614; color: #f28b82; }
}

/* ── phase 1 components ──────────────────────────────────────────────────── */

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .field { flex: 1 1 140px; }

.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }

.choice { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 20px; }
.choice legend { padding: 0 6px; }

.fold { margin: 4px 0 20px; }
.fold summary { cursor: pointer; color: var(--brand); }

.btn--quiet { background: transparent; color: var(--muted); border-color: var(--border); }
.btn--quiet:hover { color: var(--ink); }

.sharebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 20px; }
.sharebox__label { font-size: 13px; color: var(--muted); flex: none; }
.sharebox .input { flex: 1 1 240px; }

.tiles { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.tile { flex: 1 1 120px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center; }
.tile b { display: block; font-size: 28px; line-height: 1.2; }
.tile span { color: var(--muted); font-size: 13px; }

section.card { margin-bottom: 20px; }
section.card h2 { margin-top: 0; font-size: 18px; }

.warn-inline { margin-top: 4px; font-size: 13px; color: var(--warn); }

.badge--upcoming { background: #e8f0fe; color: #1557b0; }
.badge--live { background: #fce8e6; color: var(--err); }
.badge--ended, .badge--off { background: #f1f3f4; color: var(--muted); }
.badge--sent { background: #e8f0fe; color: #1557b0; }
.badge--scheduled { background: #e6f4ea; color: var(--ok); }
.badge--skipped { background: #fef7e0; color: var(--warn); }
.badge--confirmation, .badge--waiting { background: #f3e8fd; color: #6b21a8; }

/* public page */
.public .wrap { padding-top: 40px; }
.desc { margin: 16px 0; white-space: pre-wrap; }
.whenbox { margin: 20px 0; padding: 14px 18px; border-radius: 10px;
  background: #f1f5fb; border-inline-start: 4px solid var(--brand); line-height: 2; }
.banner { margin: 0 0 12px; padding: 8px 14px; border-radius: 8px;
  background: #fce8e6; color: var(--err); font-weight: 500; text-align: center; }
.banner--quiet { background: #f1f3f4; color: var(--muted); }
.fineprint { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* The honeypot must be unreachable, not merely invisible: display:none is the
   first thing a bot checks for. The template also carries aria-hidden and
   tabindex="-1", so it is out of the tab order and unread by a screen reader.

   🚨 NOT `left: -9999px`. That is the usual recipe and it is wrong here: the
   offset element still counts towards the document's scrollable area, so the
   public page grew an 11,000px horizontal scroll that a phone user could swipe
   into. Clipping in place costs nothing and adds no overflow. */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

.countdown { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.countdown__unit { display: flex; flex-direction: column; align-items: center;
  min-width: 56px; padding: 8px 4px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--border); }
.countdown__unit b { font-size: 22px; line-height: 1.1; }
.countdown__unit i { font-style: normal; font-size: 12px; color: var(--muted); }
.countdown--now { justify-content: center; color: var(--err); font-weight: 500; }

.linkish { background: none; border: 0; padding: 0; font: inherit;
  color: var(--brand); text-decoration: underline; cursor: pointer; }

@media (prefers-color-scheme: dark) {
  /* Each of these sets its own colour, so a token swap cannot reach it. The
     failure mode is invisible text that no test can see. */
  .whenbox { background: #101827; }
  .banner--quiet { background: #101827; }
  .badge--ended, .badge--off { background: #101827; }
  .countdown__unit { background: var(--card); }
}

.notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius);
  background: #fef7e0; color: var(--warn); border: 1px solid #f5d58a; }
.flash--warn { background: #fef7e0; color: var(--warn); }

@media (prefers-color-scheme: dark) {
  .notice, .flash--warn { background: #33260c; color: #fdd663; border-color: #5c451a; }
}

/* ── phase 2: tabs, composer ─────────────────────────────────────────────── */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); }
.tab-link { padding: 10px 18px; font: inherit; color: var(--muted);
  background: none; border: 0; border-bottom: 3px solid transparent;
  cursor: pointer; }
.tab-link:hover { color: var(--ink); }
.tab-link.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.page-head__actions { display: flex; gap: 8px; align-items: center; }
.btn--sm { padding: 5px 12px; font-size: 14px; }
.cell-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px;
  align-items: start; }
.composer__main { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; }
.composer__body { font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.6; }
.composer__actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.composer__side { display: flex; flex-direction: column; gap: 16px; }
.composer__side .card { padding: 16px; }
.composer__side h2 { font-size: 15px; margin-bottom: 10px; }
.composer__preview { width: 100%; height: 380px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; }

code { background: rgba(127, 127, 127, .16); border-radius: 4px;
  padding: 1px 5px; font-size: .9em; }

@media (max-width: 860px) {
  .composer { grid-template-columns: 1fr; }
  .composer__preview { height: 280px; }
}

/* ── phase 3: questions, answers, waiting list, social proof ─────────────── */

.qfield { border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin: 0 0 16px; }
.qfield legend { padding: 0 6px; }
.req { color: var(--err); }

.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale__opt { display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; min-width: 40px; }
.scale__opt:has(input:checked) { border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent); }
.scale__opt input { accent-color: var(--brand); }

.qlist { margin: 12px 0; }
.qrow { border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  margin-bottom: 12px; background: var(--card); }
.qrow__head { display: flex; gap: 10px; }
.qrow__label { flex: 1 1 auto; }
.qrow__type { flex: 0 0 150px; }
.qrow__opts { margin-top: 10px; }
.qrow__foot { display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; gap: 12px; flex-wrap: wrap; }
.qrow__foot .check { margin: 0; }

.rule { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.skip-form { text-align: center; margin-top: 14px; }
.datelist { list-style: none; padding: 0; margin: 16px 0 0; }
.datelist li { margin-bottom: 8px; }

/* results */
.sv { margin-bottom: 28px; }
.sv__q { font-size: 16px; margin: 0 0 10px; }
.sv__row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sv__label { flex: 0 0 30%; }
.sv__bar { flex: 1 1 auto; height: 20px; background: var(--bg);
  border-radius: 4px; overflow: hidden; }
.sv__bar i { display: block; height: 100%; background: var(--brand);
  min-width: 2px; }
.sv__n { flex: 0 0 90px; color: var(--muted); font-size: 13px; text-align: start; }
.sv__avg { margin: 0 0 10px; font-size: 15px; }
.sv__cols { display: flex; gap: 6px; align-items: flex-end; height: 110px; }
.sv__col { flex: 1 1 0; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; height: 100%; }
.sv__col i { display: block; width: 100%; background: var(--brand);
  border-radius: 3px 3px 0 0; min-height: 2px; }
.sv__col span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sv__quotes { margin: 0; padding-inline-start: 20px; }
.sv__quotes li { margin-bottom: 6px; }

.table-scroll { overflow-x: auto; }

/* public: video + social proof */
.vsl { position: relative; padding-top: 56.25%; margin: 16px 0;
  border-radius: 10px; overflow: hidden; background: #000; }
.vsl iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.proof { margin: 20px 0; }
.proof__rating { text-align: center; font-size: 18px; margin: 0 0 14px; }
.proof__quote { margin: 0 0 12px; padding: 12px 16px; border-radius: 10px;
  background: var(--bg); border-inline-start: 3px solid var(--brand); }
.proof__quote p { margin: 0 0 6px; }
.proof__quote cite { font-style: normal; font-size: 14px; }
.proof__stars { color: #f5b301; font-size: 14px; }
.proof__role { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  /* Each of these sets its own surface, so a token swap cannot reach it. */
  .sv__bar { background: #101827; }
  .proof__quote { background: #101827; }
  .qrow { background: var(--card); }
}

/* ── phase 4: integrations, attendance ───────────────────────────────────── */

.conn { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; }
.conn .muted { flex: 1 1 260px; font-size: 14px; }

.attend { font-size: 17px; margin: 0 0 12px; }
.attend b { font-size: 26px; }
.attend-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.attend-form .input { flex: 0 0 140px; }

/* ── phase 5: the setup wizard ───────────────────────────────────────────── */

.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 20px; padding: 0; }
.steps__i { flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 4px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.steps__i b { display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 999px; background: var(--border); color: var(--muted);
  font-size: 13px; }
.steps__i.is-active { border-color: var(--brand); color: var(--ink); }
.steps__i.is-active b { background: var(--brand); color: #fff; }
.steps__i.is-done b { background: var(--ok); color: #fff; }
