@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

@font-face {
  font-family: "GT Standard";
  src: url("/assets/fonts/GT-Standard-L-Extended-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "GT Standard";
  src: url("/assets/fonts/GT-Standard-L-Extended-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

/* Reinvent brand tokens. Dark is the default; light is available from the header toggle. */
:root {
  --bg: #0D0D14;
  --bg-mid: #141420;
  --mesh:
    radial-gradient(ellipse 80% 60% at 15% 80%, rgba(232,88,58,0.33) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(46,107,230,0.37) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 50% 50%, #141420 0%, #0D0D14 100%);
  --text: #FFFFFF;
  --muted: rgba(255,255,255,0.65);
  --faint: rgba(255,255,255,0.35);
  --card: rgba(255,255,255,0.03);
  --card-hover: rgba(255,255,255,0.07);
  --input: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.09);
  --line-hover: rgba(255,255,255,0.22);
  --track: rgba(255,255,255,0.07);
  --selected: rgba(232,88,58,0.10);
  --header-bg: rgba(13,13,20,0.80);
  --accent: #E8583A;
  --accent-2: #F5834A;
  --blue: #2E6BE6;
  --green: #3DD68C;
  --brand-gradient: linear-gradient(135deg, #E8583A, #2E6BE6);
  --progress-gradient: linear-gradient(90deg, #E8583A, #F5834A);
  --radius: 16px;
  --font: 'GT Standard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F4F5F7;
  --bg-mid: #ECEDF1;
  --mesh:
    radial-gradient(ellipse 80% 60% at 15% 80%, rgba(232,88,58,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(46,107,230,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 50% 50%, #ECEDF1 0%, #F4F5F7 100%);
  --text: #111118;
  --muted: rgba(17,17,24,0.70);
  --faint: rgba(17,17,24,0.45);
  --card: rgba(255,255,255,0.80);
  --card-hover: rgba(255,255,255,0.95);
  --input: rgba(255,255,255,0.90);
  --line: rgba(17,17,24,0.10);
  --line-hover: rgba(17,17,24,0.28);
  --track: rgba(17,17,24,0.09);
  --selected: rgba(232,88,58,0.08);
  --header-bg: rgba(244,245,247,0.85);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Fixed mesh background (background-attachment: fixed is unreliable on iPad Safari) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--mesh);
  pointer-events: none;
}

button { font: inherit; }

/* ---------------- Header ---------------- */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top .logo { display: block; height: 28px; width: auto; }
.top .product {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.top .spacer { flex: 1; }
.top .tagline {
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 600;
  color: var(--faint);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .top .tagline { display: none; }
  .top .product { border-left: none; padding-left: 0; font-size: 0.95rem; }
}

.theme-toggle {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  min-height: 36px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  touch-action: manipulation;
}
.theme-toggle:hover { border-color: var(--line-hover); color: var(--text); }

/* ---------------- Layout ---------------- */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.progress {
  height: 6px;
  background: var(--track);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress .bar {
  height: 100%;
  width: 0;
  background: var(--progress-gradient);
  transition: width 0.35s ease;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; font-weight: 700; }

/* Reinvent gradient title */
h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  display: inline-block;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 60%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); color: var(--text); }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 8px; }
.note { font-size: 0.95rem; color: var(--muted); margin: 16px 0 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .opt:focus-visible, .theme-toggle:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.btn.secondary {
  background: var(--input);
  border: 1px solid var(--line-hover);
  color: var(--text);
}
.btn.secondary:hover { background: var(--card-hover); opacity: 1; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  min-height: 48px;
  font-size: 1.05rem;
  padding: 10px 14px;
}
.btn.ghost:hover { color: var(--text); opacity: 1; }
.btn.block { width: 100%; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; align-items: center; }

/* ---------------- Survey ---------------- */
.step { color: var(--muted); font-size: 1rem; margin-bottom: 8px; }
.question-text { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; }
.options { display: grid; gap: 12px; }
.opt {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  text-align: left;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1.15rem;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: var(--line-hover); background: var(--card-hover); }
.opt:disabled { cursor: default; }
.opt .dot {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  position: relative;
}
.opt.selected { border-color: var(--accent); background: var(--selected); }
.opt.selected .dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--brand-gradient);
}

/* ---------------- Result ---------------- */
.persona { border-top: 6px solid var(--persona, var(--accent)); }
.persona .name {
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  color: var(--persona, var(--accent));
  margin: 4px 0 8px;
  font-weight: 700;
  line-height: 1.1;
}
.persona .tagline { font-size: 1.2rem; font-style: italic; color: var(--muted); margin: 0 0 16px; }
.persona .desc { font-size: 1.08rem; margin: 0 0 24px; }
.why-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.why { margin: 0 0 24px; padding-left: 20px; font-size: 1.02rem; }
.why li { margin-bottom: 6px; }
.recap { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.recap li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.recap .q { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.recap .a { font-size: 1.05rem; }
.countdown { font-size: 0.95rem; color: var(--muted); margin-top: 16px; }

.error { color: #F5834A; font-size: 1.05rem; margin-top: 12px; }

/* ---------------- Email field ---------------- */
.field-label { display: block; font-size: 1rem; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.field {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  font: inherit;
  font-size: 1.15rem; /* 16px+ stops iPad Safari zooming in on focus */
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.field::placeholder { color: var(--faint); }
.field:hover { border-color: var(--line-hover); }
.field:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: #F5834A; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
