/* ==========================================================================
   Roxyr by Roxy Cloud — Unified Design Tokens & Base Foundations
   Shared across /, /home, /updates, /docs, and /login.html
   ========================================================================== */

:root {
  /* Obsidian Dark Surfaces (Unified across all pages) */
  --bg-canvas: #000000;
  --bg: #000000;
  --bg-panel: #141416;
  --bg-elev-1: #141416;
  --bg-elev: rgba(24, 24, 27, 0.88);
  --bg-elev-2: #1c1c1e;
  --bg-elev-3: #242428;
  --bg-secondary: #1c1c1e;
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);
  --bg-row-hover: rgba(255, 255, 255, 0.04);
  --bg-pill: rgba(120, 120, 128, 0.22);
  --bg-pill-active: rgba(255, 255, 255, 0.16);

  /* Borders */
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-highlight: rgba(255, 255, 255, 0.22);
  --line-active: rgba(255, 255, 255, 0.36);

  /* Accessible Typography Colors (WCAG AA >= 4.5:1) */
  --text: #f5f5f7;
  --text-dim: #a1a1aa;
  --text-faint: #8e8e93;

  /* Brand Accent (Zero violet/lavender) */
  --accent: #f05a38;
  --accent-hot: #ff6e4a;
  --accent-glow: rgba(240, 90, 56, 0.26);
  --accent-bg: rgba(240, 90, 56, 0.13);
  --accent-border: rgba(240, 90, 56, 0.34);

  /* Semantic Status */
  --ok: #30d158;
  --ok-bg: rgba(48, 209, 88, 0.14);
  --ok-border: rgba(48, 209, 88, 0.32);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.26);
  --amber-bg: rgba(245, 158, 11, 0.14);
  --bad: #ff453a;
  --bad-bg: rgba(255, 69, 58, 0.14);
  --bad-border: rgba(255, 69, 58, 0.34);
  --ocean: #0a84ff;
  --ocean-bg: rgba(10, 132, 255, 0.14);
  --ocean-border: rgba(10, 132, 255, 0.32);
  --gold: #ffd60a;
  --cyan: #64d2ff;

  /* Glass & Shadows (trimmed for mobile fluidity) */
  --glass-bg: rgba(20, 20, 22, 0.86);
  --glass-blur: blur(18px) saturate(160%);
  --glass-blur-sm: blur(12px) saturate(150%);
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.34);
  --shadow-elevated: 0 18px 48px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);

  /* 4-Step Radius Scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 14px;
  --radius-pill: 9999px;

  /* 7-Step Type Scale */
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-28: 28px;
  --fs-40: 40px;

  /* 0 KB Native System Typography Stack */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, Monaco, monospace;
}

html[data-theme="light"] {
  --bg-canvas: #f5f5f7;
  --bg: #f5f5f7;
  --bg-panel: #ffffff;
  --bg-elev-1: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.92);
  --bg-elev-2: #ffffff;
  --bg-elev-3: rgba(0, 0, 0, 0.04);
  --bg-secondary: #f1f2f5;
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-focus: rgba(0, 0, 0, 0.07);
  --bg-row-hover: rgba(0, 0, 0, 0.03);
  --bg-pill: rgba(0, 0, 0, 0.06);
  --bg-pill-active: #ffffff;

  --line: rgba(0, 0, 0, 0.1);
  --line-soft: rgba(0, 0, 0, 0.06);
  --line-highlight: rgba(0, 0, 0, 0.18);
  --line-active: rgba(0, 0, 0, 0.28);

  --text: #111214;
  --text-dim: #52525b;
  --text-faint: #6b6b73;

  --accent: #e04d2c;
  --accent-hot: #f05a38;
  --accent-bg: rgba(224, 77, 44, 0.1);
  --accent-glow: rgba(224, 77, 44, 0.22);
  --accent-border: rgba(224, 77, 44, 0.3);

  --ok: #15803d;
  --ok-bg: rgba(22, 163, 74, 0.11);
  --ok-border: rgba(22, 163, 74, 0.28);
  --warn: #b45309;
  --warn-bg: rgba(217, 119, 6, 0.12);
  --bad: #dc2626;
  --bad-bg: rgba(220, 38, 38, 0.1);
  --bad-border: rgba(220, 38, 38, 0.28);
  --ocean: #0071e3;
  --ocean-bg: rgba(0, 113, 227, 0.1);
  --ocean-border: rgba(0, 113, 227, 0.26);
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 18px 48px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.12);

  --glass-bg: rgba(255, 255, 255, 0.88);
  --shadow-subtle: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 14px 40px rgba(0, 0, 0, 0.12);
}

/* Eliminate UA "Arial" fallback on form controls without overriding size/line-height */
button,
input,
select,
textarea {
  font-family: inherit;
}

/* Keep semantic bold crisp within the 400/500/600 scale */
strong,
b {
  font-weight: 600;
}

/* Consistent keyboard focus ring across every interactive control */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tabular figures for live balances, prices, counters, OTPs, and timers */
.tabular-nums,
.top-saldo-val,
.hero-item-price,
.sms-cost-val,
.admin-kpi-val,
.stat-tile-val,
.stat-banner-val,
.holding-countdown,
.lifespan-countdown,
.sms-countdown,
.totp-code {
  font-variant-numeric: tabular-nums;
}

/* Inline SVG icon helper (mounts public/icons.svg symbols cleanly) */
.rx-ico {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rx-ico-sm {
  width: 13px;
  height: 13px;
}
.rx-ico-lg {
  width: 18px;
  height: 18px;
}

/* Mobile & Reduced Motion GPU Relief (#45) */
@media (max-width: 768px) {
  .card,
  .hero-sidebar-card,
  .email-card,
  .litensi-row,
  .sms-table-row,
  .topbar-nav-group,
  .top-saldo-pill,
  .admin-kpi-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

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