/* ============================================================
   WeatherStudioPRO — Download Portal
   Matches admin portal visual style exactly.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Navy / dark system (matches marketing site + signup) */
  --bg:       #010206;
  --navy:     #02050E;
  --surface:  #0A1120;
  --surface2: #0E1626;
  --panel-hi: #141F35;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);

  /* Brand orange system */
  --accent:      #FF7A00;
  --accent-hi:   #FFB347;
  --accent-glow-c:#FF8C00;
  --accent2:     #FF5500;
  --amber:       #FFD060;
  --accent-glow: rgba(255,122,0,0.55);

  /* Metallic silver (wordmark) */
  --silver:   #B4BAC4;
  --silver-2: #9AA3B0;

  /* Text */
  --text:     #E3E9F2;
  --text2:    #AEB9C9;
  --muted:    rgba(180,195,215,0.58);
  --success:  #22c55e;
  --danger:   #ef4444;
  --shadow:   0 24px 60px rgba(0,0,0,0.55);

  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mark: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  --transition: 0.2s cubic-bezier(.16,.84,.44,1);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background for the logged-in app (matches marketing site) */
.page-wrap::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(255,122,0,.10), transparent 60%),
    radial-gradient(1000px 800px at 10% 20%, rgba(30,90,180,.10), transparent 55%),
    linear-gradient(180deg,#050912 0%, var(--navy) 40%, var(--bg) 100%);
}
.page-wrap::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 30%,#000 20%,transparent 80%);
}
::selection { background: var(--accent); color:#0a0400; }

/* ---- Wordmark shared (Barlow Condensed, silver + glowing orange) ---- */
.wm-name {
  font-family: var(--font-mark);
  font-weight: 800;
  font-style: italic;
  color: var(--silver);
  letter-spacing: -0.5px;
  transform: scaleX(0.9);
  transform-origin: left center;
  display: inline-block;
  margin-right: -3px;
}
.wm-pro {
  font-family: var(--font-mark);
  font-weight: 900;
  font-style: italic;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
  letter-spacing: -0.5px;
  transform: scaleX(0.9);
  transform-origin: left center;
  display: inline-block;
}

/* ---- Login screen ---- */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 78% 10%, rgba(255,122,0,0.14), transparent 60%),
    linear-gradient(rgba(3,6,14,0.70), rgba(3,6,14,0.78)),
    url('portal-bg.jpg');
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: linear-gradient(180deg, rgba(14,22,38,0.92), rgba(10,17,32,0.92));
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 40px 44px;
  width: 400px;
  max-width: 96vw;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,122,0,0.06), 0 0 80px rgba(255,120,0,0.08);
  backdrop-filter: blur(10px) saturate(130%);
}
.login-logo {
  text-align: left;
  margin-bottom: 28px;
}
.login-logo .logo-circle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #e06000, #FF7A00);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
}
.admin-login-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
  margin-bottom: 6px;
}
/* The wordmark must read as ONE word: WeatherStudioPRO.
   .wm-name is scaleX(0.9) with transform-origin:left. Transforms don't affect
   layout, so "PRO" is positioned at the name's untransformed right edge while
   the glyphs are painted 10% narrower -- leaving a visible hole that reads as
   "WeatherStudio PRO". Scaling the whole wordmark once on the parent (instead
   of each half separately) removes the seam, so the two halves sit flush. */
.admin-login-wordmark { transform: scaleX(0.9); transform-origin: left center; }
.admin-login-wordmark .wm-name,
.admin-login-wordmark .wm-pro {
  transform: none;   /* scaled once by the parent, so no internal seam */
}
.admin-login-wordmark .wm-name { font-size: 44px; margin-right: 0; }
.admin-login-wordmark .wm-pro  {
  font-size: 44px;
  text-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(255,100,0,0.2);
}
.admin-login-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-hi);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 500;
}
.login-logo p { font-size: 12px; color: var(--muted); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 38px; }
.input-icon-right {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}
.login-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }

