/* Self-hosted, no external fonts or CDNs. Dark is the default; light arrives
   two ways, from the OS or from the visitor. The :not() is what lets an
   explicit choice beat the OS preference in both directions. */

:root {
  /* Must track the palette below. Native controls paint from color-scheme, not
     from our variables, so a mismatch renders an unchecked checkbox as a solid
     dark square on a light page, which reads as already ticked. */
  color-scheme: dark;

  --bg: #0f1115;
  --surface: #171b23;
  --surface-2: #1e232d;
  --text: #e8eaf0;
  --muted: #939bab;
  --faint: #6f7889;
  --accent: #4f8cf7;
  --accent-hover: #6a9dfa;
  --accent-ink: #ffffff;
  --line: #272d38;
  --line-strong: #39414f;
  --ok-bg: #12271c;
  --ok-line: #2f6b45;
  --ok-text: #9fe6bb;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f5f7fa;
    --text: #16191f;
    --muted: #5b6472;
    --faint: #838c9b;
    --accent: #1f6feb;
    --accent-hover: #1a5fd0;
    --accent-ink: #ffffff;
    --line: #e2e6ec;
    --line-strong: #c3cad4;
    --ok-bg: #eaf7ef;
    --ok-line: #8fcfa8;
    --ok-text: #1c5334;
    --shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 32px rgba(16,24,40,.08);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --text: #16191f;
  --muted: #5b6472;
  --faint: #838c9b;
  --accent: #1f6feb;
  --accent-hover: #1a5fd0;
  --accent-ink: #ffffff;
  --line: #e2e6ec;
  --line-strong: #c3cad4;
  --ok-bg: #eaf7ef;
  --ok-line: #8fcfa8;
  --ok-text: #1c5334;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 32px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  body { transition: background .15s ease, color .15s ease; }
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--text);
  padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 8px;
}
.skip:focus { left: 1rem; top: 1rem; }

.theme-toggle {
  position: fixed; top: 1rem; right: 1rem; z-index: 5;
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--faint);
  font: inherit; font-size: .8rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }

/* The button names the mode it switches TO, which is the thing being chosen.
   Naming the current mode reads as a status display and gets misclicked. */
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
}

/* ---------- Signup page ---------- */

.auth {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1.25rem;
}

.auth-inner { width: 100%; max-width: 25.5rem; }

.wordmark {
  display: block; text-align: center; text-decoration: none;
  color: var(--text); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -.015em; margin-bottom: 1.5rem;
}
.wordmark span { color: var(--accent); }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.auth-card h1 {
  font-size: 1.35rem; line-height: 1.3; letter-spacing: -.02em;
  margin: 0 0 .35rem; text-align: center;
}
.auth-card .sub {
  color: var(--muted); font-size: .92rem; text-align: center;
  margin: 0 0 1.5rem;
}

.field { margin-bottom: 1rem; }
.field label {
  display: block; font-weight: 500; font-size: .875rem;
  margin-bottom: .35rem; color: var(--text);
}
.field label .opt { color: var(--faint); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%; padding: .6rem .75rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit;
}
input::placeholder { color: var(--faint); }
input:focus { border-color: var(--accent); }

.field .hint {
  display: block; color: var(--faint); font-size: .8rem; margin-top: .3rem;
}

/* Consent. Deliberately plain so it reads as a normal form control, but it has
   to stay unchecked by default, sit apart from the other fields, and carry the
   full disclosure inline. That is the artifact a carrier reviewer screenshots. */
.consent {
  border-top: 1px solid var(--line);
  margin-top: 1.35rem; padding-top: 1.25rem;
}
.consent-row { display: flex; gap: .65rem; align-items: flex-start; }

/* Drawn by us rather than by the UA. A carrier reviewer has to be able to tell
   at a glance that this box is empty, so the unchecked state is a hollow well
   in the same fill as the text inputs above it, and the checked state is a
   filled accent box with a tick. Nothing here depends on how a given browser
   or OS theme decides to paint a native checkbox. */
.consent-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.1rem; height: 1.1rem; margin: .16rem 0 0;
  background: var(--bg);
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  display: grid; place-content: center;
}
.consent-row input[type="checkbox"]:hover { border-color: var(--accent); }
.consent-row input[type="checkbox"]::after {
  content: "";
  width: .3rem; height: .58rem;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
  opacity: 0;
}
.consent-row input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.consent-row input[type="checkbox"]:checked::after { opacity: 1; }
.consent-row label { font-size: .875rem; line-height: 1.5; cursor: pointer; }
.consent .fine {
  color: var(--faint); font-size: .78rem; line-height: 1.5;
  margin: .55rem 0 0; padding-left: 1.65rem;
}

button.submit {
  width: 100%; margin-top: 1.35rem; padding: .7rem 1rem;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
}
button.submit:hover { background: var(--accent-hover); }
/* Only ever seen with scripting off, where the noscript notice explains the
   email fallback. It must not look pressable. */
button.submit:disabled {
  background: var(--surface-2); color: var(--faint);
  border: 1px solid var(--line); cursor: not-allowed;
}

.status {
  margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 8px;
  background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text);
  font-size: .875rem; line-height: 1.5;
}
.status:empty { display: none; }

.auth-foot {
  margin-top: 1.25rem; text-align: center;
  color: var(--faint); font-size: .8rem;
}
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--text); text-decoration: underline; }
.auth-foot .sep { margin: 0 .45rem; opacity: .5; }

/* ---------- Legal pages ---------- */

.page-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.page-header .wrap {
  display: flex; align-items: center; gap: 1rem; min-height: 3.75rem;
}
.page-header .wordmark { margin: 0 auto 0 0; text-align: left; font-size: 1rem; }
.page-nav { display: flex; gap: 1.25rem; font-size: .875rem; }
.page-nav a { color: var(--muted); text-decoration: none; }
.page-nav a:hover, .page-nav a[aria-current="page"] { color: var(--text); }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

main.legal { padding: 2.5rem 0 3rem; }
main.legal h1 { font-size: 1.7rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 .5rem; }
main.legal h2 { font-size: 1.1rem; line-height: 1.35; margin: 2rem 0 .5rem; }
main.legal h3 { font-size: .95rem; margin: 1.35rem 0 .35rem; }
main.legal p, main.legal li { color: var(--text); font-size: .95rem; line-height: 1.65; }
main.legal ul, main.legal ol { padding-left: 1.2rem; }
main.legal li { margin: .25rem 0; }
.effective { color: var(--faint); font-size: .875rem; margin: 0 0 1.75rem; }

.samples { list-style: none; padding: 0; margin: .6rem 0 0; }
.samples li {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .8rem; margin: .4rem 0;
  font-size: .875rem; color: var(--muted);
}

.page-footer {
  border-top: 1px solid var(--line); margin-top: 2.5rem;
  padding: 1.5rem 0; color: var(--faint); font-size: .82rem;
}
.page-footer .wrap { display: flex; gap: .75rem 1.25rem; flex-wrap: wrap; align-items: center; }
.page-footer a { color: var(--muted); text-decoration: none; }
.page-footer a:hover { color: var(--text); text-decoration: underline; }
.page-footer .spacer { margin-left: auto; }

@media (max-width: 32rem) {
  .auth-card { padding: 1.4rem; }
  main.legal h1 { font-size: 1.4rem; }
  .page-footer .spacer { margin-left: 0; }
}
