/* Beta Tester Apply: shared tokens + components + public page.
   One accent (emerald), one radius system: 16px panels, 12px controls, pills only for chips and switches. */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --panel: #fcfcfd;
  --panel-2: #eceff3;
  --text: #0f1419;
  --muted: #556070;
  --line: #dde1e7;
  --field-line: #7c8794;           /* 3:1 against the page for control borders */
  --accent: #0b7a5a;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4ee;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --shadow: 0 1px 0 rgb(15 20 25 / .04), 0 28px 50px -30px rgb(15 20 25 / .22);
  --r-lg: 16px;
  --r-md: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1013;
    --panel: #151a1f;
    --panel-2: #1c2228;
    --text: #e9edf1;
    --muted: #9aa6b3;
    --line: #262e36;
    --field-line: #5b6672;
    --accent: #34c793;
    --accent-ink: #05241a;
    --accent-soft: #10261f;
    --danger: #ff8a80;
    --danger-soft: #2b1614;
    --shadow: 0 1px 0 rgb(255 255 255 / .03), 0 28px 50px -30px rgb(0 0 0 / .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.25rem; border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .15s var(--ease), filter .15s, background-color .15s, border-color .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--field-line); }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 40px; padding: 0 .9rem; font-size: .9rem; }
@media (pointer: coarse) { .btn.sm { min-height: 44px; } }
.btn.block { width: 100%; }

/* ---- chips ---- */
.chip {
  display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.4;
}
.chip.ok { background: var(--accent-soft); color: var(--accent); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }

/* ---- messages ---- */
.alert, .notice-ok { padding: .85rem 1rem; border-radius: var(--r-md); margin-bottom: 1.25rem; }
.alert { background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.notice-ok { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.alert:focus { outline: 3px solid var(--danger); }
.panel .alert { margin: 1.25rem 0 0; }

/* ---- form fields ---- */
.field { display: block; margin-top: 1.25rem; }
.lbl { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.opt { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input {
  display: block; width: 100%; min-height: 48px; padding: .7rem .9rem;
  font: 400 1rem/1.4 var(--font); color: var(--text);
  background: var(--panel); border: 1px solid var(--field-line); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 7rem; resize: vertical; }
.input::placeholder { color: var(--muted); opacity: .85; }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { display: block; margin-top: .4rem; font-size: .875rem; color: var(--muted); }
.err-msg { display: block; margin-top: .4rem; font-size: .875rem; font-weight: 500; color: var(--danger); }

/* switch: a checkbox that looks like a toggle */
.switch { display: flex; align-items: flex-start; gap: .85rem; min-height: 48px; cursor: pointer; }
.sw-track {
  position: relative; flex: none; width: 46px; height: 28px; margin-top: .1rem; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--field-line); transition: background-color .2s var(--ease), border-color .2s;
}
.sw-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .2s var(--ease), background-color .2s;
}
.switch input:checked + .sw-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .sw-track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .sw-track { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-copy { display: flex; flex-direction: column; }
.sw-copy small { color: var(--muted); font-size: .875rem; }

/* ---- public page ---- */
.pub .shell {
  max-width: 72rem; margin: 0 auto;
  padding: clamp(20px, 4vw, 56px) 16px calc(32px + env(safe-area-inset-bottom));
  display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
}
.brand { font-weight: 600; font-size: .95rem; letter-spacing: .01em; }
.intro h1 { margin-top: 1.25rem; font-size: clamp(2.1rem, 6vw + .4rem, 3.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.04; max-width: 14ch; }
.lead { margin-top: 1rem; max-width: 36ch; font-size: 1.1rem; color: var(--muted); }
.how { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 26rem; }
.how li { display: flex; flex-direction: column; }
.how strong { font-weight: 600; }
.how span { color: var(--muted); font-size: .95rem; }
.intro .how { display: none; }
.after-form .how { display: grid; margin-top: 0; }

.panel {
  --pad: clamp(20px, 3vw, 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--pad); box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.legend { display: block; margin: 0 0 .75rem; padding: 0; font-weight: 600; font-size: .95rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.apps { display: grid; gap: 10px; }
.app {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 28px; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .15s, background-color .15s, transform .2s var(--ease);
}
.app:hover { border-color: var(--field-line); }
.app:active { transform: scale(.992); }
.app:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.app:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.app-ico, .app .ph { width: 52px; height: 52px; border-radius: var(--r-md); object-fit: cover; display: block; }
.ph { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 1.3rem; }
.app-txt { display: flex; flex-direction: column; min-width: 0; }
.app-txt strong { font-weight: 600; }
.app-txt small { color: var(--muted); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--field-line); transition: background-color .15s, border-color .15s; position: relative; }
.app:has(input:checked) .tick { background: var(--accent); border-color: var(--accent); }
.app:has(input:checked) .tick::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.actions { margin-top: 1.5rem; }
.fine { margin-top: .85rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 61.99rem) {
  /* on phones the submit button stays reachable while scrolling the form */
  .actions {
    position: sticky; bottom: 0; z-index: 2;
    margin: 1.5rem calc(var(--pad) * -1) calc(var(--pad) * -1);
    padding: 1rem var(--pad) calc(1rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--panel) 78%, transparent);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }
}

.done, .empty { display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; }
.done .badge {
  position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft);
}
.done .badge::after {
  content: ""; position: absolute; left: 18px; top: 10px; width: 10px; height: 20px;
  border: solid var(--accent); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.done p, .empty p { color: var(--muted); max-width: 34ch; }

@media (min-width: 62rem) {
  .pub .shell { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; padding-top: 72px; }
  .intro { position: sticky; top: 72px; }
  .intro .how { display: grid; }
  .after-form { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .55s var(--ease) both; }
  .d1 { animation-delay: 60ms; } .d2 { animation-delay: 120ms; } .d3 { animation-delay: 180ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
}
