/* site.css — the stylesheet for every static page on autoviralapp.com.
 *
 * Replaces av-ui-v66.css (2111 lines, of which the site used ~20 selectors —
 * the rest was the old static dashboard, now a separate app). Everything here
 * is used by at least one page. Tokens are named identically to the console's
 * app/globals.css so the two stay diffable.
 *
 * Header and footer are NOT here: header.js and footer.js inject their own
 * scoped CSS so the chrome is identical on pages that load nothing else.
 */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --cn-bg: #000;
  --cn-bg-2: #0a0a0a;
  --cn-bg-3: #111;
  --cn-text: #fff;
  --cn-text-2: rgba(255,255,255,0.65);
  --cn-text-3: rgba(255,255,255,0.4);
  --cn-text-4: rgba(255,255,255,0.25);
  --cn-border: rgba(255,255,255,0.2);
  --cn-border-hi: rgba(255,255,255,0.45);
  --cn-blue: #6ecfff;                  /* phosphor blue */
  --cn-blue-rgb: 110,207,255;          /* the same, for rgba() */
  --cn-blue-h: #e4f7ff;                /* its light tint (sheen highlights, hover text) */
  --cn-blue-ink: #02121b;              /* dark ink on an accent-filled chip */
  --cn-blue-dim: rgba(var(--cn-blue-rgb),0.4);
  --cn-green: #5eff5e;
  --cn-yellow: #ffeb6e;
  --cn-amber: #ffbd2e;
  --cn-red: #ff6e6e;
  --cn-dot-r: #ff5f56; --cn-dot-y: #ffbd2e; --cn-dot-g: #27c93f;
  --cn-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --cn-glow-blue: 0 0 2px var(--cn-blue), 0 0 10px rgba(var(--cn-blue-rgb),0.3), 0 0 30px rgba(var(--cn-blue-rgb),0.1);
  --cn-card-gradient: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  --cn-shadow-card:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 0 0 1px rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.6),
    0 12px 28px -8px rgba(0,0,0,0.7),
    0 24px 60px -12px rgba(0,0,0,0.5);
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-var.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ── Base ───────────────────────────────────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
  background: var(--cn-bg);
  color: var(--cn-text);
  font-family: var(--cn-mono);
  min-height: 100vh;
  overflow-x: hidden;
}
body.cn-page { overflow-y: auto; height: auto; }
.cn-wrap { position: relative; z-index: 10; max-width: 1100px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ── CRT overlay + scanline ─────────────────────────────────────── */
/* Stacking: scanline (1) < overlay (2) < content (10+), so content is never
   darkened by the vignette or striped by the sweep. */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.4),
    rgba(0,0,0,0.4) clamp(1px, 0.2vw, 2px),
    transparent clamp(1px, 0.2vw, 2px),
    transparent clamp(3px, 0.4vw, 5px)
  );
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}
.crt-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(0,0,0,0.15) 70%, rgba(0,0,0,0.40) 85%, rgba(0,0,0,0.70) 100%);
}
.crt-overlay::after {
  content: '';
  position: absolute;
  top: -2%; left: -2%; width: 104%; height: 104%;
  border-radius: 50% / 8%;
  box-shadow: inset 0 0 80px 20px rgba(0,0,0,0.5), inset 0 0 20px 5px rgba(0,0,0,0.3);
}
.crt-scanline {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 350px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.005), rgba(255,255,255,0.025));
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.crt-scanline.active { opacity: 1; visibility: visible; animation: scanlineSweep 10s linear infinite; }
@keyframes scanlineSweep {
  0%   { transform: translate3d(0, -350px, 0); opacity: 1; }
  12%  { transform: translate3d(0, 100vh, 0); opacity: 1; }
  20%  { opacity: 0; }
  20.001%, 100% { transform: translate3d(0, -350px, 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .crt-scanline.active { animation: none; opacity: 0; }
}

/* ── Type ───────────────────────────────────────────────────────── */
.cn-prompt-line {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--cn-text-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}
.cn-prompt-line::before { content: '>'; color: var(--cn-blue); text-shadow: 0 0 4px var(--cn-blue); }
.cn-h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: clamp(1px, 0.3vw, 3px);
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--cn-text);
  text-shadow: 0 0 2px #fff, 0 0 10px rgba(255,255,255,0.35), 0 0 24px rgba(var(--cn-blue-rgb),0.18), 0 4px 16px rgba(0,0,0,0.7);
}
.cn-lead {
  color: var(--cn-text-2);
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 2rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}

/* ── Terminal box — THE shared window component ─────────────────── */
/* Identical to the console's .cn-box in autoviral-web/app/globals.css.
   Thin border + dark fill + top-left sheen; no white glow. */
.cn-box {
  position: relative;
  overflow: hidden;
  background: #0a0a0ac7;
  border: 1px solid var(--cn-border);
  border-radius: 2px;
  box-shadow: var(--cn-shadow-card);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
}
.cn-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--cn-card-gradient);
}
.cn-box-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cn-border);
  background: #ffffff05;
  display: grid;                      /* 3 columns keep the title centred regardless of the dots */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.cn-box-title {
  color: var(--cn-text-2);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  justify-self: center;
}
.cn-dots { display: flex; gap: 6px; }
.cn-dots span { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }
.cn-dots .r { background: var(--cn-dot-r); box-shadow: 0 0 4px var(--cn-dot-r); }
.cn-dots .y { background: var(--cn-dot-y); box-shadow: 0 0 4px var(--cn-dot-y); }
.cn-dots .g { background: var(--cn-dot-g); box-shadow: 0 0 4px var(--cn-dot-g); }
.cn-box-body { padding: 1.25rem; position: relative; }

