/* Customer pages (auth.html, dashboard.html). Same dark look as geokite.cloud. */
:root {
  color-scheme: dark;
  --page: #0a0a0a;
  --card: #161616;              /* chart surface (series colour validated against it) */
  --raise: #1d1d1c;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-2: rgba(255, 255, 255, 0.16);
  --series: #3987e5;
  --series-hover: #5598e7;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: "Geist", "DM Sans", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font: 500 18px/1 var(--head); color: var(--ink); text-decoration: none; }
.brand svg { width: 24px; height: 24px; }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
       border-radius: 9999px; border: 0; font: 500 15px/1 var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none;
       transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn-primary { background: #fff; color: #161616; }
.btn-primary:hover { background: #e4e4e4; }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: 0 0 0 1px var(--hairline-2) inset; }
.btn-ghost:hover { color: var(--ink); box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset; }
.btn-danger { background: transparent; color: #f08a8a; box-shadow: 0 0 0 1px rgba(208,59,59,.45) inset; }
.btn-danger:hover { background: rgba(208,59,59,.12); color: #ffb3b3; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 16px; }
.field > span:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.field > span:first-child a, .field > span:first-child em { font-style: normal; color: var(--muted); font-size: 13px; }
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 0; background: #0f0f0f; color: var(--ink);
         box-shadow: 0 0 0 1px var(--hairline-2) inset; font: 400 15px/1 var(--sans); transition: box-shadow .15s ease; }
.input:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.28) inset; }
.input:focus { outline: none; box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 0 0 4px rgba(255,255,255,.08); }
.pw { position: relative; display: block; }
.pw .input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 7px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
             color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; }
.pw button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.hint { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.alert { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(208,59,59,.12); box-shadow: 0 0 0 1px rgba(208,59,59,.4) inset; color: var(--ink); }
.alert-info { background: rgba(57,135,229,.10); box-shadow: 0 0 0 1px rgba(57,135,229,.35) inset; color: var(--ink); }
.alert-good { background: rgba(12,163,12,.10); box-shadow: 0 0 0 1px rgba(12,163,12,.4) inset; color: var(--ink); }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 24px 16px; }
.auth > header { max-width: 1040px; width: 100%; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.auth > header a.link { color: var(--ink-2); font-size: 14px; text-decoration: none; }
.auth > header a.link:hover { color: var(--ink); }
.auth-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 64px; align-items: center;
             max-width: 1040px; width: 100%; margin: 0 auto; padding: 48px 0; }
.auth-main.single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.pitch h1 { font: 500 clamp(32px, 4vw, 46px)/1.08 var(--head); letter-spacing: -0.03em; margin: 0 0 16px; }
.pitch p { color: var(--ink-2); font-size: 17px; margin: 0 0 28px; max-width: 460px; }
.pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pitch li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.pitch li svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--ink); }
.panel { background: var(--card); border-radius: 24px; padding: 32px 28px; box-shadow: 0 0 0 1px var(--hairline) inset; }
.panel h2 { font: 500 24px/1.2 var(--head); letter-spacing: -0.02em; margin: 0 0 6px; }
.panel .lead { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }
.panel .switch { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.panel .fine { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; text-align: center; }
.sent-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--raise);
             box-shadow: 0 0 0 1px var(--hairline) inset; margin-bottom: 18px; }
.sent-icon svg { width: 22px; height: 22px; }
.auth > footer { text-align: center; color: var(--muted); font-size: 13px; }
.auth > footer a { color: var(--muted); }

