/* ==========================================================================
   WraithVision design system v2 — loaded LAST on every page
   --------------------------------------------------------------------------
   Quiet, precise, a little uncanny. One graphite scale, one accent (cyan),
   four status signals. Depth comes from surface steps and hairlines, never
   from shadows or glow. Cyan is rare: selection, the live dot, ESP brackets.

   Each page keeps its own stylesheet for layout; this file defines the v2
   tokens and components and re-points the legacy variable names those
   stylesheets use, so every panel speaks the same language.

   Contrast on --wv-bg #0a0c0f:
     text #e8edf2 16.9:1 · text-2 #a2acb7 8.6:1 · text-3 #7b8591 5.0:1
     dark text #0a0c0f on the light primary button #e8edf2 16.9:1
   ========================================================================== */

:root {
  /* ---- graphite scale --------------------------------------------------- */
  --wv-bg:        #0a0c0f;   /* ground */
  --wv-surface:   #101318;   /* cards */
  --wv-raised:    #161a20;   /* raised / secondary buttons */
  --wv-active:    #1d222a;   /* selected segment, progress track */
  --wv-track:     #2a3038;   /* toggles, slider tracks */
  --wv-unreleased:#232930;   /* status bars before launch */

  --wv-line:      rgba(214,228,240,0.08);
  --wv-line-2:    rgba(214,228,240,0.12);
  --wv-line-3:    rgba(214,228,240,0.16);

  --wv-text:      #e8edf2;
  --wv-text-2:    #a2acb7;
  --wv-text-3:    #7b8591;

  --wv-accent:    #22c9ff;
  --wv-accent-rgb: 34,201,255;

  /* ---- status signals (meaning only) ------------------------------------ */
  --wv-ok:        #5ad19a;   /* undetected */
  --wv-warn:      #e5b052;   /* updating, frozen */
  --wv-danger:    #ef6a6e;   /* detected */
  --wv-info:      #8fa8ff;   /* maintenance */
  --wv-danger-text: #f28b8e;

  /* ---- type ------------------------------------------------------------- */
  --wv-display:   'Chakra Petch', 'Geist', system-ui, sans-serif;
  --wv-sans:      'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wv-mono:      'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* ---- shape + motion --------------------------------------------------- */
  --wv-r-input:   10px;
  --wv-r-card:    16px;
  --wv-r-panel:   18px;
  --wv-ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --wv-fast:      160ms;
  --wv-slow:      240ms;

  /* ---- legacy names used by the page stylesheets ------------------------- */
  --bg:          var(--wv-bg);
  --accent:      var(--wv-accent);
  --accent-2:    var(--wv-accent);
  --accent-3:    var(--wv-accent);
  --accent-soft: rgba(34,201,255,0.10);
  --accent-line: rgba(34,201,255,0.40);
  --accent-glow: transparent;
  --ok:     var(--wv-ok);
  --warn:   var(--wv-warn);
  --danger: var(--wv-danger);
  --err:    var(--wv-danger);
  --bad:    var(--wv-danger);
  --info:   var(--wv-info);

  /* admin (dashboard.css) + portal (portal.css) surfaces */
  --bg-1: #0d1014;
  --bg-2: var(--wv-surface);
  --bg-3: var(--wv-raised);
  --bg-4: var(--wv-active);
  --bg-5: #242a33;
  --border:        var(--wv-line);
  --border-2:      var(--wv-line-2);
  --border-strong: var(--wv-line-3);
  --hl-inner:      none;
  --hl-inner-2:    none;
  --fg:      var(--wv-text);
  --fg-dim:  var(--wv-text-2);
  --muted:   var(--wv-text-3);
  --muted-2: var(--wv-text-3);
  --cyan:      var(--wv-accent);
  --cyan-soft: rgba(34,201,255,0.10);
  --violet:  var(--wv-accent);
  --blue:    var(--wv-info);
  --emerald: var(--wv-ok);
  --amber:   var(--wv-warn);
  --sans: var(--wv-sans);
  --mono: var(--wv-mono);
  --shadow-sm:   none;
  --shadow:      none;
  --shadow-lg:   0 24px 64px rgba(0,0,0,0.55);  /* dialogs only: they float */
  --shadow-glow: none;
  --ease: var(--wv-ease);

  /* reseller (reseller.css) */
  --bg-0: var(--wv-bg);
  --text:      var(--wv-text);
  --text-2:    var(--wv-text-2);
  --text-dim:  var(--wv-text-2);
  --text-mute: var(--wv-text-3);
  --accent-pink:   var(--wv-accent);
  --accent-orange: var(--wv-warn);
  --grad-accent: var(--wv-text);
  --grad-hero: var(--wv-surface);

  /* landing / status / terms inline tokens */
  --panel:   var(--wv-surface);
  --stroke:  var(--wv-line);
  --dim:     var(--wv-text-3);
  --red:     var(--wv-danger);
  --green:   var(--wv-ok);
}

