/* ============================================================
   Survive — Who Did You Become to Survive?
   Design system per build brief §16. Tokens come from base.ejs :root.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Locally-derived ambient tones — soft, brand-tinted, no bare grey. */
  --color-soft: #b8c3cf;          /* cyan-tinted secondary text */
  --color-soft-dim: #8a96a4;      /* slightly muter for tertiary */
  --color-line-soft: rgba(167,139,250,0.10);
}

html {
  /* §16.6: kill rubber-band, but DO NOT set overflow-x: hidden here. */
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  font-size: 18px;
  line-height: 1.55;
  background: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: -0.005em;
  /* §16.6: clip not hidden. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Ambient gradient glow — subtle life behind every page.
   Fixed-position, sits behind content, never scrolls. */
.bg-glow {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 600px at 50% -5%, rgba(0,186,225,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 700px 500px at 90% 100%, rgba(167,139,250,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 0% 80%, rgba(0,186,225,0.03) 0%, transparent 70%);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-logo-blue); }

p { margin: 0 0 1.1em; }
h1, h2, h3, h4 { margin: 0 0 0.6em; font-weight: 400; }
h1 { letter-spacing: -0.022em; }
h2 { letter-spacing: -0.02em; }

img { max-width: 100%; height: auto; display: block; }

/* --- Skip link --------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff;
  padding: 0.5rem 0.75rem; font-weight: 500; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Container --------------------------------------------------- */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
/* Admin gets a wider canvas for the table + filters + stats. */
body[data-page="admin"] .container,
body[data-page="admin-login"] .container { max-width: 1240px; }

/* --- Header / brand --------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--color-line);
  padding: 1rem 1.5rem;
  display: flex; justify-content: center;
  background: var(--color-bg);
}
.brand { display: inline-flex; }
.brand-logo {
  height: 36px; width: auto; max-width: 220px;
}
@media (min-width: 720px) {
  .brand-logo { height: 42px; max-width: 260px; }
}

/* --- Footer ----------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--color-soft-dim);
  font-size: 0.92rem;
  text-align: center;
}
.site-footer .container { padding: 0 1.5rem; }

/* --- Progress dots (7-dot tracker) ------------------------------ */
.progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.25rem 1.5rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-soft);
}
.progress-dots .dot {
  width: 0.6rem; height: 0.6rem; border-radius: 999px;
  background: var(--color-elevated);
  border: 1px solid var(--color-line-strong);
  transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.progress-dots .dot.done {
  background: var(--gradient-primary);
  border-color: transparent;
}
.progress-dots .dot.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.25);
  box-shadow: 0 0 12px rgba(0,186,225,0.45);
}
.progress-label { margin-left: 0.5rem; color: var(--color-soft); }

