/* Dark mode (default) */
:root,
[data-theme="dark"] {
  --bg: #050508;
  --bg-elevated: #0d0d12;
  --bg-card: #0f0f16;
  --purple: #c76dff;
  --purple-bright: #e500ff;
  --purple-glow: #9f3dff;
  --purple-dark: #6a1b99;
  --cyan: #00ffb1;
  --cyan-dim: #00d4a0;
  --magenta: #ff2e70;
  --text: #f0f0f5;
  --text-muted: #8b8b9e;
  --border: #1e1e2e;
  --border-glow: rgba(199, 109, 255, 0.3);
  --danger: #ff2e70;
  --success: #00ffb1;
}

/* Light mode */
[data-theme="light"] {
  --bg: #f8f7fc;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --purple: #7c3aed;
  --purple-bright: #8b5cf6;
  --purple-glow: #a78bfa;
  --purple-dark: #5b21b6;
  --cyan: #059669;
  --cyan-dim: #047857;
  --magenta: #db2777;
  --text: #1e1b2e;
  --text-muted: #6b6b7b;
  --border: #e5e3ec;
  --border-glow: rgba(124, 58, 237, 0.25);
  --danger: #dc2626;
  --success: #059669;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.main {
  min-height: calc(100vh - 180px);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: color-mix(in srgb, var(--bg-elevated) 95%, transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-q {
  color: var(--purple);
  font-size: 1.8rem;
  text-shadow: 0 0 20px var(--purple-glow);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, text-shadow 0.2s;
}

.nav a:hover {
  color: var(--purple);
  text-shadow: 0 0 10px var(--purple-glow);
}

.btn-cta {
  color: var(--purple) !important;
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  color: var(--text-muted);
}

.theme-toggle:hover {
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 0 12px rgba(199, 109, 255, 0.25);
}

[data-theme="dark"] .theme-toggle,
:root .theme-toggle {
  background: rgba(30, 30, 46, 0.8);
  border-color: rgba(199, 109, 255, 0.4);
  color: var(--text);
}

.theme-icon {
  position: absolute;
  font-size: 1.1rem;
  transition: opacity 0.2s, transform 0.2s;
  color: inherit;
}

.theme-icon.sun {
  opacity: 0;
}

.theme-icon.moon {
  opacity: 1;
}

[data-theme="light"] .theme-toggle {
  background: #fff;
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="light"] .theme-toggle:hover {
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .theme-icon.sun {
  opacity: 1;
}

[data-theme="light"] .theme-icon.moon {
  opacity: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-bright) 100%);
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(199, 109, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(199, 109, 255, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glow);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--purple);
  box-shadow: 0 0 15px rgba(199, 109, 255, 0.2);
}

/* Footer */
.footer {
  padding: 2rem;
  text-align: center;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer a {
  color: var(--purple);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer p {
  margin-bottom: 0.5rem;
}

/* Hero */
.hero {
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-nodes .node {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  opacity: 0.25;
  animation: node-beep 4.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.4s);
  box-shadow: 0 0 8px var(--purple);
}

.hero-nodes .node:nth-child(1)  { top: 18%; left: 22%; }
.hero-nodes .node:nth-child(2)  { top: 12%; left: 45%; }
.hero-nodes .node:nth-child(3)  { top: 20%; left: 68%; }
.hero-nodes .node:nth-child(4)  { top: 35%; left: 15%; }
.hero-nodes .node:nth-child(5)  { top: 38%; left: 52%; }
.hero-nodes .node:nth-child(6)  { top: 32%; left: 82%; }
.hero-nodes .node:nth-child(7)  { top: 55%; left: 28%; }
.hero-nodes .node:nth-child(8)  { top: 58%; left: 60%; }
.hero-nodes .node:nth-child(9)  { top: 52%; left: 88%; }
.hero-nodes .node:nth-child(10) { top: 72%; left: 38%; }
.hero-nodes .node:nth-child(11) { top: 75%; left: 65%; }
.hero-nodes .node:nth-child(12) { top: 82%; left: 50%; }

@keyframes node-beep {
  0%, 6%, 100% {
    opacity: 0.25;
    transform: scale(1);
    box-shadow: 0 0 8px var(--purple);
  }
  3% {
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 0 20px var(--purple), 0 0 40px rgba(199, 109, 255, 0.5);
  }
}

[data-theme="light"] .hero-nodes .node {
  animation-name: node-beep-light;
}

@keyframes node-beep-light {
  0%, 6%, 100% {
    opacity: 0.35;
    transform: scale(1);
    box-shadow: 0 0 6px rgba(124, 58, 237, 0.4);
  }
  3% {
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 0 18px var(--purple), 0 0 35px rgba(124, 58, 237, 0.4);
  }
}

.hero h1,
.hero p,
.hero .btn-primary {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero h1 .highlight {
  color: var(--purple);
  text-shadow: 0 0 30px var(--purple-glow);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 1rem;
}

/* Sections */
.section {
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.section h2 .accent {
  color: var(--purple);
}

.section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Stats section - tight spacing, no dead space */
.section-stats {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 0;
}

.stat-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--bg-card) 90%, var(--purple) 10%), var(--bg-card));
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(199, 109, 255, 0.08);
}

.stat-card:hover {
  border-color: var(--purple);
  box-shadow: 0 8px 40px rgba(199, 109, 255, 0.25), 0 0 60px rgba(199, 109, 255, 0.08);
  transform: translateY(-6px) scale(1.02);
}

.stat-card-animate {
  opacity: 0;
  transform: translateY(40px) scale(0.9);
  animation: stat-card-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stat-card-animate[data-delay="0"] { animation-delay: 0.1s; }
.stat-card-animate[data-delay="1"] { animation-delay: 0.3s; }
.stat-card-animate[data-delay="2"] { animation-delay: 0.5s; }

@keyframes stat-card-in {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  60% {
    transform: translateY(-8px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-value {
  font-size: 2.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(199, 109, 255, 0.5);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

[data-theme="light"] .stat-value {
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.35);
}

/* Cards */
.login-error-banner {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.login-error-banner strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* KYC Review Pending */
.kyc-review-section {
  max-width: 520px;
  margin: 4rem auto;
  padding: 0 1rem;
}
.kyc-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(199, 109, 255, 0.08);
}
.kyc-review-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.kyc-review-card h2 {
  color: var(--purple);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.kyc-review-message {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
}
.kyc-review-note {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* File upload - KYC */
.file-upload-zone {
  border: 2px dashed var(--border-glow);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: color-mix(in srgb, var(--purple) 5%, transparent);
}
.file-upload-zone:hover {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 10%, transparent);
}
.file-upload-zone input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}
.file-upload-label {
  display: block;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.file-upload-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Admin manage user */
.admin-manage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}
.admin-user-badge.recovery { background: color-mix(in srgb, var(--cyan) 20%, transparent); color: var(--cyan); }
.admin-user-badge.hack { background: color-mix(in srgb, var(--purple) 20%, transparent); color: var(--purple); }
.admin-user-badge.kyc-pending { background: color-mix(in srgb, var(--magenta) 20%, transparent); color: var(--magenta); }
.admin-user-badge.kyc-approved { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.admin-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.admin-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-section-card h3 {
  color: var(--purple);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Admin account & billing sections */
.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.admin-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s;
}
.admin-action-card:hover {
  border-color: var(--border-glow);
}
.admin-action-card h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-action-card .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.admin-action-card .action-row input,
.admin-action-card .action-row select {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
}
.admin-action-card .action-row input:focus {
  outline: none;
  border-color: var(--purple);
}
.admin-action-card .form-row {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-action-card .form-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}
.admin-action-card .form-row input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.admin-action-card .help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.admin-action-card.locked {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 5%, var(--bg-card));
}
.admin-action-card.non-paying {
  border-color: color-mix(in srgb, var(--magenta) 40%, transparent);
  background: color-mix(in srgb, var(--magenta) 5%, var(--bg-card));
}

/* Billing / Invoice table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.billing-table th,
.billing-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.billing-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.billing-table tr:hover td {
  background: color-mix(in srgb, var(--purple) 3%, transparent);
}
.billing-table .status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.billing-table .status-badge.pending { background: color-mix(in srgb, var(--magenta) 25%, transparent); color: var(--magenta); }
.billing-table .status-badge.paid,
.billing-table .status-badge.approved { background: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.billing-table .status-badge.overdue,
.billing-table .status-badge.rejected { background: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
.billing-table .invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.billing-table .invoice-actions input {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  min-width: 120px;
}
.billing-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  align-items: flex-end;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border: 1px dashed var(--border);
}
.billing-create-form .form-group {
  margin-bottom: 0;
}
.billing-create-form .form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.billing-create-form .form-group input,
.billing-create-form .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s;
}
.dashboard-card:hover {
  border-color: var(--border-glow);
}
.dashboard-card h3 {
  color: var(--purple);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(199, 109, 255, 0.08);
}

.card h3 {
  color: var(--purple);
  margin-bottom: 0.5rem;
}

/* Option boxes - Use QueNet */
.option-box {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.option-box:hover {
  border-color: var(--purple);
  box-shadow: 0 0 40px rgba(199, 109, 255, 0.2);
  transform: translateY(-5px);
}

.option-box .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.option-box .icon-pixel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--purple);
}

.option-box .icon-pixel svg {
  width: 100%;
  height: 100%;
}

.option-box .icon-monitor svg {
  width: 100%;
  height: 100%;
}

.option-box h3 {
  color: var(--purple);
  margin-bottom: 0.75rem;
}

.option-box p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 15px rgba(199, 109, 255, 0.2);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.fade-in {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.float-slow {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.glow-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  margin: 2rem 0;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
  .nav a {
    font-size: 0.9rem;
  }
  .hero {
    padding: 2rem 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .section {
    padding: 2rem 1rem;
  }
  .section h2 {
    font-size: 1.5rem;
  }
  .section-stats {
    padding-top: 0.75rem;
    padding-bottom: 1rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .stat-value {
    font-size: 1.75rem;
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .card {
    padding: 1rem;
  }
  .option-box {
    padding: 1.5rem;
  }
  .option-box .icon {
    font-size: 2rem;
  }
  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .industry-tag {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  .recovery-flow-graph {
    padding: 1rem;
  }
  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Phone view optimizations (≤480px) */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .industries-grid {
    grid-template-columns: 1fr;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }
  .header {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo-q {
    font-size: 1.5rem;
  }

  .nav {
    gap: 0.5rem;
  }

  .nav form {
    display: inline-flex;
  }

  .nav a,
  .btn-primary,
  .btn-outline,
  .btn-cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .hero {
    padding: 2.5rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero .btn-primary {
    padding: 0.75rem 1.25rem;
    min-height: 48px;
  }

  .section {
    padding: 1.5rem 1rem;
  }

  .section h2 {
    font-size: 1.35rem;
  }

  .section h3 {
    font-size: 1.1rem;
  }

  .section p {
    font-size: 0.95rem;
  }

  .section-stats {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }
  .stats-grid {
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .option-box {
    padding: 1.25rem;
  }

  .option-box .icon {
    font-size: 1.75rem;
  }

  .shield-box {
    padding: 1.25rem;
  }

  .shield-title {
    font-size: 1.25rem;
  }

  .glow-line {
    margin: 1.25rem 0;
  }

  .recovery-flow-graph {
    padding: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .flow-plot {
    min-width: 320px;
  }

  .flow-plot-svg {
    min-height: 150px;
  }

  .recovery-flow-graph .flow-node-label,
  .hack-flow-graph .flow-node-label {
    font-size: 9px;
  }

  .recovery-flow-graph .flow-node-sublabel,
  .hack-flow-graph .flow-node-sublabel {
    font-size: 8px;
  }

  .recovery-flow-graph h4,
  .hack-flow-graph h4 {
    font-size: 0.95rem;
  }

  .footer {
    padding: 1.25rem 1rem;
    font-size: 0.8rem;
  }

  .footer p {
    margin-bottom: 0.5rem;
  }

  .banner {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Override inline grids to prevent overflow on narrow screens */
  .section [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* Very small phones (≤375px) */
@media (max-width: 375px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .nav a:not(.btn-primary):not(.btn-cta) {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .form-group input,
  .form-group textarea {
    font-size: 16px;
  }
}

/* Grid pattern background */
.grid-bg {
  background: var(--bg);
  background-image: 
    linear-gradient(rgba(199, 109, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 109, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

[data-theme="light"] .grid-bg {
  background-image: 
    linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
}

/* Homepage background - clean, professional */
.page-home {
  background: 
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(199, 109, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 80% 40% at 100% 60%, rgba(199, 109, 255, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 60% 30% at 0% 80%, rgba(0, 255, 177, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, #0c0c10 0%, #12121a 40%, #0e0e14 100%);
  background-color: #0c0c10;
}

.page-home::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(199, 109, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 109, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.page-home .main {
  position: relative;
  z-index: 1;
}

[data-theme="light"] .page-home {
  background: #f8f7fc;
  background-image: 
    linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

[data-theme="light"] .page-home::before {
  display: none;
}

/* Recovery flow graph - scientific plot */
.recovery-flow-graph {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.recovery-flow-graph .flow-plot {
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.recovery-flow-graph h4 {
  text-align: center;
  color: var(--purple);
  margin-bottom: 2rem;
  font-size: 1.15rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.pricing-grid .card h3 {
  margin-bottom: 0.75rem;
}

.pricing-grid .card p {
  margin-bottom: 0.75rem;
}

.pricing-grid .card p:last-child {
  margin-bottom: 0;
}

.shield-box {
  margin-top: 2rem;
  padding: 2rem;
  padding-top: 1rem;
  background: linear-gradient(135deg, rgba(199, 109, 255, 0.08) 0%, rgba(0, 255, 177, 0.05) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(199, 109, 255, 0.1);
}


.shield-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}

.shield-title {
  color: var(--purple);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 20px rgba(199, 109, 255, 0.3);
}

.shield-box p {
  color: var(--text-muted);
  margin-bottom: 0;
}

[data-theme="light"] .shield-box {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06) 0%, rgba(5, 150, 105, 0.04) 100%);
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
}

.flow-plot {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.flow-plot-svg {
  width: 100%;
  height: auto;
  color: var(--text-muted);
}

.flow-path {
  stroke: var(--purple);
}

/* Circle fill animation - purple light moves left to right */
.flow-node-circle {
  fill: var(--bg-card);
  stroke: var(--purple);
  transition: filter 0.2s;
  animation: circle-fill 2.5s ease-in-out infinite;
}

.flow-node-l2r-0 .flow-node-circle { animation-delay: 0s; }
.flow-node-l2r-1 .flow-node-circle { animation-delay: 0.5s; }
.flow-node-l2r-2 .flow-node-circle { animation-delay: 1s; }
.flow-node-l2r-3 .flow-node-circle { animation-delay: 1.5s; }
.flow-node-l2r-4 .flow-node-circle { animation-delay: 2s; }
.flow-node-l2r-5 .flow-node-circle { animation-delay: 2.5s; }

.hack-flow-graph .flow-node-circle {
  animation: circle-fill-hack 3s ease-in-out infinite;
}

.hack-flow-graph .flow-node-l2r-0 .flow-node-circle { animation-delay: 0s; }
.hack-flow-graph .flow-node-l2r-1 .flow-node-circle { animation-delay: 0.5s; }
.hack-flow-graph .flow-node-l2r-2 .flow-node-circle { animation-delay: 1s; }
.hack-flow-graph .flow-node-l2r-3 .flow-node-circle { animation-delay: 1.5s; }
.hack-flow-graph .flow-node-l2r-4 .flow-node-circle { animation-delay: 2s; }
.hack-flow-graph .flow-node-l2r-5 .flow-node-circle { animation-delay: 2.5s; }

@keyframes circle-fill-hack {
  0%, 17% { fill: var(--bg-card); filter: none; }
  4% { fill: var(--purple); filter: drop-shadow(0 0 8px var(--purple)); }
  10% { fill: var(--purple); filter: drop-shadow(0 0 12px var(--purple-bright)); }
  17%, 100% { fill: var(--bg-card); filter: none; }
}

@keyframes circle-fill {
  0%, 20% { fill: var(--bg-card); filter: none; }
  4% { fill: var(--purple); filter: drop-shadow(0 0 8px var(--purple)); }
  12% { fill: var(--purple); filter: drop-shadow(0 0 12px var(--purple-bright)); }
  20%, 100% { fill: var(--bg-card); filter: none; }
}

.flow-node:hover .flow-node-circle {
  filter: drop-shadow(0 0 8px var(--purple));
}

.flow-node-label {
  fill: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.flow-node-sublabel {
  fill: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
}

@media (max-width: 768px) {
  .flow-plot-svg {
    min-height: 180px;
  }

  .recovery-flow-graph .flow-node-label,
  .hack-flow-graph .flow-node-label {
    font-size: 10px;
  }

  .recovery-flow-graph .flow-node-sublabel,
  .hack-flow-graph .flow-node-sublabel {
    font-size: 9px;
  }
}


.page-tos .main,
.page-faq .main {
  position: relative;
  z-index: 1;
}

.page-tos,
.page-faq {
  background: var(--bg);
}

[data-theme="dark"] .page-tos,
[data-theme="dark"] .page-faq,
:root .page-tos,
:root .page-faq {
  background: 
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(159, 61, 255, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #050508 0%, #0a0812 100%);
  background-color: #050508;
}

[data-theme="light"] .page-tos,
[data-theme="light"] .page-faq {
  background: 
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #f8f7fc 0%, #f0eef8 100%);
  background-color: #f8f7fc;
}

.page-tos::before,
.page-faq::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(199, 109, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 109, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] .page-tos::before,
[data-theme="light"] .page-faq::before {
  background-image: 
    linear-gradient(rgba(124, 58, 237, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px);
}


/* Banners */
.banner {
  padding: 1rem 2rem;
  text-align: center;
}

.banner-warning {
  background: rgba(234, 179, 8, 0.2);
  border-bottom: 1px solid rgba(234, 179, 8, 0.5);
}

.banner-danger {
  background: rgba(255, 46, 112, 0.2);
  border-bottom: 1px solid rgba(255, 46, 112, 0.5);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--purple);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--purple);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 10px var(--purple-glow);
}

.timeline-content {
  margin-left: 0;
}

/* Dialog */
dialog {
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.faq-item summary:hover {
  color: var(--purple);
}

.faq-item p {
  margin-top: 0.75rem;
  padding-left: 0;
}

/* Industries grid */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.industry-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.industry-tag:hover {
  border-color: var(--purple);
  color: var(--purple);
}
