/* Reps — public site. One stylesheet for every page, EN and ES.
 *
 * Same visual language as the app (src/lib/theme.ts and
 * VISUAL_IDENTITY_HANDOFF.md): a deep navy canvas, filled surfaces with no
 * outlines, the system face, hierarchy by weight, and the lime kept for the
 * primary action, progress and what's selected. No glows, no boxes in boxes. */

:root {
  color-scheme: dark;   /* native pickers (age, country) and autofill match the page */
  --bg: #070b14;
  --surface: #151b27;                    /* theme colors.surface */
  --surface-2: #222a38;                  /* surfaceMuted: a step brighter, nested controls */
  --border: rgba(84, 84, 88, 0.6);       /* separator */
  --text: #fff;
  --text-2: rgba(235, 235, 245, 0.74);   /* textSecondary */
  --muted: rgba(235, 235, 245, 0.56);    /* textMuted */
  --accent: #a6ff00;
  --on-accent: #0a0d14;
  --accent-soft: rgba(166, 255, 0, 0.12);
  --danger: #ff453a;
  --danger-text: #ff6961;
  --warn: #ffd98a;
  --max: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 16px 96px;
}

/* ── Header ─────────────────────────────────────────────────────────── */

header.site {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

/* The wordmark: REPS in the app's brand face (Nunito Black), as outlines. */
header.site .brand { display: block; line-height: 0; }
header.site .brand svg { display: block; height: 20px; width: auto; }

header.site .lang {
  margin-left: auto;
  font-size: 14px;
}

header.site .lang a {
  display: inline-block;
  color: var(--text-2);
  text-decoration: none;
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  line-height: 1.4;
}

@media (hover: hover) { header.site .lang a:hover { background: var(--surface-2); color: var(--text); } }

/* ── Type ───────────────────────────────────────────────────────────── */

h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
  text-wrap: balance;
}

h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 17px;
  margin: 28px 0 8px;
}

p, li { color: var(--text); }

.updated {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 36px;
}

.lead { font-size: 19px; line-height: 1.45; color: var(--text-2); }

ul { padding-left: 22px; }
li { margin: 8px 0; }

a { color: var(--text); text-decoration-color: var(--muted); text-underline-offset: 3px; }

strong { color: #fff; }

/* ── Blocks ─────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 24px 0;
}

.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.card.warn { background: rgba(255, 217, 138, 0.08); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { color: var(--text-2); font-weight: 600; }

footer.site {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer.site a { color: var(--muted); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  h1 { font-size: 28px; }
  .wrap { padding: 28px 16px 72px; }
}

/* ── Fields and buttons (beta form, account deletion, auth) ─────────── */

label {
  display: block;
  font-size: 14px;
  color: var(--text-2);
  margin: 16px 0 6px;
}

input[type="email"],
input[type="password"],
input[type="tel"],
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
}

input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--accent); }

/* Chrome paints autofilled fields its own pale blue: keep them the surface. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  width: 100%;
  margin-top: 18px;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
}

@media (hover: hover) { button:hover { filter: brightness(1.06); } }
button:active { filter: brightness(0.92); }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

button.secondary {
  background: var(--surface);
  color: var(--text);
}

button.danger { background: var(--danger); color: #fff; }

.sep {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 20px 0 4px;
}

.msg {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  display: none;
}

.msg.error { display: block; background: rgba(255, 69, 58, 0.12); color: #ff8a80; }
.msg.ok    { display: block; background: rgba(74, 222, 128, 0.12); color: #9ff0b8; }

.step { display: none; }
.step.on { display: block; }

.who {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.who strong { color: var(--text); }

[hidden] { display: none !important; }

/* ── Home ───────────────────────────────────────────────────────────── */

/* A form reads better in a phone-width column than across a desktop. */
body.home .wrap { max-width: 600px; }
body.home .lead { margin: 0 0 8px; }
body.home .sub { margin: 0; font-size: 15px; color: var(--muted); }

/* ── Beta sign-up ───────────────────────────────────────────────────── */

/* On the home page the form sits on the canvas, lined up with the headline;
   auth.html still wraps its own in a card. */
form.stepper { margin: 36px 0 0; padding: 0; }
form.stepper.card { padding: 20px 20px 18px; margin-top: 28px; }

form.stepper .progress {
  height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
form.stepper .progress i {
  display: block; height: 100%; width: 0; background: var(--accent);
  border-radius: 999px; transition: width .3s ease;
}

/* Holds the back button, and is hidden with it (first step, done screen). */
form.stepper .topline {
  display: flex; align-items: center; gap: 12px; min-height: 30px; margin-top: 12px;
}
form.stepper .topline[hidden] + #beta-step { margin-top: 22px; }
/* Until beta.js draws the first question: about its height, so the footer
   doesn't jump down when it arrives on a slow connection. */
#beta-step:empty { min-height: 300px; }
form.stepper .back {
  display: inline-flex; align-items: center; gap: 8px;
  width: auto; margin: 0; padding: 6px 8px 6px 0; background: none; color: var(--text-2);
  font-weight: 500; font-size: 15px; border-radius: 6px;
}
form.stepper .back:not(.plain)::before {
  content: ''; width: 7px; height: 7px; margin-left: 2px;
  border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg);
}
@media (hover: hover) { form.stepper .back:hover { color: var(--text); filter: none; } }

