/* ============================================================
   ZOSOFT LABS — Design System
   Dark Premium Theme — Interface d'administration sécurisée
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #070b14;
  --bg2:          #0d1424;
  --surface:      #111827;
  --surface2:     #1a2234;
  --border:       rgba(255,255,255,0.07);
  --border-glow:  rgba(99,102,241,0.3);

  --text:         #f1f5f9;
  --text2:        #94a3b8;
  --text3:        #475569;

  --primary:      #6366f1;
  --primary-glow: rgba(99,102,241,0.2);
  --accent:       #f59e0b;
  --success:      #10b981;
  --danger:       #ef4444;
  --info:         #0ea5e9;
  --warn:         #f59e0b;

  --wan1-color:   #6366f1;
  --wan2-color:   #f59e0b;

  --radius:       14px;
  --radius-lg:    20px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);

  --font:         'Outfit', system-ui, sans-serif;
  --mono:         'JetBrains Mono', 'Courier New', monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family:      var(--font);
  background-color: var(--bg);
  color:            var(--text);
  line-height:      1.6;
  min-height:       100vh;
  overflow-x:       hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.08) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p { font-size: 12px; color: var(--text2); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.login-form-group { margin-bottom: 16px; }
.login-form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.login-input {
  width: 100%; padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font); font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.login-input::placeholder { color: var(--text3); }

.login-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  border: none; border-radius: var(--radius);
  color: white; font-family: var(--font);
  font-size: 14px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; padding: 10px 14px;
  border-radius: var(--radius); font-size: 13px;
  margin-top: 12px; display: none;
}
.login-error.visible { display: block; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ══════════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo small { display: block; font-size: 9px; color: var(--text3); -webkit-text-fill-color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

.nav-group { padding: 8px 8px 0; }
.nav-group-label { font-size: 9px; font-weight: 800; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; padding: 8px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all 0.15s; margin-bottom: 2px;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: var(--primary-glow); color: var(--primary); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--primary); color: white; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 50px; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}
.sidebar-status { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 11px; color: var(--text2); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse-dot 2s infinite; }
.status-dot.offline { background: var(--danger); }

/* ── Main Content ────────────────────────────────────────────── */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: 56px;
  background: rgba(7,11,20,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
}
.topbar-title { font-size: 16px; font-weight: 800; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-time { font-size: 12px; color: var(--text2); font-family: var(--mono); }

/* ── Content Area ────────────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* ══════════════════════════════════════════════════════════════
   CARDS & COMPONENTS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-glow); }
.card-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 14px; height: 14px; }

/* ── Grid layouts ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.wan1::before { background: linear-gradient(90deg, var(--wan1-color), transparent); }
.stat-card.wan2::before { background: linear-gradient(90deg, var(--wan2-color), transparent); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), transparent); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), transparent); }

.stat-label { font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 900; line-height: 1.1; margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 50px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge.online  { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge.offline { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge.warn    { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge.info    { background: rgba(14,165,233,0.12); color: #38bdf8; border: 1px solid rgba(14,165,233,0.2); }
.badge svg { width: 8px; height: 8px; }

/* ── Pulse dot ──────────────────────────────────────────────── */
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block;
}
.pulse-dot.online  { background: var(--success); animation: pulse-dot 2s infinite; }
.pulse-dot.offline { background: var(--danger); }
.pulse-dot.warn    { background: var(--warn);   animation: pulse-dot 1s infinite; }

