:root {
  --brand: #3A2B9C;
  --brand-ink: #1a1625;
  --brand-soft: #DAD7F0;
  --brand-bg-start: #faf9ff;
  --brand-bg-end: #f1eefb;
  --accent-warm: #FF8A5B;
  --accent-cool: #6AD2C9;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --tap: 72px;
  --text-body: 22px;
  --text-answer: 22px;
  --text-cta: 22px;
  --text-title: 40px;
  --text-headline: 44px;
  --text-eyebrow: 15px;

  --transition: 200ms ease-out;
}

* { box-sizing: border-box; }

html, body {
  height: 100%; margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand-bg-start), var(--brand-bg-end));
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body { user-select: none; -webkit-user-select: none; }

.app { position: relative; width: 100vw; height: 100vh; overflow: hidden; }

.screen-host {
  position: absolute; inset: 0;
  padding: 48px 64px;
  display: flex; flex-direction: column;
}

/* Screens fade in from 8px below */
.screen {
  position: absolute; inset: 48px 64px;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}
.screen.enter { opacity: 1; transform: translateY(0); }

/* Reusable */
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: var(--text-eyebrow); color: var(--brand);
  font-weight: 600; opacity: 0.85;
}
.headline { font-size: var(--text-headline); line-height: 1.12; font-weight: 600; margin: 10px 0 18px; }
.sub { font-size: var(--text-body); line-height: 1.5; opacity: 0.82; margin: 0 0 28px; }

.cta {
  min-height: var(--tap);
  padding: 18px 36px;
  background: var(--brand); color: #fff;
  border: 0; border-radius: var(--radius-md);
  font-size: var(--text-cta); font-weight: 600; cursor: pointer;
  box-shadow: 0 14px 28px rgba(58, 43, 156, 0.38);
  display: inline-flex; align-items: center; gap: 10px;
}
.cta:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.cta .chev { color: var(--accent-warm); font-size: 1.3em; }

.pill {
  min-height: var(--tap);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 2px solid rgba(58, 43, 156, 0.2);
  color: var(--brand-ink);
  font-size: var(--text-body); cursor: pointer;
  display: inline-flex; align-items: center;
}
.pill.selected {
  border-color: var(--brand);
  background: rgba(58, 43, 156, 0.08);
  color: var(--brand); font-weight: 600;
}

/* Language toggle */
.lang-toggle {
  position: absolute; top: 24px; right: 36px;
  font-size: var(--text-body); color: var(--brand); z-index: 10;
}
.lang-toggle button {
  min-width: 48px; min-height: 48px;
  background: transparent; border: 0; color: inherit;
  padding: 8px 12px; border-radius: 8px; font: inherit; cursor: pointer;
}
.lang-toggle button.active { background: rgba(58, 43, 156, 0.12); font-weight: 600; }

/* Intro */
.intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; height: 100%; }
.intro-copy { display: flex; flex-direction: column; justify-content: center; }
.intro-stork { display: flex; align-items: center; justify-content: center; }
.intro-stork img { width: 100%; max-width: 440px; filter: drop-shadow(0 20px 30px rgba(58, 43, 156, 0.22)); }
.size-picker { display: flex; gap: 12px; margin: 8px 0 28px; }

/* Question */
.q-title { font-size: var(--text-title); font-weight: 600; line-height: 1.2; margin: 8px 0 26px; }
.q-label { font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: 0.14em; color: var(--brand); font-weight: 600; }
.progress {
  height: 8px; background: rgba(58, 43, 156, 0.12);
  border-radius: 4px; margin: 20px 0 28px; overflow: hidden;
}
.progress > div {
  height: 100%; background: linear-gradient(90deg, var(--brand), #6A5BD4);
  transition: width var(--transition);
}
.answers { display: grid; gap: 14px; }
.answer {
  min-height: var(--tap);
  padding: 20px 24px; border-radius: var(--radius-md);
  background: #fff; border: 2px solid rgba(58, 43, 156, 0.15);
  font-size: var(--text-answer); line-height: 1.35;
  display: flex; align-items: center; gap: 18px; cursor: pointer;
  text-align: left; width: 100%;
}
.answer.selected { border-color: var(--brand); background: rgba(58, 43, 156, 0.06); }
.answer .dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid rgba(58, 43, 156, 0.35); flex-shrink: 0;
}
.answer.selected .dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 5px #fff; }
.q-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 22px; font-size: var(--text-body); }
.back-btn {
  min-height: 56px; padding: 12px 20px;
  background: transparent; border: 0; color: var(--brand);
  font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--radius-sm);
}
.back-btn[hidden] { visibility: hidden; }

/* Email capture */
.email-form { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.field label { display: block; font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"] {
  width: 100%; min-height: var(--tap);
  padding: 16px 18px; font-size: var(--text-body);
  border-radius: var(--radius-md);
  border: 2px solid rgba(58, 43, 156, 0.2);
  background: #fff; color: var(--brand-ink);
}
.field input:focus { outline: 3px solid rgba(58, 43, 156, 0.35); outline-offset: 2px; border-color: var(--brand); }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; line-height: 1.4; }
.consent input[type="checkbox"] { width: 28px; height: 28px; flex-shrink: 0; margin-top: 2px; accent-color: var(--brand); }
.consent a { color: var(--brand); }

/* Score reveal */
.score-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 36px; height: 100%; align-items: center; }
.tier-block .tier-label { font-size: 60px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.tier-block .tier-sub { font-size: var(--text-body); opacity: 0.75; margin-top: 12px; }
.bars { display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: 160px 1fr 40px; gap: 14px; align-items: center; font-size: 18px; }
.bar .track { height: 14px; background: rgba(58, 43, 156, 0.12); border-radius: 7px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--brand), #6A5BD4); transition: width 400ms ease-out; }
.sent-line { margin-top: 28px; font-size: 20px; }
.sent-line strong { color: var(--brand); }
.score-watermark { position: absolute; top: 32px; right: 80px; width: 80px; opacity: 0.6; pointer-events: none; }

/* Staff overlay */
.staff-logo {
  position: absolute; bottom: 20px; left: 28px;
  background: transparent; border: 0; padding: 10px 14px;
  color: var(--brand); font-weight: 700; font-size: 18px; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 8px; opacity: 0.5;
}
.staff-logo:focus { outline: none; }

.staff-overlay {
  position: absolute; inset: 0; background: rgba(26, 22, 37, 0.92); color: #fff;
  padding: 48px; z-index: 100; overflow: auto;
}
.staff-overlay h2 { color: var(--accent-warm); margin-top: 0; }
.staff-overlay pre { background: #0c0917; padding: 16px; border-radius: 8px; overflow: auto; }
.staff-overlay .row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.staff-overlay button { background: var(--brand); color: #fff; border: 0; padding: 12px 18px; border-radius: 8px; font-size: 16px; cursor: pointer; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .screen, .bar .fill, .progress > div { transition: none !important; }
}
