/* ============================================================================
   Capture account portal.

   Restrained pro-tool dark UI: neutral near-black, one brand accent used
   sparingly, real typographic hierarchy. Gold is LeRobotBooth's mark and is
   reserved for the brand and the licence key itself. Everything else earns
   attention through spacing and weight, not colour.
   ========================================================================== */

:root {
  /* Surfaces, neutral rather than blue so gold stays clean against them */
  --bg:        #0a0a0b;
  --bg-raised: #0f1012;
  --surface:   #131417;
  --surface-2: #191a1e;
  --line:      rgba(255,255,255,0.07);
  --line-firm: rgba(255,255,255,0.12);

  /* Type */
  --fg:      #f4f4f5;
  --fg-mid:  #a1a1aa;
  --fg-dim:  #71717a;

  /* Brand + semantics */
  --gold:      #ffd700;
  --gold-dim:  rgba(255,215,0,0.10);
  --gold-line: rgba(255,215,0,0.24);
  --ok:   #4ade80;
  --warn: #fbbf24;
  --bad:  #f87171;

  /* 4px scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --shell: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  /* One very soft warm bloom behind the header. Depth without a glow effect. */
  background-image: radial-gradient(1100px 520px at 50% -320px, rgba(255,215,0,0.055), transparent 70%);
  background-repeat: no-repeat;
  font: 400 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0;
}
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; }
p  { margin: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--fg); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--s5); }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,11,0.75);
  backdrop-filter: saturate(150%) blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .shell { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #ffe98a, var(--gold) 55%, #c9a400);
  color: #16130a; font-weight: 700; font-size: 14px; letter-spacing: -0.04em;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.brand-sub  { color: var(--fg-dim); font-weight: 400; font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: var(--s3); font-size: 13px; color: var(--fg-mid); }
.user-email { max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Page header ───────────────────────────────────────────────────────── */
.page-head { padding: var(--s7) 0 var(--s6); }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: var(--s3);
}
.lede { color: var(--fg-mid); margin-top: 10px; font-size: 15.5px; max-width: 58ch; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); padding-bottom: var(--s8); }
.span-2 { grid-column: 1 / -1; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  display: flex; flex-direction: column;
}
/* A single hairline of light along the top edge. Reads as a physical panel. */
.card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09) 22%, rgba(255,255,255,0.09) 78%, transparent);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s4);
}
.card-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim);
}

/* ── Status ────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--fg-mid); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok   { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad  { color: var(--bad); }
.badge.flat { color: var(--fg-dim); }
.badge.flat::before { display: none; }

.seat {
  font-size: 12px; font-weight: 500; color: var(--fg-mid);
  border: 1px solid var(--line-firm); border-radius: 999px; padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}

/* ── Headline figure (plan) ────────────────────────────────────────────── */
.headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s5); }
.headline .name { font-family: 'Space Grotesk', sans-serif; font-size: 25px; font-weight: 600; letter-spacing: -0.025em; }
.headline .price { color: var(--fg-mid); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ── Data rows ─────────────────────────────────────────────────────────── */
dl { margin: 0; }
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.row:first-child { border-top: 0; padding-top: 0; }
.row dt { color: var(--fg-dim); margin: 0; }
.row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 14px/1 Inter, sans-serif; white-space: nowrap;
  padding: 10px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line-firm); background: var(--surface-2); color: var(--fg);
  transition: background .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}
.btn:hover { background: #212227; border-color: rgba(255,255,255,0.2); }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--surface-2); border-color: var(--line-firm); }

/* Primary is light-on-dark. Gold stays the brand, not a call to action. */
.btn-primary { background: var(--fg); border-color: var(--fg); color: #0a0a0b; font-weight: 600; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-danger { color: var(--bad); border-color: rgba(248,113,113,0.28); background: transparent; }
.btn-danger:hover { background: rgba(248,113,113,0.09); border-color: rgba(248,113,113,0.45); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-mid); padding-inline: 8px; }
.btn-ghost:hover { background: transparent; border-color: transparent; color: var(--fg); }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-block { width: 100%; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s5); }
.card > .actions:first-child { padding-top: 0; }