/* -- Two-factor step (pre-login) --------------------------------------------
   #login-mfa is hidden by default and revealed with .show, mirroring the
   admin console so the two login screens stay recognisably the same product. */
#login-mfa { display: none; }
#login-mfa.show { display: block; }

.mfa-step-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Wide tracking makes a 6-digit code readable at a glance and discourages
   typing anything longer into it. */
.mfa-code-input {
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.42em;
  text-align: center;
  padding-left: 12px;
  /* letter-spacing adds a trailing gap after the last glyph; nudge it back
     so the digits read as optically centred rather than shifted left. */
  text-indent: 0.42em;
}

.mfa-recovery-input {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mfa-login-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.mfa-alt-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s ease;
}
.mfa-alt-link:hover { color: var(--accent-hi); }

.mfa-warn {
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.32);
  color: #fcd9a0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}
.mfa-warn strong { color: #ffe4b5; }

/* Low-recovery-code warning shown after a successful recovery-code sign-in. */
.mfa-recovery-warn {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.34);
  color: #fcd9a0;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ---- Layout ---- */
.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  background: rgba(4,7,15,.82);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  line-height: 1;
}
/* Topbar wordmark must read as ONE word: WeatherStudioPRO.
   Same fix as .admin-login-wordmark: the shared .wm-name/.wm-pro rules scale
   each half by scaleX(0.9) from a left origin. Transforms don't affect layout,
   so "PRO" is placed at the name's untransformed right edge while the glyphs
   paint 10% narrower, leaving a ~20px hole that reads as "WeatherStudio PRO".
   Scale the whole wordmark once on the parent so the halves sit flush. */
.topbar-logo { transform: scaleX(0.9); transform-origin: left center; }
.topbar-wm-name,
.topbar-wm-pro { transform: none; }
.topbar-wm-name { font-size: 24px; margin-right: 0; }
.topbar-wm-pro  { font-size: 24px; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: rgba(185,215,248,0.82);
}

