/* Lexis status page. Tokens copied from Lexis (src/redesign/theme/tokens.css,
   docs/design/LEXIS_DESIGN_GUIDE.md section 2); dark values follow the system theme. */

:root {
  --bg: #f3f3f5;
  --surface: #ffffff;
  --well: #f6f6f8;
  --line-soft: #f0f0f2;
  --line: #ebebee;
  --line-strong: #e3e3e6;
  --control: #c4c4c9;
  --ink: #14142e;
  --text1: #4b4b50;
  --text2: #6b6b70;
  --muted: #9a9aa0;
  --primary: #17171c;
  --primary-hover: #33333a;
  --on-primary: #ffffff;
  --accent: #4868c8;
  --accent-strong: #3a55b0;
  --accent-tint: #ecf0fb;
  --ok: #2f8a5b;
  --ok-tint: #e3f3ea;
  --ok-line: #c6e5cf;
  --warn: #d9a52a;
  --warn-text: #6b5a2e;
  --warn-tint: #fbf4e4;
  --warn-line: #efdfae;
  --danger: #c2452d;
  --danger-tint: #fdf0ee;
  --danger-line: #f1c9c2;
  --none: #e3e3e6;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216;
    --surface: #1c1c22;
    --well: #24242b;
    --line-soft: #2a2a32;
    --line: #2e2e36;
    --line-strong: #36363f;
    --control: #3f3f49;
    --ink: #f0f0f4;
    --text1: #c6c6ce;
    --text2: #a6a6b0;
    --muted: #7f7f8a;
    --primary: #e8e8ee;
    --primary-hover: #d2d2da;
    --on-primary: #121216;
    --accent: #7b95e6;
    --accent-strong: #93aaf0;
    --accent-tint: #1f2540;
    --ok: #4fb57f;
    --ok-tint: #153223;
    --ok-line: #1f4a31;
    --warn: #e5b94a;
    --warn-text: #dcc389;
    --warn-tint: #3a3020;
    --warn-line: #5a4a22;
    --danger: #e0705a;
    --danger-tint: #3a1f1c;
    --danger-line: #5a2e28;
    --none: #36363f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.tabular { font-variant-numeric: tabular-nums; }

/* Layout */
.page { max-width: 880px; margin: 0 auto; padding: 28px 16px 48px; }
.stack > * + * { margin-top: 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; overflow: hidden; position: relative; flex: none; }
.brand-mark img { position: absolute; width: 190%; height: 190%; left: -45%; top: -47%; }
.brand-mark .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand-mark .on-light { display: none; }
  .brand-mark .on-dark { display: block; }
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { color: var(--text2); font-weight: 500; }
.top-link { font-size: 12.5px; }

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h2 { font-size: 14px; font-weight: 700; margin: 0; }
.subtitle { color: var(--text2); margin: 6px 0 0; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.meta { font-size: 11.5px; color: var(--text2); }
.secondary { font-size: 12.5px; color: var(--text2); }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* Overall banner: a toned card, the word always next to the dot. */
.banner { display: flex; align-items: center; gap: 12px; padding: 18px; }
.banner h1 { font-size: 20px; }
.banner.tone-ok { background: var(--ok-tint); border-color: var(--ok-line); }
.banner.tone-warn { background: var(--warn-tint); border-color: var(--warn-line); }
.banner.tone-danger { background: var(--danger-tint); border-color: var(--danger-line); }
.banner.tone-accent { background: var(--accent-tint); border-color: var(--line-strong); }
.banner .dot { width: 12px; height: 12px; }

/* Status dot + word */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); flex: none; }
.tone-ok .dot, .dot.tone-ok { background: var(--ok); }
.tone-warn .dot, .dot.tone-warn { background: var(--warn); }
.tone-danger .dot, .dot.tone-danger { background: var(--danger); }
.tone-accent .dot, .dot.tone-accent { background: var(--accent); }
.status.tone-ok { color: var(--ok); }
.status.tone-warn { color: var(--warn-text); }
.status.tone-danger { color: var(--danger); }
.status.tone-accent { color: var(--accent); }
.status.tone-muted { color: var(--text2); }

/* Components with their 90-day history */
.component { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.component:first-of-type { border-top: 0; padding-top: 0; }
.component-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.component-name { font-weight: 600; }
.bars { display: flex; gap: 2px; height: 32px; margin: 10px 0 6px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--none); }
.bar.tone-ok { background: var(--ok); }
.bar.tone-warn { background: var(--warn); }
.bar.tone-danger { background: var(--danger); }
.bar:hover { opacity: 0.75; }
.bars-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.bars-legend .uptime { color: var(--text2); }
.range-short { display: none; }

/* Narrow screens: last 30 days only, so bars stay tappable. */
@media (max-width: 600px) {
  .bar.old { display: none; }
  .range-long { display: none; }
  .range-short { display: inline; }
  h1 { font-size: 24px; }
}

/* Incidents */
.incident { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.incident:first-of-type { border-top: 0; padding-top: 0; }
.incident-title { font-weight: 600; color: var(--ink); }
.incident-title:hover { color: var(--ink); }
.updates { list-style: none; margin: 10px 0 0; padding: 0; }
.updates li { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.updates li:first-child { border-top: 0; }
.update-state { font-weight: 700; }
.update-message { white-space: pre-line; }
@media (max-width: 600px) {
  .updates li { grid-template-columns: 1fr; }
}

.empty { color: var(--text2); }

.maintenance { background: var(--well); border-radius: 10px; padding: 10px 12px; }
.maintenance + .maintenance { margin-top: 8px; }

.footer { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }

/* Sign-in page */
.signin { max-width: 380px; margin: 10vh auto 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
}
.button:hover { background: var(--primary-hover); color: var(--on-primary); text-decoration: none; }
.button.secondary-button { background: var(--surface); color: var(--ink); border-color: var(--control); }
.button.secondary-button:hover { background: var(--well); color: var(--ink); }
.field { display: block; margin-top: 12px; }
.field span { display: block; font-size: 12px; line-height: 18px; color: var(--text1); margin-bottom: 4px; }
.field input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--control);
  background: var(--surface); color: var(--ink); font: inherit;
}
.error { color: var(--danger); background: var(--danger-tint); border: 1px solid var(--danger-line); border-radius: 10px; padding: 8px 10px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
