/* The sign-up page (/signup and /signup/done). Self-contained: its own tokens, light and dark, on the app's green. */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #16191d;
  --muted: #667078;
  --line: #e6e1d8;
  --line-strong: #cfc8bb;
  --accent: #0f7b5f;
  --accent-hover: #0c6a52;
  --accent-ink: #ffffff;
  --accent-tint: #eaf6f1;
  --ring: rgba(15, 123, 95, .22);
  --error: #b3261e;
  --error-tint: #fbeceb;
  --shadow: 0 1px 2px rgba(22, 25, 29, .04), 0 8px 24px rgba(22, 25, 29, .06);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b141a;
    --surface: #111b21;
    --ink: #e9edef;
    --muted: #9aa5ac;
    --line: #25323a;
    --line-strong: #3a4952;
    --accent: #21c08b;
    --accent-hover: #4ad1a3;
    --accent-ink: #06231a;
    --accent-tint: #12382b;
    --ring: rgba(33, 192, 139, .3);
    --error: #ff8a80;
    --error-tint: #3f1a18;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  /* a faint wash of the brand green behind the top of the page */
  background-image: radial-gradient(640px 320px at 50% -90px, var(--accent-tint), transparent);
  background-repeat: no-repeat;
}

.su {
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(48px, env(safe-area-inset-bottom));
}

/* the top bar: the mark, and the language */
.su-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.su-mark { display: inline-flex; border-radius: 9px; }
.su-mark img { display: block; width: 32px; height: 32px; }
.su-mark:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.su-lang { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.su-lang select {
  appearance: none; -webkit-appearance: none;
  font: 500 14px/1 var(--font); color: var(--ink);
  min-height: 40px; padding: 0 32px 0 34px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: border-color .15s ease-out;
}
.su-lang select:hover { border-color: var(--line-strong); }
.su-lang select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.su-globe { position: absolute; left: 12px; pointer-events: none; }
.su-chev { position: absolute; right: 12px; pointer-events: none; }

/* the heading and the one line under it */
.su-view h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.su-sub { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }

#signup-form { margin-top: 32px; display: flex; flex-direction: column; gap: 24px; }

/* the two plans: real radios inside labels, so the whole row is the click target and arrows move between them */
.su-plans { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.su-plans legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.su-plan {
  position: relative; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 14px;
  padding: 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  transition: border-color .15s ease-out, background-color .2s ease-out, box-shadow .2s ease-out, transform .15s ease-out;
}
.su-plan:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.su-plan input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.su-plan.on { background: var(--accent-tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }
.su-plan.kb { outline: 3px solid var(--accent); outline-offset: 2px; }
.su-radio {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; transition: border-color .15s ease-out, background-color .15s ease-out;
}
.su-radio::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink);
  transform: scale(0); transition: transform .2s ease-out;
}
.su-plan.on .su-radio { border-color: var(--accent); background: var(--accent); }
.su-plan.on .su-radio::after { transform: scale(1); }
.su-plan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.su-plan-name { font-size: 16px; line-height: 1.3; font-weight: 600; }
.su-plan-line { font-size: 13px; line-height: 1.4; color: var(--muted); }
.su-plan-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.su-amount { font-size: 24px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.su-period { font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.su-trial { margin: 0; text-align: center; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* the account card */
.su-card {
  display: flex; flex-direction: column; gap: 20px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.su-fields { display: flex; flex-direction: column; gap: 16px; }
.su-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.su-field label { font-size: 13px; font-weight: 600; }
.su-field input {
  width: 100%; height: 48px; padding: 0 14px;
  font: 16px/1.2 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.su-field input:hover { border-color: var(--muted); }
.su-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.su-field input[aria-invalid="true"] { border-color: var(--error); }
.su-field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--error-tint); }
.su-pass { position: relative; }
.su-pass input { padding-right: 76px; }
.su-show {
  position: absolute; top: 4px; right: 4px; height: 40px; min-width: 64px; padding: 0 12px;
  font: 600 13px/1 var(--font); color: var(--accent); background: transparent; border: 0; border-radius: 9px; cursor: pointer;
}
.su-show:hover { background: var(--accent-tint); }
.su-show:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.su-help { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.su-err { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.4; color: var(--error); animation: su-in .15s ease-out; }
.su-err::before {
  content: "!"; flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 1px;
  font: 700 11px/1 var(--font); color: var(--surface); background: var(--error); border-radius: 50%;
}
.su-err a, .su-alert a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.su-alert { margin: 0; padding: 12px 14px; font-size: 14px; line-height: 1.45; color: var(--error); background: var(--error-tint); border-radius: 12px; animation: su-in .15s ease-out; }
#signup-closed { margin-top: 24px; }
.su-note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; font-size: 14px; font-weight: 500; background: var(--accent-tint); border-radius: 12px; }
.su-note svg { flex: none; color: var(--accent); }
.su-who { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.su-who strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.su-link { padding: 0; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.su-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* the one filled thing on the page */
.su-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 12px 20px;
  font: 600 16px/1.25 var(--font); text-align: center; text-decoration: none;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 12px; cursor: pointer;
  transition: background-color .15s ease-out, transform .1s ease-out;
}
.su-btn:hover { background: var(--accent-hover); }
.su-btn:active { transform: scale(.98); }
.su-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.su-btn:disabled { opacity: .6; cursor: progress; }
.su-btn.su-ghost { color: var(--ink); background: transparent; border: 1px solid var(--line-strong); }
.su-btn.su-ghost:hover { background: var(--surface); border-color: var(--muted); }
.su-spin { display: none; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: su-turn .8s linear infinite; }
.su-btn.busy .su-spin { display: inline-block; }
.su-trust { display: flex; gap: 8px; align-items: flex-start; justify-content: center; margin: -8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: left; }
.su-trust svg { flex: none; margin-top: 3px; }
.su-have { margin: 24px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.su-have a { color: var(--accent); font-weight: 600; text-decoration: none; }
.su-have a:hover { text-decoration: underline; text-underline-offset: 2px; }
.su-have a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* the signed-in and confirmation panels */
.su-panel {
  display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 24px; padding: 32px 24px 24px;
  text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.su-panel h1 { text-wrap: balance; }
.su-sub { text-wrap: pretty; }
.su-panel h1:focus { outline: none; }
.su-panel .su-sub { margin-bottom: 24px; overflow-wrap: anywhere; }
.su-panel .su-btn + .su-btn { margin-top: 12px; }
.su-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 20px; color: var(--accent); background: var(--accent-tint); border-radius: 50%; }
.su-panel.wait .su-badge svg { display: none; }
.su-panel.wait .su-badge::after { content: ""; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: su-turn .8s linear infinite; }
.su-panel.warn .su-badge { color: var(--error); background: var(--error-tint); }
.su-badge .su-warn-icon, .su-panel.warn .su-badge svg:not(.su-warn-icon) { display: none; }
.su-panel.warn .su-badge .su-warn-icon { display: block; }

/* a field only form-filling bots fill in */
.su-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@keyframes su-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes su-turn { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .su { padding-top: 48px; }
  .su-top { margin-bottom: 48px; }
  .su-view h1 { font-size: 32px; }
  .su-card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .su-plan:hover, .su-btn:active { transform: none; }
  .su-panel.wait .su-badge::after, .su-btn.busy .su-spin { border-right-color: currentColor; opacity: .6; }
}
