/* Colors are defined once as roles; dark mode swaps the values. */
:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #7d7b75;
  --border: rgba(11, 11, 11, 0.1);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 28px rgba(11, 11, 11, 0.06);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e4effc;
  --good: #0a7d0a;
  --bad: #b92f2f;
  --hero: #14161c;
  --hero-ink: #f0efec;
  --hero-muted: #a9a8a1;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242422;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #8f8d86;
    --border: rgba(255, 255, 255, 0.11);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    --accent: #5ea2f0;
    --accent-ink: #0b0b0b;
    --accent-soft: #1c2a3d;
    --good: #58c458;
    --bad: #ef7d7d;
    --hero: #101217;
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--page); color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--accent); }
button, input { font: inherit; }
.num { font-variant-numeric: tabular-nums; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: inherit; text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand small { font-weight: 500; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost { background: none; color: var(--ink-2); border: 1px solid var(--border); font-weight: 500; padding: 7px 13px; }
.error { margin-top: 12px; padding: 9px 12px; border-radius: 9px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 13.5px; }

/* ---------- Sign up / sign in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.pitch { background: var(--hero); color: var(--hero-ink); padding: 44px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; gap: 30px; }
.pitch h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; max-width: 15em; margin-top: auto; }
.pitch h1 em { font-style: normal; color: #6fb0f7; }
.pitch .lead { color: var(--hero-muted); font-size: 17px; max-width: 34em; }
.points { list-style: none; padding: 0; display: grid; gap: 12px; max-width: 34em; }
.points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--hero-ink); }
.points li::before { content: ""; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: #3987e5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.3 2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.points span { color: var(--hero-muted); }
.sample { background: #1c1f27; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 14px; padding: 16px 18px; max-width: 34em; margin-bottom: auto; }
.sample h2 { font-size: 12px; font-weight: 500; color: var(--hero-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.sample table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sample th { font-weight: 500; color: var(--hero-muted); font-size: 12px; text-align: right; padding-bottom: 6px; }
.sample td { text-align: right; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sample th:first-child, .sample td:first-child { text-align: left; }
.sample .up { color: #6fd08c; font-weight: 600; }
.sample .down { color: #f0a35e; font-weight: 600; }
.pitch footer { color: var(--hero-muted); font-size: 13px; }
.pitch footer a { color: inherit; }

.form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.form-card { width: min(400px, 100%); }
.form-card h2 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.form-card .sub { color: var(--ink-2); margin: 6px 0 22px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-2); }
.field input { padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-card .btn { width: 100%; font-size: 16px; padding: 13px; }
.fine { color: var(--muted); font-size: 13px; margin-top: 12px; text-align: center; }
.switch-mode { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; color: var(--ink-2); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .pitch { padding: 28px 20px; gap: 20px; }
  .pitch h1 { margin-top: 8px; }
  .sample { margin-bottom: 0; }
  .form-side { order: -1; padding: 28px 16px; }
}

/* ---------- Panel ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--border); background: var(--surface); }
.top .who { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; min-width: 0; }
.top .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main.panel { max-width: 1040px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 60px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px; padding: 14px 18px; }
.banner b { display: block; }
.banner span { color: var(--ink-2); font-size: 13.5px; }
.banner.ok { background: color-mix(in srgb, var(--good) 10%, transparent); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .note { color: var(--ink-2); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.clients { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
table.clients th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 0 0 8px 14px; white-space: nowrap; }
table.clients td { text-align: right; padding: 10px 0 10px 14px; border-top: 1px solid var(--border); white-space: nowrap; }
table.clients th:first-child, table.clients td:first-child { text-align: left; padding-left: 0; white-space: normal; width: 38%; }
table.clients .bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
table.clients .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
table.clients .rate { font-weight: 650; }
table.clients tr.rest td { color: var(--muted); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; margin-left: 6px; }
.steps { padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.steps b { color: var(--ink); }
.steps code { background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-size: 13.5px; user-select: all; }
.hint { color: var(--muted); font-size: 13.5px; }
.devices { display: grid; gap: 6px; }
.devices div { display: flex; justify-content: space-between; gap: 12px; }
.devices span { color: var(--muted); }
.paywall { text-align: center; padding: 44px 24px; }
.paywall h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
.paywall p { color: var(--ink-2); max-width: 32em; margin: 0 auto 20px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } }

/* Plans, inside the panel */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.plan { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan h3 { font-size: 15px; }
.plan .price { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; }
.plan ul { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 7px; color: var(--ink-2); font-size: 14px; }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan .btn { margin-top: auto; }
.plan .hint { margin-top: auto; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