form.stepper .step.enter { animation: step-in .22s ease-out both; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

form.stepper h2 {
  margin: 8px 0 6px; padding: 0; border: 0;
  font-size: 22px; line-height: 1.27; letter-spacing: -0.01em; text-wrap: balance;
}
form.stepper h2:focus { outline: none; }
form.stepper .hint { color: var(--text-2); margin: 0; font-size: 15px; line-height: 1.45; }
form.stepper .fine { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 14px 0 0; }

form.stepper input[type="email"] { margin-top: 18px; }
form.stepper .field-label { margin: 18px 0 6px; font-size: 14px; color: var(--text-2); }
form.stepper input[aria-invalid="true"], form.stepper select[aria-invalid="true"] { border-color: var(--danger); }
form.stepper select {
  width: 100%; margin: 0; padding: 14px 44px 14px 16px;
  -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 17px center / 12px 8px;
  border: 1px solid transparent; border-radius: 12px;
  color: var(--text); font-size: 17px; font-family: inherit;
}
form.stepper select:invalid { color: var(--muted); }
form.stepper select option { color: var(--text); background: var(--surface); }
form.stepper select:focus { outline: none; border-color: var(--accent); }

form.stepper .group-label { margin: 22px 0 0; font-size: 15px; color: var(--text-2); }

.opts {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 16px;
}
.opts.list { grid-template-columns: 1fr; }
/* An odd one out takes the whole last row instead of sitting alone on the left. */
.opts:not(.list) > .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Filled, no outline (the fill separates them, as in the app); an answer
   turns lime. */
.opt {
  margin: 0; min-height: 52px; padding: 12px 14px;
  background: var(--surface); color: var(--text);
  border: 0; border-radius: 12px;
  font-weight: 500; font-size: 16px; line-height: 1.3; text-align: center;
  transition: background-color .12s, color .12s, box-shadow .12s;
}
.opts.list .opt { text-align: left; padding-left: 16px; }
.opt:hover, .opt:active { filter: none; }
@media (hover: hover) { .opt:hover { background: var(--surface-2); } }
.opt:active { background: var(--surface-2); }
.opt[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent);
}
/* Ticked options wear a badge on the corner, outside the text, so ticking
   never reflows the grid. Drawn, not typed: a "✓" character would be read
   out as part of the option's name. */
.opt[data-multi] { position: relative; }
.opt[data-multi][aria-pressed="true"]::after {
  content: ''; position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3l2.2 2.2 4.6-4.9' fill='none' stroke='%230a0d14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  box-shadow: 0 0 0 3px var(--bg);
}
.opt.dim { opacity: 0.4; }
.opt:focus-visible, form.stepper .next:focus-visible, form.stepper .link:focus-visible, form.stepper .back:focus-visible,
form.stepper .share-btn:focus-visible, form.stepper .call-yes:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

form.stepper .follow { margin-top: 22px; }
form.stepper .follow.appear { animation: step-in .2s ease-out both; }
form.stepper .follow .group-label { margin-top: 0; }
form.stepper .follow .field-label { margin-top: 0; }

form.stepper .next { margin-top: 22px; }

form.stepper .field-error { margin: 12px 0 0; font-size: 14px; color: var(--danger-text); }
form.stepper .field-error:empty { display: none; }

form.stepper .status { margin: 12px 0 0; font-size: 14px; color: var(--text-2); }
form.stepper .status:empty { display: none; }
form.stepper .status.error {
  padding: 12px 14px; border-radius: 12px; background: rgba(255, 69, 58, 0.12); color: #ff8a80;
}
form.stepper .status.ok { color: var(--text-2); }

/* Under the email field: a suggested fix or the Google-account question. */
form.stepper .note { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--warn); }
form.stepper .note:empty { display: none; }
form.stepper .note.ok { color: var(--text-2); }
form.stepper .link {
  width: auto; margin: 0; padding: 6px 0; background: none; color: var(--text-2);
  font-weight: 500; font-size: 15px; text-align: left;
  text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px;
}
@media (hover: hover) { form.stepper .link:hover { color: var(--text); filter: none; } }
form.stepper .link.inline {
  display: inline; padding: 0; font-size: inherit; font-weight: 600; color: var(--text);
  vertical-align: baseline;
}

/* The done screen. */
form.stepper .done-email { color: var(--text); overflow-wrap: anywhere; }
form.stepper .done-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 14px; }
form.stepper .call-ask {
  margin-top: 24px; padding: 18px; background: var(--surface); border-radius: 16px;
}
form.stepper .call-ask p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text); }
form.stepper .call-yes { margin-top: 14px; }
form.stepper .call-thanks { font-weight: 600; }
form.stepper .call-thanks:focus { outline: none; }
form.stepper .call-ask .field-label { margin-top: 14px; }
form.stepper .call-ask input { background: var(--surface-2); }
form.stepper .call-ask input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset; }
form.stepper .call-ask .fine { margin-top: 8px; font-size: 13px; color: var(--muted); }
form.stepper .call-ask .field-error { margin-top: 8px; font-size: 14px; color: var(--danger-text); }
form.stepper .phone-actions { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
form.stepper .phone-actions .call-yes { width: auto; margin: 0; padding: 12px 24px; }

form.stepper .share { margin-top: 24px; }
form.stepper .share p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-2); }
form.stepper .share-btn {
  margin-top: 12px; background: var(--surface); color: var(--text);
}
@media (hover: hover) { form.stepper .share-btn:hover { background: var(--surface-2); filter: none; } }
form.stepper .share-status { margin: 10px 0 0; font-size: 14px; color: var(--text-2); }
form.stepper .share-status:empty { display: none; }
form.stepper .share-url { margin-top: 6px; font-size: 15px; }
form.stepper .follow-us { margin-top: 24px; color: var(--text-2); }
form.stepper .follow-us a { color: var(--text); }

footer.site.small { font-size: 13px; line-height: 2; }

@media (prefers-reduced-motion: reduce) {
  form.stepper .progress i, .opt { transition: none; }
  form.stepper .step.enter, form.stepper .follow.appear { animation: none; }
}
