/* ==================================================================== */
/* Demo Gateway — visual system modelled on the KeyReply VAI demo page:  */
/* soft pastel mesh gradient, bold display headline with a multi-stop     */
/* gradient accent line, glassy pills, white rounded cards, dark console  */
/* action buttons. Re-skin lives entirely in these tokens + components.   */
/* ==================================================================== */
:root {
  /* Pastel mesh field */
  --bg-base:   #F1EAFB;
  --mesh-lav:  #D6C2F0;   /* top-left lavender   */
  --mesh-peach:#F9CB9C;   /* right peach/orange  */
  --mesh-pink: #F4C6D2;   /* centre pink         */
  --mesh-lilac:#E2D3F6;   /* bottom-left lilac   */

  /* Ink */
  --ink:       #1A1A20;
  --ink-soft:  #585863;
  --ink-faint: #8A8A95;

  /* Lines + surfaces */
  --line:        rgba(26,26,32,0.10);
  --line-strong: rgba(26,26,32,0.16);
  --card:        rgba(255,255,255,0.72);
  --card-solid:  #FFFFFF;
  --surface-2:   #F6F4FB;
  --panel:       #1C1C20;   /* dark console / primary button */

  /* Brand accent */
  --brand:      #7C3AED;    /* violet — focus rings, links, small accents */
  --brand-soft: #EFE7FE;
  --grad: linear-gradient(96deg, #F5A623 0%, #EC4899 46%, #8B5CF6 100%);

  --ok-bg:#E7F6EC; --ok-fg:#157A3D;
  --warn-bg:#FCEFD9; --warn-fg:#9A5B00;

  --shadow-card: 0 24px 60px -28px rgba(70,40,110,0.40), 0 6px 16px -8px rgba(70,40,110,0.12);
  --shadow-pill: 0 1px 2px rgba(26,26,32,0.06);

  --radius-card: 22px;
  --radius-field: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg-base);
}

/* ------------------------------------------------------------------ */
/* Attendee mobile flow                                               */
/* ------------------------------------------------------------------ */
body.attendee {
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 0% 0%,   var(--mesh-lav)  0%, transparent 55%),
    radial-gradient(120% 90% at 100% 12%, var(--mesh-peach) 0%, transparent 52%),
    radial-gradient(130% 100% at 60% 55%, var(--mesh-pink) 0%, transparent 60%),
    radial-gradient(120% 100% at 0% 100%, var(--mesh-lilac) 0%, transparent 55%),
    var(--bg-base);
  background-attachment: fixed;
}

.topbar {
  max-width: 480px; width: 100%; margin: 0 auto;
  padding: 18px 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: relative; z-index: 1;
}
.wordmark { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

.screen {
  flex: 1; max-width: 480px; width: 100%; margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex; flex-direction: column;
  position: relative; z-index: 1;
}
.step { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.step[hidden] { display: none; }
.spacer { flex: 1; min-height: 20px; }

/* Pills (eyebrow + status) */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  box-shadow: var(--shadow-pill);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill svg { display: block; flex: none; }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; flex: none; }
.pill--self { align-self: flex-start; }

/* Headline */
.app__h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.08;
  color: var(--ink);
}
.app__h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--ink);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.app__lead { font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; max-width: 38ch; }

/* Feature chips on welcome */
.features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.feature {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.66);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 13px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  box-shadow: var(--shadow-pill);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.feature svg { display: block; flex: none; color: var(--brand); }

/* Cards (form + done sit on a glassy card, like the demo panel) */
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 22px;
}

