/* The existing cream palette is the light theme. */
:root { color-scheme: light; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 77px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.theme-moon { display: none; }

/* Midnight indigo with blue-violet light, translucent cards and lilac accents. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14182e;
  --surface: #232b4b;
  --surface-2: #1d2543;
  --surface-3: #30395d;
  --border: #3a456b;
  --border-strong: #6573a0;
  --text: #f4f3ff;
  --text-soft: #d3d7ef;
  --text-muted: #b0b8d7;
  --accent: #b7a9ff;
  --accent-bright: #a993ff;
  --accent-soft: #35305d;
  --green: #9ce0c4;
  --red: #ffadbf;
  --blue: #a2c7ff;
  --amber: #f3d7a4;
}
[data-theme='dark'] body {
  background:
    radial-gradient(ellipse at 92% 5%, #7053d943, transparent 47%),
    radial-gradient(ellipse at 12% 61%, #285dc536, transparent 45%),
    linear-gradient(135deg, #141c35 0%, #171a34 50%, #201a3b 100%);
  background-color: var(--bg);
}
[data-theme='dark'] .theme-sun { display: none; }
[data-theme='dark'] .theme-moon { display: block; }
[data-theme='dark'] ::selection { background: #705bb6; color: #fff; }
[data-theme='dark'] ::-webkit-scrollbar-thumb { background: #606695; }
[data-theme='dark'] :is(button, a, input, select, textarea, summary):focus-visible { outline-color: #b5a7ff; }
[data-theme='dark'] .sidebar { background: linear-gradient(175deg, #1b2240f5, #181d36f5); border-color: #354064; }
[data-theme='dark'] .header { background: #161c3438; border-color: #3b416559; }
[data-theme='dark'] .brand-mark > rect { fill: #7460e2; }
[data-theme='dark'] .brand-mark path[fill='#ffc49e'] { fill: #bfb3ff; }
[data-theme='dark'] .nav-caption { color: var(--text-muted); }
[data-theme='dark'] .mode-btn:hover,
[data-theme='dark'] .header-nav-link:hover { background: var(--surface-3); }
[data-theme='dark'] .mode-btn.active {
  background: linear-gradient(110deg, #51409590, #34478180);
  border-color: #8372d467;
  color: #e1daff;
  box-shadow: inset 0 1px 0 #d6caff0d, 0 4px 14px #0b102426;
}
[data-theme='dark'] .header-help,
[data-theme='dark'] .theme-toggle { background: #2a3152; border-color: #62639480; }
[data-theme='dark'] .activate-card {
  background: linear-gradient(145deg, #252d50ed, #1e2645f5);
  border-color: #66699569;
  box-shadow: inset 0 1px 0 #d6dcff0b, 0 18px 48px #080e2533;
}
[data-theme='dark'] .hero-title em {
  color: #bdaaff;
  background: linear-gradient(100deg, #8ebcff, #b8a0ff 55%, #d5aeff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme='dark'] .hero-stamp { background: linear-gradient(140deg, #4f4a9a55, #2e467755); border-color: #8c86cb69; box-shadow: 0 0 35px #8173ea14; }
[data-theme='dark'] .modal-header { background: #222944; }
[data-theme='dark'] .guide-tab-btn,
[data-theme='dark'] .guide-step { background: var(--surface); }
[data-theme='dark'] .hero-stamp path { fill: var(--accent); }
[data-theme='dark'] .step-number { border-color: var(--border-strong); }
[data-theme='dark'] .step-line { background: var(--border); }
[data-theme='dark'] .step.active .step-number,
[data-theme='dark'] .guide-tab-btn.active { background: linear-gradient(125deg, #7153d6, #4765cf); border-color: #a190ec; color: #fff; }
[data-theme='dark'] .card-symbol { background: linear-gradient(135deg, #524080aa, #334e86aa); border: 1px solid #9f8ae73b; color: #d1c4ff; }
[data-theme='dark'] .form-input,
[data-theme='dark'] .gift-text { background: #18213b; border-color: #59668f; color: var(--text); }
[data-theme='dark'] .form-input::placeholder { color: #a2afd0; }
[data-theme='dark'] .form-input:hover { border-color: #8e89bd; }
[data-theme='dark'] .form-input:focus,
[data-theme='dark'] .gift-text:focus { border-color: #b4a1ff; box-shadow: 0 0 0 3px #a291ff22, 0 0 20px #745ddd12; }
[data-theme='dark'] .btn-verify,
[data-theme='dark'] .btn-activate {
  background: linear-gradient(110deg, #7050d8, #4565d8);
  border-color: #a99cf24f;
  color: #fff;
  box-shadow: 0 7px 24px #6652d938, inset 0 1px 0 #ffffff1a;
}
[data-theme='dark'] .btn-verify:hover,
[data-theme='dark'] .btn-activate:hover { background: linear-gradient(110deg, #7454dc, #4868d5); box-shadow: 0 8px 28px #7660e64d; }
[data-theme='dark'] .btn-back,
[data-theme='dark'] .modal-close { background: #303659; }
[data-theme='dark'] .btn-back:hover { background: #3c436b; }
[data-theme='dark'] .cdk-info { background: #263e46; border-color: #466d71; }
[data-theme='dark'] .badge-success { background: #31564f; }
[data-theme='dark'] .offer-card {
  background: radial-gradient(ellipse at 82% 12%, #a06aeb36, transparent 60%), linear-gradient(150deg, #253d7d, #3f2d6d 64%, #292950);
  border: 1px solid #9381d880;
  box-shadow: inset 0 1px 0 #e1d7ff17, 0 14px 40px #14102a38;
}
[data-theme='dark'] .offer-card p,
[data-theme='dark'] .aside-eyebrow { color: #d9d5f2; }
[data-theme='dark'] .offer-card button { background: linear-gradient(110deg, #e8ddff, #d2e1ff); color: #302351; box-shadow: 0 4px 15px #130d2426; }
[data-theme='dark'] .wallet-tags span { border-color: #a69bc180; color: #e5ddfa; background: #b7a4ef0d; }
[data-theme='dark'] .ticket-art [fill='#eaf1c7'] { fill: #e4e0ff; }
[data-theme='dark'] .ticket-art [fill='#11251b'] { fill: #151637; }
[data-theme='dark'] .ticket-art [fill='#c94b22'] { fill: #7158d6; }
[data-theme='dark'] .ticket-art [fill='#e99a65'] { fill: #a58de8; }
[data-theme='dark'] .ticket-art [stroke='#3a5041'] { stroke: #6d6cac; }
[data-theme='dark'] .ticket-art [stroke='#a5b07f'] { stroke: #a49fc4; }
[data-theme='dark'] .ticket-art [stroke='#617247'],
[data-theme='dark'] .ticket-art [stroke='#53623f'] { stroke: #625b8c; }
[data-theme='dark'] .ticket-art [stroke='#889965'] { stroke: #9a91b8; }
[data-theme='dark'] .ticket-art [stroke='#f5a271'] { stroke: #bcb2ff; }
[data-theme='dark'] .journey-card { background: linear-gradient(145deg, #242c4bd9, #252441d9); border-color: #5c608f70; }
[data-theme='dark'] .progress-bar-container { background: #384264; }
[data-theme='dark'] .progress-bar:not(.error) { background: linear-gradient(90deg, #7d6ee7, #83bcf2); }
[data-theme='dark'] .console-box { background: #171f38; border-color: #415277; color: #bfdbdc; }
[data-theme='dark'] .console-t { color: #98abc9; }
[data-theme='dark'] .gift-box { background: linear-gradient(135deg, #22384b, #293153); border-color: #5c7290; }
[data-theme='dark'] .btn-copy-sm { background: #364167; border-color: #8291ba; color: #dbe4ff; }
[data-theme='dark'] .redeem-guide-button { background: linear-gradient(115deg, #463568, #313d69); border-color: #8b79bb; color: #e8dcff; }
[data-theme='dark'] .security-reminder { background: #443c3e; border-color: #827058; color: var(--amber); }
[data-theme='dark'] .batch-results-table th { background: #303857; }
[data-theme='dark'] .toast { background: #303859; box-shadow: 0 12px 50px #0d0e2a66; }
[data-theme='dark'] .modal-overlay { background: #0e1028c4; }
[data-theme='dark'] .modal-container { background: linear-gradient(145deg, #202843, #25203d); border: 1px solid #7567a85c; }
[data-theme='dark'] .guide-step code { background: #1a213a; }
[data-theme='dark'] .redeem-intro { background: linear-gradient(110deg, #443663, #2d3b61); }

@media (max-width: 720px) {
  .header-tools { gap: 8px; }
  .theme-toggle { min-width: 30px; width: 30px; height: 30px; padding: 0; border-radius: 9px; }
  .theme-toggle [data-theme-label] { display: none; }
}
@media (max-width: 360px) {
  .header-tools { gap: 5px; }
  .header-help { width: 25px; height: 25px; }
}