/* ---- Main content ---- */
.main-content {
  flex: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: 40px;
}
.page-header h1 {
  font-family: var(--font-mark);
  font-size: 40px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.page-header h1 .h1-name { color: var(--silver); }
.page-header h1 .h1-pro  { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.page-header p {
  color: rgba(185,215,248,0.82);
  font-size: 13px;
}
.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,122,0,0.08);
  border: 1px solid rgba(255,122,0,0.25);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ---- Download cards ---- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.download-card:hover {
  border-color: rgba(255,122,0,0.3);
  box-shadow: 0 0 24px rgba(255,100,0,0.06);
}
.download-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.download-card:hover::before { opacity: 1; }
.card-recommended {
  border-color: rgba(255,122,0,0.35);
  box-shadow: 0 0 28px rgba(255,100,0,0.07);
}

/* ---- Platform-availability notice -------------------------------------------
   Was .win-notice, hardcoded for "Windows user, macOS-only releases". Now
   generic and data-driven: it renders whenever no runnable build exists for the
   detected device, or when detection failed, regardless of which platform that
   happens to be. Renamed rather than aliased so no stale Windows-specific copy
   can be revived by accident. ---------------------------------------------- */
.platform-notice {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 26px;
  margin-bottom: 20px;
}
.platform-notice h4 {
  font-family: var(--font-mark);
  font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  margin-bottom: 9px; color: var(--text);
}
.platform-notice p {
  font-size: 13.5px; color: var(--text2); line-height: 1.6; margin-bottom: 12px;
}
.platform-notice-hint {
  font-size: 12.5px; color: var(--muted);
  background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 14px;
}
/* Amber, not red: "no build for your machine" is a limitation to flag, not an error. */
.platform-notice.notice-warn {
  border-color: rgba(228,160,60,0.34);
  background: linear-gradient(180deg, rgba(228,160,60,0.06), var(--surface2));
}

.card-recommended::before { opacity: 1 !important; }

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-header-text { flex: 1; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.card-arch {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(185,215,248,0.75);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Device badges */
.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-left: auto;
}
.device-badge.recommended {
  background: rgba(255,122,0,0.12);
  border: 1px solid rgba(255,122,0,0.35);
  color: var(--accent);
}
.device-badge.compatible {
  background: rgba(80,180,120,0.10);
  border: 1px solid rgba(80,180,120,0.30);
  color: #6ecf96;
}
.device-badge.same-platform {
  background: rgba(100,140,200,0.08);
  border: 1px solid rgba(100,140,200,0.2);
  color: var(--text2);
}
/* Runs, but through a translation layer (Rosetta 2 / Windows x64 emulation). */
.device-badge.emulated {
  background: rgba(228,160,60,0.10);
  border: 1px solid rgba(228,160,60,0.30);
  color: #e3a850;
}
/* Will not run on this device. Amber rather than red -- the build is fine, it is
   simply for a different machine, and the user may be downloading it on purpose. */
.device-badge.incompatible {
  background: rgba(190,90,80,0.10);
  border: 1px solid rgba(190,90,80,0.32);
  color: #e08b82;
}
.card-compatible {
  border-color: rgba(80,180,120,0.20);
}
/* Visually recede an unrunnable build without hiding it. Kept above 0.6 opacity
   so the text stays legible for anyone who genuinely wants this download. */
.card-incompatible {
  opacity: 0.72;
  border-color: rgba(120,130,145,0.20);
  background: linear-gradient(180deg, rgba(255,255,255,0.012), var(--surface2));
}
.card-incompatible:hover { opacity: 1; }
.card-incompatible::before { display: none; }

/* Per-card compatibility explanation, so the badge is never the only signal. */
.compat-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text2);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.compat-note-warn {
  color: #dfa9a2;
  background: rgba(190,90,80,0.07);
  border-color: rgba(190,90,80,0.22);
}

.card-version {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}
.card-version .ver { font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.card-version .rel-date { font-size: 11px; color: rgba(175,205,238,0.80); }

.btn-download {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: rgba(255,122,0,0.08);
  border: 1px solid rgba(255,122,0,0.28);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.btn-download:hover {
  background: rgba(255,122,0,0.14);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255,100,0,0.15);
  transform: translateY(-1px);
}
.btn-download:active  { transform: translateY(0); }
.btn-download:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-download.loading::after { content: ' \u23f3'; }
/* The recommended-build button carries `btn-download btn-primary`, so it also
   matches the generic `.btn-primary` further down this file. That rule pairs
   `color: #180a00` with a solid orange gradient -- dark-on-bright, correct for
   `.btn .btn-primary` (login, subscription). Here the background is only
   rgba(255,122,0,0.14) over a dark card, so the same near-black text lands at
   roughly 1.3:1 contrast and is effectively unreadable.

   Both rules are specificity (0,1,0) for colour, and `.btn-primary` is declared
   later, so it won. `color` is restated below at (0,2,0) to win on specificity
   rather than order -- otherwise this silently regresses if the rules are ever
   reordered. Fixing `.btn-primary` itself is NOT the answer: dark text is
   correct there, and changing it would break every other primary button. */
.btn-download.btn-primary {
  background: rgba(255,122,0,0.14);
  border-color: rgba(255,122,0,0.5);
  box-shadow: 0 0 20px rgba(255,100,0,0.1);
  color: var(--accent-hi);
  font-weight: 700;
}
.btn-download.btn-primary:hover {
  background: rgba(255,122,0,0.22);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(255,100,0,0.22);
}
/* Demoted styling for builds that will not run here: still clickable (a user may
   be downloading for another machine) but visually clearly not the default action.
   Deliberately NOT :disabled -- that would block a legitimate use case. */
.btn-download.btn-muted {
  background: rgba(255,255,255,0.03);
  border-color: rgba(140,150,165,0.28);
  color: var(--text2);
  font-weight: 500;
}
.btn-download.btn-muted:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(160,170,185,0.45);
  color: var(--text);
  box-shadow: none;
}

.card-notes {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}
.card-checksum {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(155,190,228,0.68);
  word-break: break-all;
}

/* ---- No license panel ---- */
.no-license-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 48px;
  text-align: center;
}
.no-license-panel .icon { font-size: 48px; margin-bottom: 16px; }
.no-license-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.no-license-panel p { color: var(--text2); max-width: 420px; margin: 0 auto; font-size: 13px; }