/* ---- base ------------------------------------------------------------- */
/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }
html { background: var(--wv-bg); }
body {
  font-family: var(--wv-sans);
  background: var(--wv-bg);
  color: var(--wv-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on;
}
/* Display face only for large headings, in normal case. */
h1, h2, .page-head h2 {
  font-family: var(--wv-display);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
h3, h4, .tab-head h3, .card > h3:first-child {
  font-family: var(--wv-sans);
  font-weight: 500;
  letter-spacing: 0;
}
code, kbd, samp, pre, .mono, .num {
  font-family: var(--wv-mono);
  font-variant-numeric: tabular-nums;
}

/* ---- buttons ----------------------------------------------------------
   Primary: light surface, dark text. At most one per area.
   Secondary: raised surface with a hairline. Danger: red text + red line. */
button.btn-primary,
.btn-primary,
.btn.primary,
.loader-cta {
  background: var(--wv-text);
  color: var(--wv-bg);
  border: 1px solid transparent;
  box-shadow: none;
  font-family: var(--wv-sans);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  filter: none;
  transition: background var(--wv-fast) var(--wv-ease), transform var(--wv-fast) var(--wv-ease);
}
button.btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.btn.primary:hover:not(:disabled),
.loader-cta:hover {
  background: #ffffff;
  color: var(--wv-bg);
  box-shadow: none;
  filter: none;
  transform: none;
}
button.btn-primary:active:not(:disabled),
.btn-primary:active:not(:disabled),
.loader-cta:active { transform: scale(0.98); }
button.btn-primary:disabled, .btn-primary:disabled { opacity: .45; cursor: not-allowed; }

button.ghost.danger, .btn.danger, .btn-danger, .ghost.danger {
  color: var(--wv-danger-text);
  border-color: rgba(239,106,110,0.30);
  background: transparent;
}
button.ghost.danger:hover:not(:disabled), .btn-danger:hover:not(:disabled), .ghost.danger:hover:not(:disabled) {
  background: rgba(239,106,110,0.08);
  border-color: rgba(239,106,110,0.45);
  color: var(--wv-danger-text);
}

/* Shared v2 button set for rebuilt pages: .wv-btn (+ .is-primary / .is-quiet / .is-danger) */
.wv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--wv-r-input);
  font: 500 14px/1 var(--wv-sans); letter-spacing: 0; white-space: nowrap;
  color: var(--wv-text); background: var(--wv-raised);
  border: 1px solid var(--wv-line-2); cursor: pointer; text-decoration: none;
  transition: background var(--wv-fast) var(--wv-ease), border-color var(--wv-fast) var(--wv-ease), transform var(--wv-fast) var(--wv-ease), color var(--wv-fast) var(--wv-ease);
}
.wv-btn:hover:not(:disabled) { background: var(--wv-active); color: var(--wv-text); }
.wv-btn:active:not(:disabled) { transform: scale(0.98); }
.wv-btn:disabled { opacity: .45; cursor: not-allowed; }
.wv-btn.is-primary { background: var(--wv-text); color: var(--wv-bg); border-color: transparent; }
.wv-btn.is-primary:hover:not(:disabled) { background: #fff; color: var(--wv-bg); }
.wv-btn.is-quiet { background: transparent; border-color: transparent; color: var(--wv-text-2); }
.wv-btn.is-quiet:hover:not(:disabled) { background: var(--wv-raised); color: var(--wv-text); }
.wv-btn.is-danger { background: transparent; color: var(--wv-danger-text); border-color: rgba(239,106,110,0.30); }
.wv-btn.is-danger:hover:not(:disabled) { background: rgba(239,106,110,0.08); }
.wv-btn.is-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.wv-btn.is-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.wv-btn svg { width: 16px; height: 16px; flex: none; }

/* ---- focus: visible on every interactive element ----------------------- */
:focus-visible {
  outline: 2px solid var(--wv-accent);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(34,201,255,0.40);
  outline-offset: 1px;
  border-color: rgba(34,201,255,0.60);
}

/* ---- links ------------------------------------------------------------ */
a:where(:not([class])) {
  color: var(--wv-text);
  text-decoration: underline;
  text-decoration-color: var(--wv-line-3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--wv-fast) var(--wv-ease);
}
a:where(:not([class])):hover { color: var(--wv-text); text-decoration-color: var(--wv-text-2); }

/* ---- selection + scrollbars ------------------------------------------- */
::selection { background: rgba(34,201,255,0.28); color: #fff; }
* { scrollbar-color: #2a3038 transparent; }

/* ---- motion ----------------------------------------------------------- */
@keyframes wv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes wv-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- wordmark: one colour, no glow --------------------------------------
   Markup in older pages is WRAITH<b>VISION</b>; the <b> no longer changes colour. */
.wv-wordmark {
  font-family: var(--wv-display);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--wv-text);
  white-space: nowrap;
  background: none;
  -webkit-text-fill-color: currentColor;
}
.wv-wordmark b { color: inherit; font-weight: inherit; }

/* ---- status dot ------------------------------------------------------- */
.wv-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--wv-ok); box-shadow: none;
  display: inline-block; flex-shrink: 0;
}
.wv-dot.is-undetected { background: var(--wv-ok); }
.wv-dot.is-updating   { background: var(--wv-warn); }
.wv-dot.is-detected   { background: var(--wv-danger); }
.wv-dot.is-maintenance{ background: var(--wv-info); }
.wv-dot.is-development{ background: var(--wv-text-3); }
.wv-dot.is-unreleased { background: var(--wv-unreleased); }
/* Only the one dot that is really live breathes. */
.wv-dot.is-live { animation: wv-breathe 2.4s ease-in-out infinite; }

