/* ============================================================
   The apply form's only stylesheet.

   Tokens copied verbatim from waitlist/spark.css, which copies them
   from client/src/theme.ts — see that file's header for the mapping
   and the standing obligation: if the palette moves in theme.ts, move
   it here and in waitlist/spark.css by hand. Three copies now, one
   per Vercel project, because none of them can import from another.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #0b0b0f;
  --surface: #16181f;
  --fill-grey: #1c1c1e;
  --border: #2a2e3d;
  --border-strong: #3a3f52;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --primary: #e11d48;
  --primary-ink: #fb7185;
  --primary-pressed: #c81e4a;
  --on-primary: #ffffff;
  --success: #34d399;
  --danger-ink: #fda4af;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 24px;
  --s-2xl: 32px;
  --s-3xl: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* No scrolling, by request — see landing/landing.css's identical
   comment for why 100dvh (not just 100vh) is what actually achieves
   it on mobile. */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-ink);
  text-decoration-color: rgba(251, 113, 133, 0.4);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-ink);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-3xl) var(--s-xl);
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Same file, same sizing, as waitlist/spark.css's .wordmark — see
   that file for the Retina/alt-text reasoning. */
.wordmark {
  display: block;
  margin: 0 auto var(--s-md);
  width: auto;
  height: auto;
  max-width: 180px;
}

@media (min-width: 720px) {
  .wordmark {
    max-width: 220px;
  }
}

h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(24px, 4.5vw, 30px);
  line-height: 1.25;
  margin: 0 0 var(--s-2xl);
  text-align: center;
  color: var(--text);
}

.card {
  background: none;
  border: none;
  padding: 0;
}

.field {
  max-width: 420px;
  margin: 0 auto var(--s-lg);
}

/* The Turnstile widget. data-size="flexible" on the element itself
   makes Cloudflare's iframe fill this wrapper's width, and this
   wrapper is a plain .field — same 420px column, same auto-centring —
   so the (usually invisible, see index.html's note on
   data-appearance="interaction-only") badge lines up under the fields
   above it instead of rendering at its own fixed width off to the
   left. Smaller bottom margin than a real field: most visitors never
   see anything render here at all, so a full field-sized gap would
   read as empty space. */
.turnstile-field {
  margin-bottom: var(--s-sm);
}

.field input,
.field select {
  width: 100%;
  padding: 13px var(--s-md);
  font-family: inherit;
  font-size: 16px; /* 16px, or iOS Safari zooms the page on focus. */
  color: var(--text);
  background: var(--fill-grey);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.field select {
  /* Matches theme-color; an unstyled select defaults to the OS chrome
     colour scheme, which on some platforms renders pale text on a
     pale dropdown against this dark page. */
  color-scheme: dark;
}

.field input::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field select:focus {
  border-color: var(--border-strong);
}

.field input[aria-invalid='true'],
.field select[aria-invalid='true'] {
  border-color: var(--danger-ink);
}

/* The honeypot. Off-screen, not display:none or visibility:hidden —
   some bots skip inputs that are hidden that way but still fill
   anything laid out in the DOM. A screen-reader user never reaches it
   either: aria-hidden on the wrapping .field removes the whole thing
   from the accessibility tree, same technique as .sr-only elsewhere
   uses for the opposite purpose. */
.field.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  margin-bottom: var(--s-lg);
}

.consent-row {
  display: flex;
  justify-content: center;
  gap: var(--s-sm);
  align-items: center;
  cursor: pointer;
  max-width: 420px;
  margin: 0 auto;
}

.consent input[type='checkbox'] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  accent-color: var(--primary);
}

.consent input[type='checkbox'][aria-invalid='true'] {
  outline: 2px solid var(--danger-ink);
  outline-offset: 2px;
}

.consent-row span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

button.primary {
  display: block;
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
  padding: 15px var(--s-lg);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-primary);
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  min-height: 48px;
}

button.primary:hover:not(:disabled) {
  background: var(--primary-pressed);
}

button.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.status {
  margin-top: var(--s-lg);
  text-align: center;
  font-size: 12px;
  text-transform: lowercase;
  min-height: 1.5em;
}

.status.error {
  color: var(--danger-ink);
}

.status.ok {
  color: var(--success);
}

#done {
  text-align: center;
  padding: var(--s-lg) 0;
}

#done h2 {
  margin: 0 0 var(--s-sm);
  color: var(--text);
}

#done p {
  color: var(--text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  flex: 0 0 auto;
  padding: var(--s-xl);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

footer a {
  margin: 0 var(--s-md);
  white-space: nowrap;
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  color: var(--primary-ink);
  text-decoration: underline;
  text-decoration-color: currentColor;
}

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