/* ── Buttons ────────────────────────────────────────────────────── */
.cn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.7rem 1.3rem;
  background: rgba(255,255,255,0.04);
  color: var(--cn-text);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 2px;
  font-family: var(--cn-mono) !important;
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 2px 4px rgba(0,0,0,0.4), 0 6px 16px -4px rgba(0,0,0,0.5);
}
.cn-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 4px 8px rgba(0,0,0,0.5), 0 10px 28px -6px rgba(0,0,0,0.6), 0 0 18px rgba(255,255,255,0.12);
}
.cn-btn:active { transform: translateY(0); }
.cn-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.cn-btn .arr { color: var(--cn-blue); text-shadow: 0 0 4px var(--cn-blue); }
.cn-btn-primary {
  background: rgba(var(--cn-blue-rgb),0.08);
  border-color: var(--cn-blue);
  color: var(--cn-blue);
  text-shadow: 0 0 4px rgba(var(--cn-blue-rgb),0.6);
  box-shadow: 0 1px 0 rgba(var(--cn-blue-rgb),0.18) inset, 0 2px 4px rgba(0,0,0,0.4), 0 6px 16px -4px rgba(0,0,0,0.5), 0 0 16px rgba(var(--cn-blue-rgb),0.12);
}
.cn-btn-primary:hover {
  background: rgba(var(--cn-blue-rgb),0.18);
  color: #fff;
  box-shadow: 0 1px 0 rgba(var(--cn-blue-rgb),0.25) inset, 0 4px 8px rgba(0,0,0,0.5), 0 10px 28px -6px rgba(0,0,0,0.65), 0 0 26px rgba(var(--cn-blue-rgb),0.35);
}

/* ── Status page — 404, 50x, oauth-result, payment-confirmation ──── */
/* One layout for every "here is what just happened" page: an optional big
   code, then a .cn-box with a glyph / title / sub / details / actions. The
   accent is a variable so 50x can be amber without its own copy of anything.
   .is-log is the 404/50x flavour: left-aligned "> line" output. */
.cn-status {
  --acc: var(--cn-blue);
  --acc-rgb: 110,207,255;
  min-height: calc(100vh - 230px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}
.cn-status.is-amber { --acc: var(--cn-amber); --acc-rgb: 255,189,46; }
.cn-status-code {
  font-size: clamp(4.5rem, 20vw, 10rem);
  line-height: 1;
  margin: 0.5rem 0 0;
  color: var(--acc);
  letter-spacing: 0.08em;
  text-shadow: 0 0 2px #fff, 0 0 14px rgba(var(--acc-rgb), 0.6), 0 0 44px rgba(var(--acc-rgb), 0.3);
}
.cn-status-box { max-width: 520px; width: 100%; margin-top: 1.75rem; }
.cn-status-box .cn-box-body { text-align: center; padding: 2rem 1.75rem 1.9rem; }
.cn-status-box.is-log { max-width: 460px; }
.cn-status-box.is-log .cn-box-body { text-align: left; padding: 1.25rem; }
.cn-status-line { font-size: 0.86rem; color: var(--cn-text-2); line-height: 1.9; margin: 0; }
.cn-status-line .k { color: var(--acc); text-shadow: 0 0 4px var(--acc); margin-right: 6px; }
.cn-status-icon {
  width: 66px; height: 66px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.cn-status-icon.is-ok {
  color: var(--cn-green);
  border: 1px solid rgba(94,255,94,0.5);
  background: rgba(94,255,94,0.08);
  box-shadow: 0 0 18px rgba(94,255,94,0.3), inset 0 0 12px rgba(94,255,94,0.15);
}
.cn-status-icon.is-err {
  color: var(--cn-red);
  border: 1px solid rgba(255,110,110,0.5);
  background: rgba(255,110,110,0.08);
  box-shadow: 0 0 18px rgba(255,110,110,0.3), inset 0 0 12px rgba(255,110,110,0.15);
}
.cn-status-title { font-size: clamp(1.3rem, 4vw, 1.8rem); margin: 0 0 0.6rem; }
.cn-status-sub { margin: 0 auto 1.6rem; font-size: 0.92rem; }
.cn-status-details {
  text-align: left;
  border: 1px solid var(--cn-border);
  border-radius: 2px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 1.6rem;
}
.cn-status-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
}
.cn-status-row:last-child { border-bottom: none; }
.cn-status-k { color: var(--cn-text-3); text-transform: uppercase; letter-spacing: 1.2px; }
.cn-status-v { color: var(--cn-text); text-align: right; word-break: break-all; }
.cn-status-msg { color: var(--cn-text-2); font-size: 0.88rem; line-height: 1.7; margin: 0 0 1.6rem; }
.cn-status-note { font-size: 0.78rem; color: var(--cn-text-3); margin: 1.4rem 0 0; }
.cn-status-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cn-status-box.is-log .cn-status-actions { margin-top: 1.5rem; }
@media (max-width: 520px) {
  .cn-status-actions { flex-direction: column; }
  .cn-status-actions .cn-btn { width: 100%; }
}
.cn-status-spinner {
  width: 42px; height: 42px;
  margin: 0.5rem auto 1.25rem;
  border: 3px solid rgba(var(--acc-rgb), 0.15);
  border-top-color: var(--acc);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(var(--acc-rgb), 0.35);
  animation: cnSpin 0.9s linear infinite;
}
@keyframes cnSpin { to { transform: rotate(360deg); } }