/* ── Progress bar ───────────────────────────────────────────── */
.progress-bar {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 6px; overflow: hidden; margin-top: 8px;
}
.progress-fill {
  height: 100%; border-radius: 6px;
  transition: width 0.6s ease;
}
.progress-fill.wan1 { background: linear-gradient(90deg, #6366f1, #818cf8); }
.progress-fill.wan2 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.danger  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ── Table ──────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 12px; text-align: left;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text2); font-weight: 500;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .mono { font-family: var(--mono); font-size: 12px; }

/* ── Canvas chart ───────────────────────────────────────────── */
.chart-wrap { height: 80px; position: relative; margin-top: 8px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Button ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px; border: none;
  font-family: var(--font); font-size: 12px; font-weight: 800;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px;
}
.btn-primary { background: linear-gradient(135deg, #6366f1, #4338ca); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,0.35); }
.btn-danger  { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-ghost   { background: rgba(255,255,255,0.05); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.btn:active  { transform: scale(0.98) !important; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn svg { width: 15px; height: 15px; }

/* ── Speed gauge ────────────────────────────────────────────── */
.gauge-block {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.gauge-val { font-size: 32px; font-weight: 900; line-height: 1; }
.gauge-val.wan1 { color: var(--wan1-color); }
.gauge-val.wan2 { color: var(--wan2-color); }
.gauge-unit { font-size: 11px; color: var(--text2); font-weight: 700; margin-top: 2px; }
.gauge-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; }

/* ── Log terminal ───────────────────────────────────────────── */
.terminal {
  background: #050810;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono); font-size: 11px;
  line-height: 1.8; color: var(--text2);
  height: 130px; overflow-y: auto;
}
.terminal .t-ok   { color: #34d399; }
.terminal .t-err  { color: #f87171; }
.terminal .t-info { color: #38bdf8; }
.terminal .t-warn { color: #fbbf24; }
.terminal .t-ts   { color: var(--text3); font-size: 10px; }

/* ── Topology SVG container ─────────────────────────────────── */
.topo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.topo-svg-wrap {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(245,158,11,0.05) 0%, transparent 50%);
  padding: 20px 10px;
}
.topo-svg { width: 100%; max-width: 560px; display: block; margin: 0 auto; }

/* ── Section header ─────────────────────────────────────────── */
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 18px; font-weight: 800; }
.section-header p  { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg2); padding: 3px; border-radius: 12px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  border: none; background: transparent;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  color: var(--text2); cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* ── Refresh indicator ──────────────────────────────────────── */
.refresh-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text2);
}
.refresh-spin { animation: spin 1s linear infinite; }

/* ─── WAN selector buttons ──────────────────────────────────── */
.wan-btns { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.wan-btn {
  padding: 8px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent; color: var(--text2);
  font-family: var(--font); font-size: 11px; font-weight: 800;
  cursor: pointer; transition: all 0.2s;
}
.wan-btn.wan1.active { border-color: var(--wan1-color); color: var(--wan1-color); background: rgba(99,102,241,0.1); }
.wan-btn.wan2.active { border-color: var(--wan2-color); color: var(--wan2-color); background: rgba(245,158,11,0.1); }
.wan-btn.both.active { border-color: var(--success); color: var(--success); background: rgba(16,185,129,0.1); }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeIn    { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp   { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin      { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
@keyframes pulse-dot {
  0%,100% { transform:scale(1); opacity:1; }
  50%      { transform:scale(1.6); opacity:0.5; }
}
@keyframes flow-anim {
  from { stroke-dashoffset: 40; }
  to   { stroke-dashoffset: 0;  }
}
.flow-active { animation: flow-anim 0.8s linear infinite; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content { padding: 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ── Misc helpers ───────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-warn    { color: var(--warn);    }
.text-info    { color: var(--info);    }
.text-muted   { color: var(--text2);   }
.mono-text    { font-family: var(--mono); font-size: 12px; }
.mb-4  { margin-bottom: 4px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px;  }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   OOKLA STYLE SPEEDTEST
   ══════════════════════════════════════════════════════════════ */
.speedtest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at center, rgba(16,24,39,0.8) 0%, var(--bg) 70%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.speedtest-container::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.ookla-gauge-wrap {
  position: relative;
  width: 280px; height: 280px;
  margin: 0 auto 30px;
  z-index: 10;
}

.ookla-gauge-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg); /* Start at top */
}

.gauge-bg-circle {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 12;
}

.gauge-fill-circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 816; /* 2 * PI * 130 = 816.8 */
  stroke-dashoffset: 816;
  transition: stroke-dashoffset 0.2s linear, stroke 0.3s ease;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.gauge-needle {
  transform-origin: 140px 140px;
  transform: rotate(-130deg); /* Start pos */
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.gauge-needle-poly {
  fill: var(--text);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}
.gauge-needle-center {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 4;
}

.ookla-gauge-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.gauge-go-btn {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--text);
  font-family: var(--font);
  font-size: 36px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(99,102,241,0.2), inset 0 0 20px rgba(99,102,241,0.1);
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.gauge-go-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(99,102,241,0.4), inset 0 0 30px rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.1);
}

.gauge-go-btn:active {
  transform: scale(0.95);
}

.gauge-live-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.live-type {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text2);
  margin-bottom: -5px;
}

.live-val {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 0 20px rgba(255,255,255,0.2);
  font-variant-numeric: tabular-nums;
}

.live-unit {
  font-size: 14px;
  font-weight: 700;
  color: var(--text3);
  margin-top: -2px;
}

.speed-results-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  width: 100%;
  max-width: 600px;
  z-index: 10;
}

.res-block {
  text-align: center;
  flex: 1;
}

.res-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.res-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.res-unit {
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
}

/* Colors for active state */
.state-ping .gauge-fill-circle { stroke: #0ea5e9; filter: drop-shadow(0 0 15px rgba(14,165,233,0.4)); }
.state-dl .gauge-fill-circle { stroke: #10b981; filter: drop-shadow(0 0 15px rgba(16,185,129,0.4)); }
.state-ul .gauge-fill-circle { stroke: #8b5cf6; filter: drop-shadow(0 0 15px rgba(139,92,246,0.4)); }

.state-dl .live-type { color: #10b981; }
.state-ul .live-type { color: #8b5cf6; }
.state-ping .live-type { color: #0ea5e9; }

/* ── Dynamic Test Animations ── */
@keyframes pulse-bg {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
}

.speedtest-container.state-ping::before {
  background: radial-gradient(circle, rgba(14,165,233,0.15) 0%, transparent 60%);
  animation: pulse-bg 2s infinite ease-in-out;
}
.speedtest-container.state-dl::before {
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 60%);
  animation: pulse-bg 1.5s infinite ease-in-out;
}
.speedtest-container.state-ul::before {
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 60%);
  animation: pulse-bg 1.5s infinite ease-in-out;
}

@keyframes pop-value {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.live-val {
  animation: pop-value 0.3s ease-out;
}
