/* Shared look for the sign-in, account and admin pages (matches the Journey Board). */
:root {
  --bg: #ECEFF4; --surface: #FFFFFF; --surface-2: #E1E6EE; --ink: #18202E; --muted: #5B6676; --line: #C7CFDB;
  --past: #56668A; --present: #C98412; --future: #13887A; --future-soft: rgba(19, 136, 122, .13);
  --present-soft: rgba(201, 132, 18, .14); --warn: #B43C3C; --warn-soft: rgba(180, 60, 60, .1); --ok: #2F8A4E;
  --shadow: 0 6px 18px rgba(24, 32, 46, .10);
  --hill-1: #DBE8D2; --hill-2: #E2EDDA; --hill-3: #E8F0E2;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141B; --surface: #192029; --surface-2: #232B37; --ink: #E4E8EF; --muted: #96A1B3; --line: #333D4C;
    --past: #8F9EC2; --present: #EDB045; --future: #3DC3B0; --future-soft: rgba(61, 195, 176, .14);
    --present-soft: rgba(237, 176, 69, .14); --warn: #F07A72; --warn-soft: rgba(240, 122, 114, .12); --ok: #5CC47F;
    --shadow: 0 8px 22px rgba(0, 0, 0, .45); --hill-1: #18222A; --hill-2: #161F27; --hill-3: #141C23;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141B; --surface: #192029; --surface-2: #232B37; --ink: #E4E8EF; --muted: #96A1B3; --line: #333D4C;
  --past: #8F9EC2; --present: #EDB045; --future: #3DC3B0; --future-soft: rgba(61, 195, 176, .14);
  --present-soft: rgba(237, 176, 69, .14); --warn: #F07A72; --warn-soft: rgba(240, 122, 114, .12); --ok: #5CC47F;
  --shadow: 0 8px 22px rgba(0, 0, 0, .45); --hill-1: #18222A; --hill-2: #161F27; --hill-3: #141C23;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--future); outline-offset: 2px; }
a { color: var(--future); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; margin: 0; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Logo: the three journey shapes */
.marks { display: inline-flex; gap: 4px; align-items: center; }
.marks i { width: 10px; height: 10px; display: block; }
.marks i:nth-child(1) { background: var(--past); border-radius: 2px; }
.marks i:nth-child(2) { background: var(--present); transform: rotate(45deg) scale(.85); }
.marks i:nth-child(3) { background: var(--future); border-radius: 50%; }
.brand { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }

/* Top bar on account and admin pages */
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.top nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.who { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
main.page { max-width: 980px; margin: 0 auto; padding: 22px 16px 60px; display: grid; gap: 18px; }

/* Buttons and fields */
.btn { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; min-height: 44px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.field { display: grid; gap: 5px; font-weight: 500; font-size: 14px; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=email], input[type=password], input[type=text], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--future); outline: none; box-shadow: 0 0 0 3px var(--future-soft); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 180px; width: auto; }
.row > select { flex: 0 1 170px; width: auto; }
.tbl select { width: auto; min-height: 34px; padding: 4px 8px; }
details.panel > summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 18px; list-style-position: inside; }
details.panel:not([open]) { gap: 0; }
form.stack, .stack { display: grid; gap: 14px; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head .btn { margin-left: auto; }
.msg { border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.msg.err { background: var(--warn-soft); color: var(--warn); }
.msg.ok { background: var(--future-soft); color: var(--ink); }
.msg.note { background: var(--present-soft); color: var(--ink); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.admin { background: var(--future-soft); color: var(--future); }
.pill.pending { background: var(--present-soft); color: var(--present); }
.pill.off { background: var(--warn-soft); color: var(--warn); }

/* Tables become stacked rows on phones */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.act { text-align: right; white-space: nowrap; }
.tbl td.act .btn + .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { border: 0; padding: 3px 0; }
  .tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .tbl td.act { text-align: left; padding-top: 6px; }
}
.empty { color: var(--muted); font-size: 14px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--future); }
.tabs .count { background: var(--present); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-left: 4px; }

/* Copyable link box */
.linkbox { display: grid; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 12px; }
.linkbox code { font-size: 13px; overflow-wrap: anywhere; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }

/* Sign-in page: card over light hills */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; position: relative; overflow: hidden; }
.auth .hills { position: fixed; inset: auto 0 0 0; width: 100%; height: 45vh; pointer-events: none; }
.auth-card { position: relative; width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px 24px; display: grid; gap: 18px; }
.auth-card .tabs { margin-top: -4px; }
.choice { display: grid; gap: 8px; }
.choice label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--future); background: var(--future-soft); }
.choice input { margin: 3px 0 0; grid-row: span 2; accent-color: var(--future); }
.choice b { font-weight: 600; }
.choice span { color: var(--muted); font-size: 13px; grid-column: 2; }