/* Status chip: coloured dot, neutral everything else. */
.wv-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border-radius: 8px; background: var(--wv-raised); border: 1px solid var(--wv-line);
  font: 400 12px/1 var(--wv-mono); color: var(--wv-text); white-space: nowrap;
}

/* ---- ESP bracket: the brand mark -------------------------------------------
   <div class="wv-esp"><i class="a"></i><i class="b"></i><i class="c"></i><i class="d"></i>…</div>
   Only where something is acquired: a selected plan, the status that applies now. */
.wv-esp { position: relative; }
.wv-esp > i.a, .wv-esp > i.b, .wv-esp > i.c, .wv-esp > i.d {
  position: absolute; width: 14px; height: 14px; border: 0 solid var(--wv-accent); pointer-events: none;
}
.wv-esp > i.a { left: -1px;  top: -1px;    border-width: 1.5px 0 0 1.5px; }
.wv-esp > i.b { right: -1px; top: -1px;    border-width: 1.5px 1.5px 0 0; }
.wv-esp > i.c { left: -1px;  bottom: -1px; border-width: 0 0 1.5px 1.5px; }
.wv-esp > i.d { right: -1px; bottom: -1px; border-width: 0 1.5px 1.5px 0; }

/* ---- discount lock-on --------------------------------------------------------
   When a discount code applies, ESP brackets snap onto the price for a moment,
   the old price gets struck through left to right and the new one counts down
   (the count-down is JS). The brackets fade out again: the only cyan is the
   moment itself. Re-trigger by removing and re-adding .is-on.
   <div class="wv-lock"><i class="a"></i><i class="b"></i><i class="c"></i><i class="d"></i>…</div>
   <s class="wv-strike">€49.99</s> */
