:root {
  --bg-dark: #090d16;
  --card-bg: #111827;
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --brand-green: #22c55e;
  --brand-green-glow: rgba(34, 197, 94, 0.25);
  --brand-cyan: #0ea5e9;
  --brand-purple: #a855f7;
  --warning-amber: #f59e0b;
  --danger-red: #ef4444;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(34, 197, 94, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.05) 0%, transparent 45%);
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 32px;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.logo-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links .nav-cta {
  background: rgba(34, 197, 94, 0.12);
  color: var(--brand-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.nav-links .nav-cta:hover {
  background: var(--brand-green);
  color: #000;
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand-green);
  margin-bottom: 16px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--brand-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Progress Indicator Bar */
.progress-container {
  max-width: 600px;
  margin: 20px auto 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.progress-container.hidden {
  display: none;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #0ea5e9 100%);
  border-radius: 6px;
  transition: width 0.4s ease-out;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.progress-step-text {
  color: var(--text-primary);
  font-weight: 600;
}

.progress-percent-text {
  color: var(--brand-green);
  font-weight: 800;
}

/* Score Card */
.score-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 32px;
}

.gauge-container {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radar-scan {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(34, 197, 94, 0.3);
  display: none;
}

.radar-scan.testing {
  display: block;
  animation: spin 3s linear infinite;
  border-color: var(--brand-green);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.score-circle {
  width: 110px;
  height: 110px;
  background: rgba(255, 255, 255, 0.03);
  border: 3px solid var(--card-border);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.score-circle.good { border-color: var(--brand-green); box-shadow: 0 0 20px var(--brand-green-glow); }
.score-circle.warning { border-color: var(--warning-amber); box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
.score-circle.danger { border-color: var(--danger-red); box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.score-info {
  flex-grow: 1;
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.status-pill.good { background: rgba(34, 197, 94, 0.15); color: var(--brand-green); }
.status-pill.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-amber); }
.status-pill.danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-red); }

.score-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Diagnostics Detail Grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px 24px;
}

.card.full-width {
  grid-column: span 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  color: var(--text-primary);
}

.metric-value.good { color: var(--brand-green); }
.metric-value.warning { color: var(--warning-amber); }
.metric-value.danger { color: var(--danger-red); }

/* Global Nodes List */
.nodes-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.node-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node-info {
  display: flex;
  flex-direction: column;
}

.node-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.node-region {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.node-ping {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.ping-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.ping-indicator.good { background: var(--brand-green); box-shadow: 0 0 8px var(--brand-green); }
.ping-indicator.warning { background: var(--warning-amber); }
.ping-indicator.danger { background: var(--danger-red); }

.btn-node-retry {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s ease;
}

.btn-node-retry:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* CTA Banner */
.cta-banner {
  display: none !important;
}

.cta-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.cta-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 680px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.btn-cta {
  display: inline-block;
  background: #22c55e;
  color: #000000;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
  transition: all 0.2s ease;
}

.btn-cta:hover {
  background: #16a34a;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--card-border);
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  margin-top: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--brand-green);
}

@media (max-width: 768px) {
  .details-grid { grid-template-columns: 1fr; }
  .card.full-width { grid-column: span 1; }
  .nodes-list { grid-template-columns: 1fr; }
  .score-card { flex-direction: column; text-align: center; }
  .hero-title { font-size: 1.7rem; }
}