/* --- Gradient text utility -------------------------------------- */
.grad-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* --- Hero (landing) --------------------------------------------- */
.hero { padding-top: 2rem; }
.hero-headline {
  font-weight: 200;
  font-size: clamp(2.4rem, 7.5vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0 0 1.5rem;
  /* Triple-stop gradient: white pulls into cyan, lands in purple. Striking
     but readable; mirrors the brand wordmark logic (logo blue accents). */
  background: linear-gradient(115deg, #ffffff 0%, #ffffff 25%, var(--color-primary) 65%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-subhead {
  font-size: 1.18rem;
  color: var(--color-text);
  font-weight: 300;
  margin: 0 0 0.6em;
}
.benefits {
  list-style: none; padding: 0;
  margin: 2rem 0;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.benefits li {
  position: relative;
  padding-left: 1.6rem;
  font-weight: 300;
  font-size: 1.05rem;
}
.benefits li::before {
  content: ''; position: absolute; left: 0; top: 0.7em;
  width: 1rem; height: 1px;
  background: var(--gradient-primary);
}

.cta-row {
  margin: 2rem 0 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.small-print {
  font-size: 0.92rem;
  color: var(--color-soft);
  font-style: italic;
}

/* --- Intro ------------------------------------------------------ */
.intro h1 {
  font-weight: 200;
  font-size: clamp(2.0rem, 6vw, 2.8rem);
  letter-spacing: -0.022em;
  margin-bottom: 1.5rem;
  background: linear-gradient(115deg, #ffffff 0%, #ffffff 35%, var(--color-primary) 90%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro p { font-size: 1.1rem; }

/* --- Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.6rem;
  border: 0; border-radius: 999px;
  background: var(--color-elevated);
  color: var(--color-text);
  font-family: inherit; font-size: 1rem; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1; letter-spacing: 0;
  transition: background 220ms ease, transform 180ms ease, box-shadow 220ms ease, color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.06rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.92rem; }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,186,225,0.22);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary-hover);
  box-shadow: 0 10px 28px rgba(8,112,176,0.42);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--color-elevated);
  color: var(--color-soft-dim);
  box-shadow: none; transform: none;
  cursor: not-allowed;
  opacity: 0.7;
}
.btn-link {
  background: transparent; padding: 0.85rem 0.4rem;
  color: var(--color-soft);
  font-weight: 400;
}
.btn-link:hover { color: var(--color-text); background: transparent; }

/* --- Forms (inputs) --------------------------------------------- */
.form-row { margin-bottom: 1rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  background: #ffffff;
  color: #0a0a0f;
  border: 1px solid rgba(0,186,225,0.25);
  border-radius: 10px;
  font-family: inherit; font-size: 1.02rem; font-weight: 500;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
input::placeholder { color: #6b7280; font-weight: 400; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,186,225,0.22);
}
/* Chrome autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #0a0a0f;
  caret-color: #0a0a0f;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* --- Quiz (statements + cards) ---------------------------------- */
.quiz { padding-top: 1rem; }
.instructions {
  margin: 0 0 2rem;
  padding: 1.1rem 1.25rem;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  color: var(--color-soft);
  font-weight: 300;
  font-size: 0.99rem;
}
.instructions p { margin: 0 0 0.4em; }
.instructions p:last-child { margin: 0; }

fieldset.statement {
  border: 0; padding: 0; margin: 0 0 2.5rem;
}
fieldset.statement legend {
  font-size: 1.18rem; font-weight: 400;
  color: var(--color-text);
  padding: 0;
  margin: 0 0 1rem;
}

.cards {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr 1fr;
}
.cards--vertical {
  grid-template-columns: 1fr;
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 62px;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(0,186,225,0.18);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(0,186,225,0.04) 0%, rgba(167,139,250,0.025) 100%),
    var(--color-elevated);
  color: var(--color-text);
  cursor: pointer;
  font-weight: 400; font-size: 1.02rem;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.card input[type=radio] {
  position: absolute; opacity: 0; pointer-events: none;
}
.card:hover {
  border-color: rgba(0,186,225,0.45);
  background:
    linear-gradient(180deg, rgba(0,186,225,0.08) 0%, rgba(167,139,250,0.05) 100%),
    var(--color-elevated);
}
.card.selected,
.card:has(input[type=radio]:checked) {
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--color-primary), 0 0 28px rgba(0,186,225,0.22);
}
.card-label { line-height: 1.3; text-align: center; }
.cards--vertical .card { justify-content: flex-start; min-height: 64px; padding: 1rem 1.2rem; }
.cards--vertical .card-label { text-align: left; }

/* Form actions row */
.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}
.form-actions--single { justify-content: flex-end; }
.form-actions--single > .btn-link:first-child { margin-right: auto; }

/* --- Animations ------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.shake { animation: shake 0.5s; }

/* IntersectionObserver-driven fade-in. JS adds .pre-fade then .in-view. */
.pre-fade { opacity: 0; transform: translateY(12px); will-change: opacity, transform; }
.in-view { animation: fadeInUp 700ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }

/* On-load stagger for above-the-fold lists. */
.benefits li { animation: fadeInUp 600ms ease-out both; }
.benefits li:nth-child(1) { animation-delay: 220ms; }
.benefits li:nth-child(2) { animation-delay: 320ms; }
.benefits li:nth-child(3) { animation-delay: 420ms; }
.benefits li:nth-child(4) { animation-delay: 520ms; }

.hero-headline { animation: fadeInUp 800ms cubic-bezier(0.22, 0.61, 0.36, 1) 50ms both; }
.hero-subhead { animation: fadeInUp 600ms ease-out both; }
.hero-subhead:nth-of-type(1) { animation-delay: 200ms; }
.hero-subhead:nth-of-type(2) { animation-delay: 280ms; }
.hero-subhead:nth-of-type(3) { animation-delay: 360ms; }
.hero .cta-row, .hero .small-print { animation: fadeInUp 600ms ease-out 600ms both; }

.intro h1 { animation: fadeInUp 700ms cubic-bezier(0.22, 0.61, 0.36, 1) 50ms both; }
.intro p { animation: fadeInUp 500ms ease-out both; }
.intro p:nth-of-type(1) { animation-delay: 180ms; }
.intro p:nth-of-type(2) { animation-delay: 240ms; }
.intro p:nth-of-type(3) { animation-delay: 300ms; }
.intro p:nth-of-type(4) { animation-delay: 360ms; }
.intro p:nth-of-type(5) { animation-delay: 420ms; }
.intro .cta-row { animation: fadeInUp 600ms ease-out 700ms both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .pre-fade { opacity: 1; transform: none; }
}

/* --- Section headers (small caps, dot flanks) ------------------- */
.section-header {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1rem;
}
.section-header::before,
.section-header::after {
  content: '·';
  color: inherit;
  opacity: 0.7;
}
.section-header--accent {
  color: var(--color-primary);
}

/* --- Hot Zone block --------------------------------------------- */
.hot-zone-page {
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid rgba(0,186,225,0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,186,225,0.06), rgba(167,139,250,0.06));
  margin-top: 0.5rem;
}
.bridge {
  font-size: 1.18rem; font-weight: 300;
  color: var(--color-text);
  margin: 0 0 1.5rem;
}

/* --- Email gate ------------------------------------------------- */
.email-gate h1 {
  font-weight: 200;
  font-size: clamp(2rem, 5.5vw, 2.6rem);
  margin-bottom: 1.1rem;
  background: linear-gradient(115deg, #ffffff 0%, #ffffff 35%, var(--color-primary) 95%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.email-form { margin-top: 1.5rem; }
.privacy-microcopy {
  font-size: 0.92rem; color: var(--color-soft); font-style: italic;
  margin: 0.5rem 0 1.5rem;
}

/* --- Results ---------------------------------------------------- */
.results-opening {
  margin-bottom: 3rem;
}
.results-opening p { font-size: 1.12rem; color: var(--color-text); }

/* Centred italic epigraph with a hairline divider below — sets the
   bargain apart from the gradient verdict header without competing. */
.contract-phrase {
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 300;
  text-align: center;
  color: var(--color-primary);
  max-width: 540px;
  margin: 0 auto 1.6rem;
  line-height: 1.55;
  letter-spacing: -0.005em;
}
.contract-phrase::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  background: rgba(255,255,255,0.32);
  margin: 1.4rem auto 0;
}
.identity-header {
  font-weight: 200;
  font-size: clamp(1.95rem, 5vw, 2.5rem);
  letter-spacing: -0.022em;
  margin: 0 0 2rem;
  background: linear-gradient(115deg, #ffffff 0%, #ffffff 30%, var(--color-primary) 75%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.identity-block + .identity-block,
.results-transitional + .identity-block {
  margin-top: 3rem;
}

/* Boxed-panel treatment per identity section — Six-style. Each
   sub-section sits in its own subtle container so dense result text
   has rhythm and is visually parsable. */
.identity-section {
  background: var(--color-bg-soft);
  border: 1px solid rgba(0,186,225,0.12);
  border-radius: 14px;
  padding: 1.6rem 1.5rem 1.2rem;
  margin-bottom: 1.1rem;
  position: relative;
  overflow: hidden;
}
.identity-section::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(0,186,225,0.05) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.identity-section > * { position: relative; }
.identity-section .section-header { margin-bottom: 0.9rem; }
.identity-section p {
  font-size: 1.05rem;
  color: var(--color-text);
  margin: 0 0 0.9em;
}
.identity-section p:last-child { margin-bottom: 0; }

.first-crack {
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--color-primary);
  text-align: center;
  padding: 1.5rem 1.2rem;
  margin-top: 1.5rem;
  border: 1px solid rgba(0,186,225,0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,186,225,0.04), rgba(167,139,250,0.04));
  letter-spacing: -0.005em;
}
.results-transitional {
  text-align: center;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-soft);
  margin: 3.5rem 0 1.5rem;
  padding: 0 1rem;
}

/* --- Coaching CTA ----------------------------------------------- */
.coaching-cta {
  position: relative;
  margin-top: 4rem;
  padding: 2.2rem 1.8rem;
  background: var(--color-bg-soft);
  border: 1px solid rgba(0,186,225,0.18);
  border-radius: 14px;
  overflow: hidden;
}
.coaching-cta::before {
  content: '';
  position: absolute; top: -120px; right: -120px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(0,186,225,0.14) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.coaching-cta::after {
  content: '';
  position: absolute; bottom: -120px; left: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(167,139,250,0.10) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.coaching-cta > * { position: relative; }
.coaching-cta p { font-size: 1.05rem; color: var(--color-text); }
.coaching-cta .cta-row { margin-top: 2rem; }
.below-button {
  font-size: 0.92rem; font-style: italic;
  color: var(--color-soft);
}

/* --- 404 -------------------------------------------------------- */
.not-found h1 {
  font-weight: 200;
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 1.5rem;
  background: linear-gradient(115deg, #ffffff 0%, var(--color-primary) 80%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   Admin
   ============================================================ */
.admin .admin-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}
.admin h1 { font-weight: 400; font-size: 1.6rem; margin: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 520px) {
  /* On small screens, single column avoids the orphan-7th-card pattern
     and keeps each metric immediately legible. */
  .stats { grid-template-columns: 1fr; }
}

/* Horizontal scroll for the wide submissions table on narrow viewports.
   Keeps the page itself at viewport width so stats/filters/distribution
   don't get pushed sideways by table-overflow. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.5rem;
  border-radius: 8px;
}
.submissions-table { min-width: 720px; }
.stat {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  padding: 1rem 0.9rem;
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 0.25rem;
  position: relative; overflow: hidden;
  animation: fadeInUp 500ms ease-out both;
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(0,186,225,0.05), transparent 60%);
  pointer-events: none;
}
.stat--accent { border-color: rgba(0,186,225,0.4); }
.stat--accent::before { background: radial-gradient(ellipse at top right, rgba(0,186,225,0.10), transparent 60%); }
.stat-num {
  font-size: 1.6rem; font-weight: 500;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}
.stat-label { font-size: 0.82rem; color: var(--color-soft); position: relative; }

.stat:nth-child(1) { animation-delay: 30ms; }
.stat:nth-child(2) { animation-delay: 80ms; }
.stat:nth-child(3) { animation-delay: 130ms; }
.stat:nth-child(4) { animation-delay: 180ms; }
.stat:nth-child(5) { animation-delay: 230ms; }
.stat:nth-child(6) { animation-delay: 280ms; }
.stat:nth-child(7) { animation-delay: 330ms; }

.distribution {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 0.8rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 500ms ease-out 350ms both;
}
.distribution-title {
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 1rem;
}
.distribution-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.dist-row {
  display: grid; grid-template-columns: 11rem 1fr 3rem;
  gap: 0.8rem; align-items: center;
  font-size: 0.92rem;
}
.dist-label { color: var(--color-text); }
.dist-track { height: 8px; background: var(--color-elevated); border-radius: 999px; overflow: hidden; }
.dist-fill {
  height: 100%; background: var(--gradient-primary); border-radius: 999px;
  transform-origin: left; transform: scaleX(0);
  animation: distFill 800ms cubic-bezier(0.22, 0.61, 0.36, 1) 600ms forwards;
}
@keyframes distFill { to { transform: scaleX(1); } }
.dist-num { text-align: right; color: var(--color-soft); font-variant-numeric: tabular-nums; }

/* Admin filters live in their own dark-themed visual register —
   the white-input rule is for visitor-facing forms (typed input on
   a dark page), but on admin they intrude. Dark, compact, on-brand. */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 12px;
}
.filters input,
.filters select {
  width: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 400;
  background: var(--color-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-line-strong);
  border-radius: 8px;
  appearance: auto;
}
.filters input::placeholder { color: var(--color-soft-dim); font-weight: 400; }
.filters input:focus,
.filters select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,186,225,0.25);
}
/* Override the global white-autofill for admin search */
.filters input:-webkit-autofill,
.filters input:-webkit-autofill:hover,
.filters input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-elevated) inset;
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
}
.filters select option {
  background: var(--color-panel);
  color: var(--color-text);
}
.filters .btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--color-soft); font-size: 0.9rem;
  padding: 0 0.4rem;
}
.filter-toggle input { width: auto; accent-color: var(--color-primary); }
@media (max-width: 520px) {
  /* Stack to one-column on mobile so each filter is full-width and tappable. */
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { width: 100%; }
  .filters .btn-sm, .filters .btn-link { align-self: flex-start; }
}