/* ── Licence key ───────────────────────────────────────────────────────── */
.keybox {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,215,0,0.055), rgba(255,215,0,0.02));
  border: 1px solid var(--gold-line); border-radius: var(--r);
  padding: var(--s4) var(--s5);
}
.keybox code {
  flex: 1 1 280px; min-width: 0;
  font: 600 22px/1.35 ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.13em; color: var(--gold);
  word-break: break-all; -webkit-user-select: all; user-select: all;
}
.hint { color: var(--fg-dim); font-size: 13px; margin-top: var(--s3); }

/* ── Device ────────────────────────────────────────────────────────────── */
.device-name { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: var(--s4); }

/* ── Pricing ───────────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.plan {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s5); background: var(--bg-raised);
  display: flex; flex-direction: column; gap: var(--s3);
}
.plan.featured { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(255,215,0,0.05), transparent 60%), var(--bg-raised); }
.plan-term { font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--fg-dim); }
.plan-price { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.plan-per { color: var(--fg-dim); font-size: 13.5px; font-weight: 400; letter-spacing: 0; }
.plan-note { color: var(--fg-mid); font-size: 13px; min-height: 1.55em; }
.tag {
  position: absolute; top: var(--s4); right: var(--s4);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #16130a; background: var(--gold); padding: 3px 8px; border-radius: 999px;
}

.feature-list { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: 9px; }
.feature-list li { position: relative; padding-left: 22px; font-size: 14px; color: var(--fg-mid); }
.feature-list li::before {
  content: ''; position: absolute; left: 3px; top: 7px; width: 9px; height: 5px;
  border-left: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(-45deg);
}

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--s4); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--fg-mid); margin-bottom: 7px; }
input {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm);
  color: var(--fg); background: var(--bg); border: 1px solid var(--line-firm);
  font: 400 15px Inter, sans-serif; transition: border-color .14s, box-shadow .14s;
}
input::placeholder { color: var(--fg-dim); }
input:focus { outline: none; border-color: rgba(255,215,0,0.5); box-shadow: 0 0 0 3px rgba(255,215,0,0.10); }

/* ── Messages ──────────────────────────────────────────────────────────── */
.msg {
  margin: 0 0 var(--s5); padding: 12px 15px; border-radius: var(--r-sm);
  font-size: 13.5px; border: 1px solid var(--line-firm); background: var(--surface); color: var(--fg-mid);
}
.msg.err { color: #fecaca; background: rgba(248,113,113,0.07); border-color: rgba(248,113,113,0.28); }
.msg.ok  { color: #bbf7d0; background: rgba(74,222,128,0.07); border-color: rgba(74,222,128,0.28); }
form .msg { margin: var(--s4) 0 0; }

/* ── Loading ───────────────────────────────────────────────────────────── */
.loading { display: grid; gap: var(--s4); padding-bottom: var(--s8); }
.bar { height: 96px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.035), transparent);
  animation: sweep 1.4s ease-in-out infinite;
}
.bar:nth-child(2) { height: 132px; }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ── Footer ────────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); }
.foot .shell { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; padding-block: var(--s5); color: var(--fg-dim); font-size: 13px; }
.foot a:hover { color: var(--fg); }
.foot .spacer { margin-left: auto; }

/* ── Legal ─────────────────────────────────────────────────────────────── */
.legal { max-width: 68ch; padding-bottom: var(--s8); }
.legal h2 { font-size: 17px; margin: var(--s6) 0 var(--s3); }
.legal p, .legal li { color: var(--fg-mid); margin-bottom: var(--s3); }
.legal ul { padding-left: 20px; }
.legal li::marker { color: var(--fg-dim); }

[hidden] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .page-head { padding: var(--s6) 0 var(--s5); }
  .shell { padding: 0 var(--s4); }
  .keybox code { font-size: 18px; letter-spacing: 0.1em; }
}
@media (max-width: 560px) {
  .brand-sub, .user-email { display: none; }
  .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* An anchor with no href is not clickable, so it must not look clickable.
   Used by the download card until captureConfig/release exists. */
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
