/* The account pages: the landing page's cockpit at night, quieter. Cyan is
   for what you touch, amber for what needs a look, green for Pro on. */
:root {
  --bg: #0b0d10;
  --panel: #121519;
  --panel-2: #171b20;
  --line: #262b32;
  --text: #e7eaee;
  --dim: #9aa3b0;
  --cyan: #3fd2f0;
  --cyan-deep: #18a9c6;
  --green: #3ce04a;
  --amber: #f2c230;
  --red: #ff6b5e;
  --radius: 12px;
  --heading: "Barlow Semi Condensed", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "B612 Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--cyan); }
h1, h2, h3 { font-family: var(--heading); line-height: 1.12; margin: 0; letter-spacing: .005em; text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0; }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Header */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg);
  max-width: 880px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 24px;
  padding-block: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; row-gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.25rem var(--heading); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  color: var(--dim); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; white-space: nowrap;
}
.tabs a:hover { color: var(--text); background: var(--panel); }
.tabs a[aria-current="page"] { color: var(--cyan); background: var(--panel-2); }

main { max-width: 880px; width: 100%; margin: 0 auto; padding-block: 32px 56px; flex: 1; outline: none; }
.foot { max-width: 880px; width: 100%; margin: 0 auto; display: flex; gap: 20px; padding-block: 20px 28px; border-top: 1px solid var(--line); font-size: .9rem; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--text); }
.loading { color: var(--dim); }

.page { display: flex; flex-direction: column; gap: 24px; }
.page > header { display: flex; flex-direction: column; gap: 6px; }
.narrow { max-width: 420px; margin: 0 auto; width: 100%; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.label { font: 700 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.badge { font: 700 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.badge.on { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); }
.badge.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

.big { font: 700 1.6rem var(--heading); }
.meter { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--cyan-deep); }
.meter.full > i { background: var(--amber); }

/* Buttons and fields */
button, .button {
  font: 600 .95rem var(--body); border-radius: 9px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s, border-color .15s, transform .1s;
}
button:hover, .button:hover { border-color: var(--dim); }
button:active, .button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; transform: none; }
.primary { background: var(--cyan); border-color: var(--cyan); color: #04212a; }
.primary:hover { background: #6fdff5; border-color: #6fdff5; }
.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: transparent; }
.danger.solid { background: var(--red); color: #2a0703; border-color: var(--red); }
.link { background: none; border: 0; padding: 0; color: var(--cyan); font-weight: 500; }
.small { padding: 6px 11px; font-size: .85rem; }
.wide { width: 100%; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--dim); }
input {
  font: 500 1rem var(--body); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; width: 100%;
}
input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 22%, transparent); }
input.code { font: 700 1.6rem var(--mono); letter-spacing: .45em; text-align: center; padding-left: calc(13px + .45em); }
form { display: flex; flex-direction: column; gap: 14px; }
.error { color: var(--red); font-size: .92rem; }
.note { color: var(--dim); font-size: .9rem; }
.ok { color: var(--green); }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.providers { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.providers .gsi { display: flex; justify-content: center; min-height: 44px; }
.apple { background: #fff; color: #000; border-color: #fff; }
.apple:hover { background: #e9e9e9; border-color: #e9e9e9; }

/* Devices */
.devices { display: flex; flex-direction: column; }
.device { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; }
.device .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--cyan); }
.device .ico svg { width: 22px; height: 22px; }
.device .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.device .name { font-weight: 600; overflow-wrap: anywhere; }
.device .meta { color: var(--dim); font-size: .88rem; }
.device .confirm { grid-column: 1 / -1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.device form { flex-direction: row; gap: 8px; }
.device form input { padding: 7px 10px; }
.choice { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice input { width: auto; accent-color: var(--cyan); }
.choice:has(input:checked) { border-color: var(--cyan); }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.plan.best { border-color: var(--cyan); }
.plan .price { font: 700 1.7rem var(--heading); font-variant-numeric: tabular-nums; }
.plan .per { color: var(--dim); font-weight: 400; font-size: .88rem; }
.plan .tag { position: absolute; top: -10px; right: 12px; font: 700 .68rem var(--mono); letter-spacing: .08em; background: var(--cyan); color: #04212a; padding: 3px 8px; border-radius: 99px; }
.feats { margin: 0; padding-left: 20px; color: var(--dim); display: grid; gap: 4px; }

.history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.history li:first-child { border-top: 0; }
.linkcode { font: 700 2rem var(--mono); letter-spacing: .2em; text-align: center; text-transform: uppercase; }

@media (max-width: 640px) {
  h1 { font-size: 1.65rem; }
  main { padding-block: 22px 40px; }
  .plans { grid-template-columns: 1fr; }
  .bar { gap: 12px; }
  .tabs { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
main:focus, main:focus-visible { outline: none; }