.wv-lock { position: relative; }
.wv-lock > i {
  position: absolute; width: 12px; height: 12px; border: 0 solid var(--wv-accent);
  opacity: 0; pointer-events: none; z-index: 1;
}
.wv-lock > i.a { left: -6px;  top: -6px;    border-width: 1.5px 0 0 1.5px; --dx: -7px; --dy: -7px; }
.wv-lock > i.b { right: -6px; top: -6px;    border-width: 1.5px 1.5px 0 0; --dx: 7px;  --dy: -7px; }
.wv-lock > i.c { left: -6px;  bottom: -6px; border-width: 0 0 1.5px 1.5px; --dx: -7px; --dy: 7px; }
.wv-lock > i.d { right: -6px; bottom: -6px; border-width: 0 1.5px 1.5px 0; --dx: 7px;  --dy: 7px; }
.wv-lock.is-on > i { animation: wv-lock 1.9s var(--wv-ease) both; }
.wv-lock.is-on > i.b { animation-delay: 40ms; }
.wv-lock.is-on > i.c { animation-delay: 80ms; }
.wv-lock.is-on > i.d { animation-delay: 120ms; }
@keyframes wv-lock {
  0%   { opacity: 0; transform: translate(var(--dx), var(--dy)); }
  20%  { opacity: 1; transform: none; }
  70%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
s.wv-strike, .wv-strike { position: relative; text-decoration: none; }
.wv-strike::after {
  content: ""; position: absolute; left: -1px; right: -1px; top: 54%; height: 1.5px;
  background: currentColor; transform-origin: left center;
}
.is-on .wv-strike::after { animation: wv-strike 420ms var(--wv-ease) both; }
@keyframes wv-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wv-tick { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .wv-lock.is-on > i, .is-on .wv-strike::after { animation: none; }
}

/* ---- keyboard key ----------------------------------------------------- */
.wv-kbd, kbd {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px;
  border: 1px solid var(--wv-line-3); border-bottom-width: 2px; background: transparent;
  font: 400 11px/1 var(--wv-mono); color: var(--wv-text-3);
}

/* ---- day bars (status moments) ----------------------------------------- */
.wv-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 28px; }
.wv-bars > i { display: block; border-radius: 2px; background: var(--wv-unreleased); }
.wv-bars > i.undetected  { background: var(--wv-ok); opacity: .85; }
.wv-bars > i.updating    { background: var(--wv-warn); }
.wv-bars > i.detected    { background: var(--wv-danger); }
.wv-bars > i.maintenance { background: var(--wv-info); }
.wv-bars > i.nodata      { background: var(--wv-unreleased); }

/* ---- shared header for the small public pages (status, terms) --------- */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,12,15,0.86); border-bottom: 1px solid rgba(214,228,240,0.06);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.site-nav-in {
  max-width: 1040px; margin: 0 auto; padding: 0 40px; height: 64px;
  display: flex; align-items: center; gap: 24px;
}
.site-nav .wv-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; text-decoration: none; color: var(--wv-text); }
.site-nav .site-here { font-size: 14px; color: var(--wv-text-3); }
.site-nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav-links a {
  color: var(--wv-text-2); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px;
  transition: color var(--wv-fast) var(--wv-ease);
}
.site-nav-links a:hover { color: var(--wv-text); }
.site-nav-links a[aria-current="page"] { color: var(--wv-text); }
@media (max-width: 560px) {
  .site-nav-in { padding: 0 20px; gap: 12px; }
  .site-nav .site-here { display: none; }
}

.site-foot {
  border-top: 1px solid rgba(214,228,240,0.06);
  color: var(--wv-text-3); font-size: 13px;
}
.site-foot-in {
  max-width: 1040px; margin: 0 auto; padding: 28px 40px 40px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
}
.site-foot a { color: var(--wv-text-2); text-decoration: none; }
.site-foot a:hover { color: var(--wv-text); }
.site-foot .wv-wordmark { font-size: 13px; }
@media (max-width: 560px) { .site-foot-in { padding: 24px 20px 32px; } }
