:root {
  --container-max: 1100px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.10);
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur-1: 120ms;
  --dur-2: 200ms;

  /* Design Tokens */
  --color-bg: #0e1621;
  --color-surface: #111827;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-text: #e5e7eb;
  --color-muted: #9ca3af;
  --color-primary: #22c55e;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --radius-1: 12px;
  --radius-2: 16px;
  --radius-3: 20px;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body {
  background-color: #f8fafc;
  color: #0f172a;
}

html[data-theme="light"] .card-premium {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

html[data-theme="light"] .text-muted {
  color: #475569 !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: #0e1621;
  color: #e5e7eb;
}

.bg-app {
  background-color: #0b1b12;
}

.container-narrow {
  max-width: var(--container-max);
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.app-main {
  padding: clamp(24px, 5vw, 56px) 0;
}

.app-section {
  margin-bottom: clamp(24px, 5vw, 56px);
}

.app-section:last-child {
  margin-bottom: 0;
}

.surface-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.btn-primary-gradient,
.btn-outline-soft,
.btn-danger-soft,
.btn-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius-2);
  font-weight: 700;
  line-height: 1;
  padding: 12px 18px;
  transition: transform var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    background var(--dur-1) var(--ease),
    filter var(--dur-1) var(--ease);
}

.btn-primary-gradient,
.btn-pay {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.25);
}

.btn-primary-gradient:hover,
.btn-pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(34, 197, 94, 0.35);
  filter: brightness(1.03);
}

.btn-outline-soft {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  background: transparent;
}

.btn-outline-soft:hover {
  border-color: var(--color-primary);
  color: #ffffff;
  background: rgba(34, 197, 94, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

.btn-danger-soft {
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
}

.btn-danger-soft:hover {
  color: #ffffff;
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(248, 113, 113, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(248, 113, 113, 0.25);
}

.dropdown-menu .btn-danger-soft {
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.6rem;
  background: transparent;
  box-shadow: none;
  color: #fca5a5;
  text-align: left;
}

.dropdown-menu .btn-danger-soft:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.btn-primary-gradient:active,
.btn-outline-soft:active,
.btn-danger-soft:active,
.btn-pay:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
}

.text-muted-2 {
  color: rgba(229, 231, 235, 0.75);
}

.card-premium {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  color: #e5e7eb;
}

.card-premium h1,
.card-premium h2,
.card-premium h3,
.card-premium h4,
.card-premium h5,
.card-premium h6 {
  color: #e5e7eb !important;
}

.card-premium p {
  color: #cbd5e1;
}

.card-premium .text-muted {
  color: #9ca3af !important;
}

.card-premium {
  color: #e5e7eb;
}

.card-premium .section-title {
  color: #f9fafb;
}

.card-premium .text-muted {
  color: rgba(229, 231, 235, 0.75) !important;
}

.card-premium a {
  color: #60a5fa;
  text-decoration: none;
}

.card-premium a:hover {
  text-decoration: underline;
}

.checkout-summary {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.checkout-row:last-child {
  border-bottom: none;
}

.checkout-label {
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-value {
  font-size: 15px;
  color: #e5e7eb;
}

.checkout-total {
  font-size: 26px;
  font-weight: 800;
  color: #22c55e;
}

.checkout-meta {
  font-size: 12px;
  color: #9ca3af;
}

.auth-card {
  border-radius: 18px;
}

.auth-card .form-control {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 12px;
}

.auth-card .form-control:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.2);
  background: #0f172a;
  color: #e5e7eb;
}

.auth-card .input-group .btn {
  border-radius: 12px;
}


@media (max-width: 576px) {
  .checkout-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.plan-card {
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #111827;
}

.plan-card.active {
  border-color: #16a34a;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.2);
  transform: translateY(-2px);
}

.plan-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.pending { background: #fff4e5; color: #b45309; }
.chip.processing { background: #e0f2fe; color: #0369a1; }
.chip.success { background: #dcfce7; color: #166534; }
.chip.danger { background: #fee2e2; color: #b91c1c; }
.chip.neutral { background: #e5e7eb; color: #374151; }

.btn-primary,
.btn-success {
  border-radius: var(--radius-md);
  background: #16a34a;
  border-color: #16a34a;
}

.btn-outline-primary {
  border-color: #16a34a;
  color: #16a34a;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.btn-outline-light:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.form-control,
.form-select {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
}

.form-control:focus,
.form-select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.2);
  background: #0f172a;
  color: #e5e7eb;
}

.btn-outline-secondary {
  border-radius: var(--radius-md);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stepper .step {
  padding: 10px;
  background: #1f2937;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  color: #e5e7eb;
}

.stepper .step.active {
  background: #16a34a;
  color: #fff;
}

.score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0deg 220deg, #1f2937 220deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
}

.toast-item {
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.table {
  color: #e5e7eb;
}

.table thead th {
  color: #9ca3af;
}

.text-muted {
  color: #9ca3af !important;
}

.navbar .nav-link {
  position: relative;
  transition: color 120ms ease;
}

.navbar-premium {
  background: rgba(10, 15, 23, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 12px 0;
}

.navbar-premium .navbar-brand {
  font-size: 18px;
  letter-spacing: 0.2px;
}

.navbar-premium .nav-link {
  font-weight: 600;
  color: #e5e7eb;
}

.navbar-premium .nav-link.active {
  color: #ffffff;
}

.navbar-premium .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 991.98px) {
  .navbar-premium .navbar-collapse {
    padding-top: 12px;
  }
}

.navbar .nav-link:hover {
  color: #22c55e;
}

.navbar .nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: #22c55e;
  border-radius: 999px;
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
  height: 14px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Visibility Fix: Navbar + Hero CTAs */
nav.navbar .nav-link { color: rgba(255,255,255,.92) !important; opacity: 1 !important; }
nav.navbar .nav-link:hover { color: #ffffff !important; }
nav.navbar .navbar-brand { color: #ffffff !important; }
nav.navbar .btn { opacity: 1 !important; }
nav.navbar .btn-outline-light { border-color: rgba(255,255,255,.55) !important; color: #fff !important; }
nav.navbar .btn-outline-light:hover { border-color: #fff !important; background: rgba(255,255,255,.10) !important; }
nav.navbar .btn-success { color: #fff !important; }

/* Hero Visibility Fix */
.hero-section {
  position: relative;
}

.hero-section > .row {
  position: relative;
  z-index: 2;
}

.hero-section .btn-primary-gradient {
  color: #ffffff;
  filter: none;
}

.hero-section .btn-outline-soft {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.hero-section .btn-outline-soft:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