/* Form */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  letter-spacing: 0.2px;
}
.field__opt { color: var(--ink-faint); font-weight: 500; }
.field__input {
  font: inherit; font-size: 16px;
  padding: 14px 15px;
  border-radius: var(--radius-field);
  border: 1.5px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field__input::placeholder { color: var(--ink-faint); }
.field__input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.16);
}
.field__input[aria-invalid="true"] { border-color: #E5484D; }

/* Consent */
.consent {
  flex-direction: row; align-items: flex-start; gap: 10px;
  cursor: pointer; padding: 2px 0;
}
.consent__box { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.consent__text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.consent.field--invalid .consent__text { color: #E5484D; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 22px;
  border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(0.985); }
.btn--primary {
  background: var(--panel); color: #fff;
  box-shadow: 0 10px 24px -12px rgba(26,26,32,0.7);
}
.btn--primary:hover { background: #2c2c33; }
.btn--primary:disabled { background: var(--ink-faint); box-shadow: none; cursor: progress; }
.btn--block { width: 100%; }
.btn--ghost {
  background: rgba(255,255,255,0.7); color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-pill);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: #fff; }
.btn--mic svg { color: var(--brand); }

/* Inline errors */
.field__error { display: none; font-size: 12px; color: #E5484D; font-weight: 500; }
.field--invalid .field__error { display: block; }
#consent-error { display: none; }
.form__error {
  font-size: 13px; color: #B4242A;
  background: #FDECEC; border: 1px solid #F4B8BA;
  border-radius: 12px; padding: 10px 14px; font-weight: 500;
}
.form__error[hidden] { display: none; }

/* Done / confirmation */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 6px; }
.done__check {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 16px 34px -14px rgba(139,92,246,0.6);
  margin-bottom: 6px; animation: pop .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.footnote { padding: 12px 24px 26px; color: var(--ink-faint); font-size: 11.5px; text-align: center; position: relative; z-index: 1; }

/* ------------------------------------------------------------------ */
/* Voice toast + ripple (violet to match the field)                   */
/* ------------------------------------------------------------------ */
.voice-toast {
  margin-top: 4px; padding: 10px 14px; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid #D7C4FB;
  color: #5B21B6; font-size: 13px; font-weight: 500;
}
.voice-toast[hidden] { display: none; }
.voice-ripple {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; display: none;
  background: radial-gradient(circle at 50% 60%,
              rgba(139,92,246,0.30) 0%, rgba(236,72,153,0.16) 28%, rgba(245,166,35,0) 62%);
  transform: scale(var(--voice-amp, 1)); transform-origin: 50% 60%;
  transition: transform 80ms linear; animation: voice-pulse 2.2s ease-in-out infinite;
  will-change: transform, opacity;
}
body.voice-mode .voice-ripple { display: block; }
body.voice-mode .ambient { opacity: 0; }
@keyframes voice-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 0.82; } }

/* ------------------------------------------------------------------ */
/* Ops / admin lead list (clean white dashboard)                      */
/* ------------------------------------------------------------------ */
body.ops { background: #fff; font-family: 'Inter', sans-serif; }
.ops__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 30px 32px 16px; border-bottom: 1px solid #ECECF1;
}
.ops__title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ops__sub { color: var(--ink-soft); font-size: 13px; margin-top: 3px; }
.ops__sub a { color: var(--brand); font-weight: 600; text-decoration: none; }
.ops__sub a:hover { text-decoration: underline; }
.chip {
  font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid #E2E2EA; color: var(--ink-soft); background: #fff;
}
.chip--red { background: var(--brand); border-color: var(--brand); color: #fff; }
.ops__main { padding: 22px 32px; }
.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table th, .ops-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #EEEEF2; vertical-align: top; }
.ops-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-faint); font-weight: 700; background: #FAFAFC; }
.ops-table__empty { text-align: center; color: var(--ink-faint); padding: 32px; font-style: italic; }
.ops-table .row--fresh { background: #FBF7FF; }
.badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); }
.badge--neutral { background: #F2F2F6; color: var(--ink-soft); }
.badge--ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge--warn { background: var(--warn-bg); color: var(--warn-fg); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: middle; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.5; } }
.ops-table .row--just-arrived { animation: row-flash 1.6s ease; }
@keyframes row-flash { 0% { background: rgba(124,58,237,0.16); } 100% { background: transparent; } }

/* ------------------------------------------------------------------ */
/* Ambient drifting blobs (very subtle over the mesh)                 */
/* ------------------------------------------------------------------ */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; transition: opacity .35s ease; }
body[data-screen="done"] .ambient { opacity: .4; }
.ambient__bubble {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), rgba(255,255,255,0) 70%);
  filter: blur(20px); will-change: transform;
}
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(8px,-22px) scale(1.06); } 100% { transform: translate(0,0) scale(1); } }
.ambient__bubble:nth-child(1) { left:  6%; top: 12%; width: 150px; height: 150px; animation: drift 22s ease-in-out infinite; animation-delay:  -2s; }
.ambient__bubble:nth-child(2) { left: 78%; top:  8%; width: 120px; height: 120px; animation: drift 18s ease-in-out infinite; animation-delay:  -8s; }
.ambient__bubble:nth-child(3) { left: 22%; top: 58%; width: 170px; height: 170px; animation: drift 26s ease-in-out infinite; animation-delay:  -4s; }
.ambient__bubble:nth-child(4) { left: 70%; top: 52%; width: 140px; height: 140px; animation: drift 20s ease-in-out infinite; animation-delay: -12s; }
.ambient__bubble:nth-child(5) { left: 12%; top: 82%; width: 110px; height: 110px; animation: drift 24s ease-in-out infinite; animation-delay:  -6s; }
.ambient__bubble:nth-child(6) { left: 85%; top: 78%; width: 100px; height: 100px; animation: drift 19s ease-in-out infinite; animation-delay: -10s; }
.ambient__bubble:nth-child(7) { left: 48%; top: 22%; width:  90px; height:  90px; animation: drift 23s ease-in-out infinite; animation-delay: -14s; }
.ambient__bubble:nth-child(8) { left: 38%; top: 92%; width: 130px; height: 130px; animation: drift 21s ease-in-out infinite; animation-delay:  -1s; }

/* ------------------------------------------------------------------ */
/* Step transition ripple (violet) + shake + welcome entrance         */
/* ------------------------------------------------------------------ */
.ripple-overlay {
  position: fixed; inset: 0; background: var(--brand); z-index: 100; pointer-events: none;
  clip-path: circle(0 at var(--ripple-x, 50%) var(--ripple-y, 50%));
  transition: clip-path 320ms cubic-bezier(.4,.0,.2,1), opacity 220ms ease;
}
.ripple-overlay.expand { clip-path: circle(150% at var(--ripple-x, 50%) var(--ripple-y, 50%)); }
.ripple-overlay.vanish { opacity: 0; }

@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake .25s ease; }

.step[data-step="welcome"] > * { opacity: 0; animation: welcome-in .42s cubic-bezier(.2,.8,.2,1) forwards; }
.step[data-step="welcome"] > *:nth-child(1) { animation-delay:   0ms; }
.step[data-step="welcome"] > *:nth-child(2) { animation-delay:  70ms; }
.step[data-step="welcome"] > *:nth-child(3) { animation-delay: 140ms; }
.step[data-step="welcome"] > *:nth-child(4) { animation-delay: 210ms; }
.step[data-step="welcome"] > *:nth-child(5) { animation-delay: 280ms; }
.step[data-step="welcome"] > *:nth-child(6) { animation-delay: 350ms; }
.step[data-step="welcome"] > *:nth-child(7) { animation-delay: 420ms; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------------ */
/* Accessibility — respect reduced motion                             */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
