/* F32 Alert — one stylesheet, no build step. Same tokens as the F32 Dashboard
   (pmt.f32lab.space) so the sites feel like one family. Light and dark follow
   the system setting. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e0e4ea;
  --border-strong: #cbd2dc;
  --text: #141821;
  --muted: #5d6673;
  --faint: #8b94a3;

  --accent: #2f5fe0;
  --accent-soft: #e8eeff;
  --accent-text: #ffffff;

  --good: #12855f;
  --good-soft: #e2f5ee;
  --warn: #9a6400;
  --warn-soft: #fcf1dc;
  --bad: #c0362c;
  --bad-soft: #fceae8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.05);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --surface: #161a21;
    --surface-2: #1d222b;
    --border: #272d38;
    --border-strong: #3a4250;
    --text: #e7eaf0;
    --muted: #9aa4b4;
    --faint: #6d7889;

    --accent: #5f8bff;
    --accent-soft: #1a2542;
    --accent-text: #0b1020;

    --good: #46d6a1;
    --good-soft: #102c24;
    --warn: #e8b055;
    --warn-soft: #2e2415;
    --bad: #f58b80;
    --bad-soft: #331a18;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }

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

.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.stack > * + * { margin-top: 12px; }
[hidden] { display: none !important; }

/* --- layout --------------------------------------------------------------- */

.wrap { max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.topbar nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
  font: inherit;
  font-size: 0.92rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { padding: 28px 0 56px; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  height: 26px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* --- landing -------------------------------------------------------------- */

.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); max-width: 22ch; }
.hero p { margin-top: 12px; max-width: 58ch; color: var(--muted); font-size: 1.05rem; }
.hero .actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 36px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.steps h3 { margin-bottom: 4px; }

.example {
  margin-top: 24px;
  border-left: 3px solid var(--good);
}
.example .msg { white-space: pre-line; font-size: 0.93rem; margin-top: 8px; }

.section { margin-top: 12px; }
.shops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* --- forms ---------------------------------------------------------------- */

.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { margin-bottom: 18px; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 0.9rem; }

form { margin-top: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; }
.field input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field .hint { color: var(--faint); font-size: 0.82rem; margin-top: 4px; }
.field-error { color: var(--bad); font-size: 0.85rem; margin-top: 4px; }
.field-error:empty { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.65; cursor: progress; }

.notice { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.92rem; margin-top: 14px; }
.notice:empty { display: none; }
.page-notice { margin: 0 0 16px; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* --- alerts --------------------------------------------------------------- */

.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); }

.alerts { display: grid; gap: 12px; }

.alert-head { display: flex; align-items: center; gap: 10px; }
.alert-head h2 { font-size: 1.1rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge.on { background: var(--good-soft); color: var(--good); }
.badge.off { background: var(--surface-2); color: var(--faint); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px 18px;
  margin: 14px 0 0;
}
.facts div { min-width: 0; }
.facts dt { color: var(--faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }

.footnote { margin-top: 18px; color: var(--faint); font-size: 0.87rem; }

.account-grid { display: grid; gap: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.error-page { text-align: center; padding-top: 18vh; }
.error-page p { margin-top: 8px; color: var(--muted); }
.error-page .btn { margin-top: 20px; }