/* ---- Toast ---- */
#dl-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  max-width: 340px;
}
#dl-toast.show    { transform: translateY(0); opacity: 1; }
#dl-toast.success { border-color: rgba(34,197,94,0.4); }
#dl-toast.error   { border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* ---- Form helpers ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}
.input {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,0,0.14);
}
.form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.w-full { width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 9px 18px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-glow-c), var(--accent2));
  color: #180a00;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(255,90,0,.35), inset 0 1px 0 rgba(255,220,160,.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(255,90,0,.5), inset 0 1px 0 rgba(255,220,160,.6); }

/* ---- Changelog ---- */
.changelog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.changelog h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.changelog-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.changelog-item:last-child { border-bottom: none; }
.changelog-icon { font-size: 14px; }
.changelog-version {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
}
.changelog-date {
  font-family: var(--font-mono);
  color: rgba(165,198,232,0.75);
  font-size: 11px;
}
.changelog-platform {
  font-family: var(--font-mono);
  color: rgba(185,215,248,0.82);
  font-size: 11px;
}
.changelog-notes {
  width: 100%;
  color: var(--text2);
  font-size: 12px;
  margin-top: 4px;
  white-space: pre-wrap;
}

/* ---- Shimmer ---- */
@keyframes shimmer { to { background-position: -400% 0; } }
.shimmer { opacity: 0.5; }
.shimmer-bar {
  height: 32px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.shimmer-btn {
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ---- Logout link ---- */
.logout-link {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.2s;
}
.logout-link:hover { color: var(--accent); }

/* ---- Forgot password link ---- */
.forgot-pw-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-pw-link:hover { color: var(--accent); text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   PORTAL TAB NAVIGATION
══════════════════════════════════════════════════════════════ */
.portal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.portal-tab {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  font-family: var(--font-body);
}
.portal-tab:hover:not(.active) { color: var(--text2); }
.portal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   LICENSE STRIP  (compact, shown on Downloads tab)
══════════════════════════════════════════════════════════════ */
.license-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
}
.license-strip-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}
.status-dot-wrap { display: inline-flex; align-items: center; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  display: inline-block;
}
.ls-plan  { font-weight: 600; color: var(--text); }
.ls-sep   { color: var(--border); }
.ls-meta  { color: var(--muted); font-size: 12px; }
.btn-manage-sub {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-manage-sub:hover { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   SUBSCRIPTION TAB — OVERVIEW PANEL
══════════════════════════════════════════════════════════════ */
.sub-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.sub-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,122,0,0.04), transparent 55%);
  pointer-events: none;
}
.sub-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.sub-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  color: var(--success);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.sub-active-badge.suspended { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #f59e0b; }
.sub-active-badge.cancelled { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: var(--danger); }
.sub-plan-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.sub-plan-desc {
  font-size: 12px;
  color: var(--muted);
}
.sub-billing-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,122,0,0.08);
  border: 1px solid rgba(255,122,0,0.2);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-mono);
  letter-spacing: .5px;
}
.sub-downgrade-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.28);
  color: #93c5fd;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.sub-downgrade-icon { font-size: 15px; line-height: 1.3; flex-shrink: 0; }
.sub-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sub-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.sub-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 5px;
}
.sub-stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.sub-stat-sub { font-size: 11px; color: var(--muted); }