.result-count { color: var(--color-soft); font-size: 0.92rem; margin: 0.5rem 0 1rem; }

.submissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.submissions-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--color-primary);
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--color-line);
}
.submissions-table th a { color: inherit; }
.submissions-table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--color-line-strong);
  vertical-align: middle;
}
.row-summary { cursor: pointer; transition: background 180ms ease; }
.row-summary:hover { background: rgba(0,186,225,0.04); }
.empty { text-align: center; padding: 2rem; color: var(--color-soft); }

.pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--color-elevated);
  color: var(--color-text);
  margin-right: 0.3rem;
  margin-bottom: 0.2rem;
  border: 1px solid var(--color-line-strong);
}
.pill--identity {
  background: rgba(0,186,225,0.14);
  color: var(--color-primary);
  border-color: rgba(0,186,225,0.3);
}
.flag { font-size: 1.05rem; margin-right: 0.3rem; }
.flag--accent { color: var(--color-primary); }
.flag--dual { color: var(--color-accent); }

.status { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.92rem; }
.status--success { color: #4ade80; }
.status--failed { color: #f87171; }
.status--pending { color: var(--color-soft); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.2rem 0.5rem;
  background: var(--color-bg-soft);
}
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid h4 {
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}
.raw-answers { padding-left: 1.2rem; font-size: 0.92rem; color: var(--color-text); }
.raw-answers li { margin-bottom: 0.2rem; }
.raw-answers strong { color: var(--color-primary); font-weight: 500; }
.bars-block .bar {
  display: grid; grid-template-columns: 9rem 1fr 3rem;
  gap: 0.5rem; align-items: center;
  font-size: 0.92rem; margin-bottom: 0.4rem;
}
.bar-label { color: var(--color-text); }
.bar-track { height: 6px; background: var(--color-elevated); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gradient-primary); border-radius: 999px; }
.bar-num { text-align: right; color: var(--color-soft); font-variant-numeric: tabular-nums; }
.bar--top .bar-track { box-shadow: 0 0 0 1px var(--color-primary); }
.tag-list { padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0; }
.tag-list code {
  background: var(--color-elevated);
  border: 1px solid var(--color-line-strong);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text);
}
.webhook-block details {
  margin-top: 0.5rem;
}
.webhook-block pre {
  font-size: 0.78rem;
  background: var(--color-elevated);
  padding: 0.5rem;
  border-radius: 6px;
  overflow-x: auto;
  max-height: 240px;
  color: var(--color-text);
}

.refire-status { color: var(--color-soft); font-size: 0.92rem; margin-left: 0.5rem; }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem;
  color: var(--color-soft); font-size: 0.94rem;
}

/* Login page */
.login-page {
  max-width: 420px;
  margin: 4rem auto;
}
.login-page h1 {
  font-weight: 200;
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(115deg, #ffffff 0%, var(--color-primary) 80%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
