/* =============================================================================
   Semaphore app shell — shared by login.html and dashboard.html
   Tokens, type, buttons, inputs. Same palette and rules as the marketing page:
   hairlines and bands instead of bordered cards, one accent action per view.
   ============================================================================= */

:root {
  --bg: #faf9f6;
  --fg: #1c2019;
  --muted: #5e6455;
  --accent: #df4a25;
  --on-accent: #fff;
  --panel: #eeeede;
  --surface: #fffff6;
  --line: #d3d6c4;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --bad: #c74224;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Instrument Sans Variable", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #111310;
  --fg: #eff1e5;
  --muted: #bbc3a9;
  --accent: #f28e62;
  --on-accent: #22150f;
  --panel: #1b1f17;
  --surface: #171a15;
  --line: #3a4033;
  --ok: #8fd3a5;
  --warn: #e3b561;
  --bad: #ffa895;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.24s, color 0.24s;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
svg { display: block; }
.lucide { stroke-width: 1.75px; }
.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;
}

/* ---- Brand ---- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}
.logo svg { width: 20px; height: 24px; color: var(--accent); }

/* ---- Type helpers ---- */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b { font-weight: 500; color: var(--fg); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease), transform 0.24s var(--ease), opacity 0.2s;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover { background: var(--accent); color: var(--on-accent); }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 84%, #000); }
.btn-soft { background: var(--panel); color: var(--fg); }
.btn-soft:hover { background: color-mix(in srgb, var(--panel) 70%, var(--line)); color: var(--fg); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 15px; padding: 0 28px; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13px; }
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  color: inherit;
  transition: color 0.2s var(--ease);
}
.link svg { transition: transform 0.3s var(--ease); }
.link:hover { color: var(--accent); }
.link:hover svg { transform: translate(2px, -2px); }
.link-muted { color: var(--muted); font-weight: 500; }
.link-muted:hover { color: var(--fg); }

/* ---- Fields (underline style, like the marketing configurator) ---- */
.field { display: block; min-width: 0; }
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.field-label .link { font-size: 12px; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 16px;
  transition: border-color 0.24s var(--ease);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:hover { border-bottom-color: color-mix(in srgb, var(--fg) 40%, var(--line)); }
.input:focus-visible { outline: none; border-bottom-color: var(--fg); }
.input[aria-invalid="true"] { border-bottom-color: var(--bad); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 40px; }
.input-wrap > button, .input-wrap > svg {
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted);
}
.input-wrap > button { padding: 8px; }
.input-wrap > button:hover { color: var(--fg); }
.select { position: relative; }
.select select {
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 8px 32px 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.24s var(--ease);
}
.select select:hover, .select select:focus-visible { outline: none; border-bottom-color: var(--fg); }
.select svg { position: absolute; right: 2px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--muted); }
.hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.hint.is-error { color: var(--bad); }

/* ---- Option rows (radio choices with an underline indicator) ---- */
.opts { display: grid; gap: 24px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-body {
  display: block;
  height: 100%;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 transparent;
  transition: box-shadow 0.3s var(--ease);
}
.opt-name {
  display: block;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.015em;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.opt-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.opt:hover .opt-name { color: var(--fg); }
.opt input:checked + .opt-body { box-shadow: inset 0 -2px 0 var(--fg); }
.opt input:checked + .opt-body .opt-name { color: var(--fg); }
.opt input:focus-visible + .opt-body { outline: 2px solid var(--accent); outline-offset: 6px; }
.opt input:disabled + .opt-body { opacity: 0.4; }

/* ---- Icon buttons ---- */
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--panel); color: var(--fg); }

/* ---- Theme toggle (same as the marketing header) ---- */
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---- Toasts ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 20px;
  z-index: 50;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), translate 0.4s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