/* Progress bar */
.sub-progress-wrap { margin-top: 4px; }
.sub-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.sub-progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
.sub-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.6s ease;
}
.sub-progress-fill.expiring-soon { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* ── Section title ── */
.sub-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   INTERVAL TOGGLE
══════════════════════════════════════════════════════════════ */
.interval-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
  width: fit-content;
  margin-bottom: 20px;
}
.interval-opt {
  padding: 5px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.interval-opt.active { background: var(--accent); color: #000; }
.save-tag {
  background: rgba(34,197,94,0.2);
  color: #4ade80;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}
.interval-opt.active .save-tag { background: rgba(0,0,0,0.2); color: #000; }

/* ══════════════════════════════════════════════════════════════
   PLAN CARDS GRID
══════════════════════════════════════════════════════════════ */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.plan-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.plan-card:hover { border-color: rgba(100,140,200,0.3); background: var(--surface); }
.plan-card.pc-current {
  border-color: rgba(255,122,0,0.4);
  background: rgba(255,122,0,0.04);
  cursor: default;
}
.plan-card.pc-upgrade { border-color: rgba(34,197,94,0.25); }
.plan-card.pc-upgrade:hover { border-color: rgba(34,197,94,0.5); box-shadow: 0 0 20px rgba(34,197,94,0.07); }
.plan-card.pc-downgrade { opacity: .75; }
.plan-card.pc-downgrade:hover { border-color: rgba(239,68,68,0.3); opacity: 1; }
.plan-card.pc-interval { border-color: rgba(59,130,246,0.25); }
.plan-card.pc-interval:hover { border-color: rgba(59,130,246,0.5); box-shadow: 0 0 20px rgba(59,130,246,0.07); }

.pc-current-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,122,0,0.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,122,0,0.3);
  letter-spacing: 0.03em;
}
.pc-upgrade-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pc-top { margin-bottom: 12px; }
.pc-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  padding-right: 60px;
  line-height: 1.2;
}
.pc-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.pc-price   { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.pc-period  { font-size: 13px; font-weight: 400; color: var(--muted); }
.pc-devices { font-size: 11px; color: var(--muted); margin: 4px 0 8px; }
.pc-note    { font-size: 11px; color: var(--muted); margin: 4px 0 8px; font-style: italic; }
.pc-promo-badge {
  display: inline-block;
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}
.pc-badge-eop {
  display: inline-block;
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  margin-left: 4px;
}
.pc-interval { font-size: 11px; color: var(--muted); margin: 4px 0 12px; }
.pc-features {
  list-style: none;
  margin: 0 0 14px;
  padding: 10px 0 0;
  flex: 1;
  border-top: 1px solid var(--border);
}
.pc-features li {
  font-size: 12px;
  color: var(--text2);
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.pc-features li::before { content: '✓'; color: var(--success); font-weight: 700; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.pc-features li.feat-no::before { content: '✗'; color: var(--danger); }
.pc-features li.feat-no { color: var(--muted); }

.pc-cta {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition);
  margin-top: auto;
  text-align: center;
  display: block;
  text-decoration: none;
}
/* Current plan — non-interactive */
.pc-cta-current {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: default;
  font-size: 12px;
  text-align: center;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: auto;
}
/* Upgrade button — green */
.pc-cta.pc-cta-upgrade {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.35);
}
.pc-cta.pc-cta-upgrade:hover {
  background: rgba(34,197,94,0.28);
  box-shadow: 0 2px 12px rgba(34,197,94,0.15);
  transform: translateY(-1px);
}
/* Downgrade button — red-tint */
.pc-cta.pc-cta-downgrade {
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
}
.pc-cta.pc-cta-downgrade:hover {
  background: rgba(239,68,68,0.15);
}
/* Interval/switch button — blue */
.pc-cta.pc-cta-interval {
  background: rgba(59,130,246,0.14);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.3);
}
.pc-cta.pc-cta-interval:hover { background: rgba(59,130,246,0.24); }
/* Contact support link — neutral */
.pc-cta-contact {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: block;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  text-decoration: none;
  margin-top: auto;
}
.pc-cta-contact:hover { border-color: var(--text2); color: var(--text2); }
/* Legacy aliases (for any other references) */
.pc-cta-btn { display: block; }

/* Shimmer for plan cards */
.plan-card-shimmer {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 260px;
  animation: shimmer 1.4s ease infinite;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 400% 100%;
}

/* ══════════════════════════════════════════════════════════════
   PRORATION PREVIEW
══════════════════════════════════════════════════════════════ */
.proration-preview {
  background: var(--surface);
  border: 1px solid rgba(255,122,0,0.25);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 0 0 24px;
}
.pro-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.pro-preview-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.pro-rows { margin-bottom: 18px; }
.pro-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pro-row:last-child { border-bottom: none; }
.pro-row-label { color: var(--text2); }
.pro-row-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pro-row-value { color: var(--text); font-weight: 600; white-space: nowrap; text-align: right; }
.pro-row-value.credit { color: var(--success); }
.pro-row-value.charge { color: var(--accent); font-size: 16px; }
.pro-row-value.next   { color: var(--text2); }
.pro-row.total-row { padding-top: 12px; }
.pro-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pro-contact {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #fcd34d;
  margin-top: 12px;
  line-height: 1.6;
}
.pro-contact p { margin: 0 0 4px; }
.pro-contact p:last-child { margin: 0; color: var(--text2); font-size: 11px; }
.pro-devmode-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px !important;
}

