/* ============================================================================
   Command Fleet — account/marketing site styles.
   Dark, local-first product feel. The markup is driven by app.js, which toggles
   the .hidden / .active classes and the .badge premium|free classes — those
   class hooks and all element IDs must stay intact.
   ========================================================================== */

:root {
  --bg-0: #05070e;
  --bg-1: #0a0f1c;
  --bg-2: #111a2e;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eaf0fb;
  --muted: #9aa7c4;
  --faint: #6b7795;
  --brand: #3b82f6;
  --brand-2: #7aa9ff;
  --brand-ink: #fff;
  --good: #34d399;
  --bad: #fb7185;
  --radius: 18px;
  --radius-sm: 11px;
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.32);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

::selection { background: rgba(59, 130, 246, 0.32); color: #fff; }
:root { accent-color: var(--brand); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

/* Themed scrollbar so the dark surface doesn't get a bright default track. */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: content-box; }

/* Visible only for keyboard users — keeps the mouse UI clean. */
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline-offset: 3px; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(59, 130, 240, 0.22), transparent 60%),
    radial-gradient(820px 540px at 92% 4%, rgba(122, 90, 248, 0.16), transparent 58%),
    radial-gradient(1200px 700px at 50% 120%, rgba(59, 130, 240, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0.08));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.brand-name { font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-tag {
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
}
@media (max-width: 640px) { .topbar-tag { display: none; } }

/* ---------- layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.view { width: 100%; }
.hidden { display: none !important; }

.auth-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; gap: 34px; }
}

/* ---------- hero ---------- */
.hero { animation: rise 0.6s var(--ease) both; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin: 0 0 16px;
  max-width: 16ch;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand-2), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { font-size: clamp(16px, 2vw, 19px); color: var(--text); margin: 0 0 14px; font-weight: 500; }
.blurb { color: var(--muted); margin: 0 0 26px; max-width: 52ch; }

/* ---------- feature list ---------- */
.features { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 16px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.feat-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.06));
  border: 1px solid var(--line-strong);
  color: var(--brand-2);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.features li:hover .feat-icon {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 18px -10px rgba(59, 130, 246, 0.7);
}
.feat-icon svg { width: 19px; height: 19px; }
.features strong { display: block; font-weight: 600; font-size: 15px; }
.features span { color: var(--muted); font-size: 14px; }

.agent-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.auth-card {
  animation: rise 0.6s var(--ease) 0.08s both;
  background:
    radial-gradient(80% 55% at 50% 0%, rgba(59, 130, 246, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}
.auth-card-head { margin-bottom: 20px; }
.auth-card-head h2 { margin: 0 0 4px; font-size: 22px; }
.account-card { max-width: 540px; margin: 0 auto; animation: rise 0.5s var(--ease) both; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(180deg, var(--brand), #2f63d6);
  color: var(--brand-ink);
  box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.7);
}

/* ---------- forms ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 16px 0 7px;
}
.field { position: relative; display: flex; align-items: center; }
.field-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  pointer-events: none;
  transition: color 0.18s var(--ease);
}
input {
  width: 100%;
  padding: 12px 13px 12px 40px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
input::placeholder { color: var(--faint); }
input:hover { border-color: rgba(255, 255, 255, 0.2); }
input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: var(--ring);
}
.field:focus-within .field-icon { color: var(--brand-2); }

/* Kill the browser's autofill tint — the UA paints it via background-color with
   high priority and ignores `background`/`color`, so we cover it with a full-size
   inset shadow and force the text fill colour. The long transition keeps the UA
   from re-tinting it.
   NOTE: WebKit (`:-webkit-autofill`) and the standard (`:autofill`) pseudo-classes
   MUST stay in separate rules — an engine that doesn't know one selector throws
   out the whole comma list, which is why Firefox kept showing the yellow. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: inset 0 0 0 100px #0a0e18;
  box-shadow: inset 0 0 0 100px #0a0e18;
  caret-color: var(--text);
  border-color: var(--line-strong);
  transition: background-color 100000s ease-in-out 0s,
              border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 100px #0a0e18, var(--ring);
  box-shadow: inset 0 0 0 100px #0a0e18, var(--ring);
  border-color: var(--brand);
}
input:autofill,
input:autofill:hover,
input:autofill:focus,
input:autofill:active {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 100px #0a0e18;
  caret-color: var(--text);
  border-color: var(--line-strong);
  transition: background-color 100000s ease-in-out 0s,
              border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
input:autofill:focus {
  box-shadow: inset 0 0 0 100px #0a0e18, var(--ring);
  border-color: var(--brand);
}

/* ---------- buttons ---------- */
button.primary {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: var(--brand-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(59, 130, 246, 0.75);
  transition: transform 0.15s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}
button.primary:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 16px 30px -10px rgba(59, 130, 246, 0.85); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

button.ghost {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 8px 15px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
button.ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); }

.error { color: var(--bad); font-size: 13px; margin: 12px 0 0; min-height: 1em; font-weight: 500; }
.auth-foot { margin: 18px 0 0; text-align: center; }

/* ---------- account ---------- */
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.26), rgba(59, 130, 246, 0.07));
  border: 1px solid var(--line-strong);
  color: var(--brand-2);
}
.avatar svg { width: 24px; height: 24px; }
.account-head h2 { margin: 0; font-size: 21px; }
.account-head .muted { margin: 2px 0 0; }

.kv {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px 16px;
  align-items: center;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.kv dt { color: var(--faint); font-size: 13px; font-weight: 600; }
.kv dd { margin: 0; font-size: 15px; word-break: break-all; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.premium { background: rgba(52, 211, 153, 0.14); color: var(--good); border: 1px solid rgba(52, 211, 153, 0.4); }
.badge.free { background: rgba(154, 167, 196, 0.12); color: var(--muted); border: 1px solid var(--line-strong); }

.download-block { margin-top: 22px; }
.download-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.download-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.06));
  border: 1px solid var(--line-strong);
  color: var(--brand-2);
}
.download-icon.locked {
  background: rgba(154, 167, 196, 0.1);
  color: var(--faint);
}
.download-icon svg { width: 21px; height: 21px; }
.download-block h3 { margin: 0 0 4px; font-size: 17px; }
.download-block .muted { margin: 0; }
.download-block.locked {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
}
.status { margin-top: 12px; min-height: 1em; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- spinner ---------- */
#loading-view { display: flex; justify-content: center; padding: 90px 0; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 18px clamp(16px, 4vw, 34px);
  color: var(--faint);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.foot-brand img { opacity: 0.85; }

/* ---------- accessibility: respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