/* ---------- dashboard ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(10,10,10,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top nav { display: flex; align-items: center; gap: 6px; }
.top nav a.navlink { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.top nav a.navlink:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.who { color: var(--muted); font-size: 13.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font: 500 28px/1.15 var(--head); letter-spacing: -0.02em; margin: 0; }
.page-head p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
h3 { font-size: 15.5px; font-weight: 500; margin: 0; }
.sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile, .card { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--hairline) inset; min-width: 0; }
.tile { padding: 18px 20px; }
.tile .label { color: var(--ink-2); font-size: 13.5px; }
.tile .value { font: 600 30px/1.15 var(--sans); letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tile .ctx { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tile .ctx a { color: var(--ink-2); }
.bar { height: 6px; border-radius: 3px; background: rgba(57,135,229,.22); overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--series); }
.bar.hot i { background: var(--warning); }
.card { padding: 20px; margin-top: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2 > .card { margin-top: 12px; }

.reveal { background: rgba(57,135,229,.08); box-shadow: 0 0 0 1px rgba(57,135,229,.4) inset; border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.reveal h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: 500; }
.reveal p { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; }
.keybox { display: flex; gap: 8px; align-items: center; background: #0f0f0f; border-radius: 10px; padding: 6px 6px 6px 14px;
          box-shadow: 0 0 0 1px var(--hairline-2) inset; }
.keybox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 500 14px/1.6 var(--mono); color: var(--ink); }
.newkey { display: flex; gap: 8px; margin-top: 14px; }
.newkey .input { height: 38px; font-size: 14px; max-width: 280px; }
.newkey .btn { height: 38px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--hairline); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font: 400 13px/1 var(--mono); color: var(--ink); }
td.name { color: var(--ink); }
td.act { text-align: right; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; font-size: 14px; }

pre.code { margin: 0; background: #0f0f0f; border-radius: 12px; padding: 14px 16px; overflow-x: auto; box-shadow: 0 0 0 1px var(--hairline) inset;
           font: 400 13px/1.7 var(--mono); color: var(--ink-2); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 9999px; background: #0f0f0f; box-shadow: 0 0 0 1px var(--hairline) inset; }
.tabs button { border: 0; background: transparent; color: var(--ink-2); font: 500 12.5px/1 var(--sans); padding: 7px 12px; border-radius: 9999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #161616; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .vlabel { fill: var(--ink-2); font-size: 11.5px; }
.chart .hit { fill: transparent; outline: none; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: #222220; border-radius: 10px; padding: 8px 10px; min-width: 110px;
       box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 8px 24px rgba(0,0,0,.4); font-size: 12px; color: var(--ink-2); display: none; white-space: nowrap; }
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .row { display: flex; align-items: center; gap: 8px; }
.tip .row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .key { width: 12px; height: 2px; border-radius: 1px; background: var(--series); }
details.tv { margin-top: 8px; }
details.tv summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; display: inline-flex; gap: 6px; }
details.tv summary::-webkit-details-marker { display: none; }
details.tv summary::before { content: "▸"; }
details.tv[open] summary::before { content: "▾"; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.plan-opt { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: #0f0f0f; box-shadow: 0 0 0 1px var(--hairline) inset; }
.plan-opt.current { box-shadow: 0 0 0 1px rgba(57,135,229,.6) inset; background: rgba(57,135,229,.06); }
.plan-opt.wanted { box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset; }
.plan-opt .pname { font-weight: 500; color: var(--ink); }
.plan-opt .pprice { font: 600 24px/1.2 var(--sans); letter-spacing: -0.02em; }
.plan-opt .pprice small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan-opt p { margin: 0; color: var(--ink-2); font-size: 13px; }
.plan-opt p.muted { color: var(--muted); }
.plan-opt .btn { margin-top: auto; align-self: stretch; }
.plan-opt .btn[disabled] { cursor: default; opacity: .6; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.usage-box { padding: 16px; border-radius: 14px; background: #0f0f0f; box-shadow: 0 0 0 1px var(--hairline) inset; }
.usage-box .label { color: var(--ink-2); font-size: 13px; }
.usage-box .value { font: 600 22px/1.3 var(--sans); margin-top: 4px; font-variant-numeric: tabular-nums; }
.usage-box .ctx { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.cap { margin-top: 16px; }
.cap label { display: block; color: var(--ink-2); font-size: 13.5px; margin-bottom: 6px; }
.cap-row { display: flex; align-items: center; gap: 8px; }
.cap-row .input { height: 36px; max-width: 160px; font-size: 14px; }
.cap-dollar { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #f0efec; color: #161616; border-radius: 9999px;
         padding: 10px 18px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 50; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row .field { margin-bottom: 12px; }
.loading-screen { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

@media (max-width: 860px) {
  .auth-main { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 24px 0; }
  .pitch p { margin-bottom: 20px; }
  .tiles, .grid2, .usage-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .who { display: none; }
}
@media (max-width: 520px) {
  .panel { padding: 24px 18px; }
  .newkey { flex-direction: column; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .newkey .input { max-width: none; }
  .top nav a.navlink.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