/* Dev-mode simulate button */
.btn.btn-dev-simulate {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.35);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.btn.btn-dev-simulate:hover {
  background: rgba(245,158,11,0.22);
  box-shadow: 0 2px 12px rgba(245,158,11,0.15);
  transform: translateY(-1px);
}
.btn.btn-dev-simulate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════════════════════════
   DOWNGRADE NOTICE
══════════════════════════════════════════════════════════════ */
.downgrade-notice {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #fcd34d;
  margin-bottom: 20px;
  line-height: 1.6;
}
.undo-link { color: #fcd34d; text-underline-offset: 2px; margin-left: 8px; }
.undo-link:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════════
   CANCEL PANEL
══════════════════════════════════════════════════════════════ */
/* Cancel trigger */
.cancel-trigger-wrap {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.btn-cancel-trigger {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color var(--transition);
  opacity: 0.7;
}
.btn-cancel-trigger:hover { color: var(--danger); opacity: 1; }

.cancel-panel {
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 32px;
}
.cancel-title {
  font-size: 14px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 10px;
}
.cancel-body {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 16px;
}
.cancel-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cancel-btn {
  background: none;
  border: 1px solid rgba(239,68,68,0.4);
  color: var(--danger);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition);
}
.cancel-btn:hover { background: rgba(239,68,68,0.1); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 8px 16px;
  transition: border-color var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Forgot/Reset password screens ---- */
#forgot-screen,
#reset-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 78% 10%, rgba(255,122,0,0.14), transparent 60%),
    linear-gradient(rgba(3,6,14,0.70), rgba(3,6,14,0.78)),
    url('portal-bg.jpg');
  background-size: cover;
  background-position: center center;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
#forgot-screen.active,
#reset-screen.active {
  display: flex;
}

/* ============================================================
   HEADING POLISH — Barlow Condensed for section/card headings
   (matches marketing site + signup). Class names unchanged.
   ============================================================ */
.card-title,
.sub-plan-name,
.pc-name,
.no-license-panel h2,
.changelog h2,
.pro-preview-title,
.cancel-title {
  font-family: var(--font-mark);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.2px;
}
.card-title       { font-size: 20px; text-transform: uppercase; }
.sub-plan-name    { font-size: 26px; text-transform: uppercase; }
.pc-name          { font-size: 22px; text-transform: uppercase; }
.no-license-panel h2 { font-size: 26px; text-transform: uppercase; }
.changelog h2     { font-size: 22px; text-transform: uppercase; }
.sub-section-title{ font-family: var(--font-mark); font-size: 20px; text-transform: uppercase; letter-spacing: -0.2px; }

/* Mono labels get the JetBrains-Mono technical look */
.sub-stat-label,
.admin-login-tagline,
.card-arch,
.pc-period,
.ls-meta { font-family: var(--font-mono); }
