/* ==========================================================================
   OCSOTP — design system (Clean Header Scroll Fix + Wizard & History UI)
   ========================================================================== */

/* ---------- 1. Theme tokens ---------- */

:root {
  /* brand */
  --brand-1: #22d3ee;
  --brand-2: #7c5cff;
  --brand-3: #f472b6;
  --brand: #7c5cff;
  --grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(124, 92, 255, .16));

  /* status */
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #60a5fa;

  --radius: 18px;
  --radius-sm: 12px;
  --shell: 1240px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* dark is the default look (landing lives here) */
html[data-theme="dark"], :root {
  --bg: #06080f;
  --bg-2: #0a0e1a;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-solid: #101728;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #eef2ff;
  --muted: #97a3c0;
  --faint: #6b7794;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --glow: 0 0 0 1px rgba(124, 92, 255, .25), 0 18px 60px -18px rgba(34, 211, 238, .45);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --surface-solid: #ffffff;
  --line: #e4e9f3;
  --line-strong: #cfd7e8;
  --text: #0d1424;
  --muted: #5b6884;
  --faint: #8b97ae;
  --shadow: 0 18px 44px -24px rgba(16, 24, 48, .35);
  --glow: 0 0 0 1px rgba(124, 92, 255, .18), 0 16px 40px -20px rgba(91, 91, 247, .35);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3, h4, .display {
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  letter-spacing: -.022em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(124, 92, 255, .35); }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 20px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- 3. Ambient background ---------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .32;
  animation: drift 22s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { background: var(--brand-1); top: -14vw; left: -8vw; }
.aurora span:nth-child(2) { background: var(--brand-2); top: 4vw; right: -12vw; animation-delay: -7s; }
.aurora span:nth-child(3) { background: var(--brand-3); bottom: -20vw; left: 26vw; animation-delay: -13s; opacity: .2; }

html[data-theme="light"] .aurora span { opacity: .16; }

@keyframes drift {
  to { transform: translate3d(4vw, 5vw, 0) scale(1.14); }
}

.grid-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  opacity: .5;
}

/* ---------- 4. Surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card-solid { background: var(--surface-solid); backdrop-filter: none; }

.card-lift:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.card-glow { position: relative; }
.card-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
.card-glow:hover::before { opacity: 1; }

/* ---------- 5. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--grad);
  color: #06080f;
  box-shadow: 0 10px 30px -12px rgba(124, 92, 255, .9);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 40px -12px rgba(34, 211, 238, .8); }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 6. Chips, badges, pills ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s var(--ease);
  font-family: inherit;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--grad-soft);
  border-color: rgba(124, 92, 255, .5);
  color: var(--text);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok   { color: var(--ok);   background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .3); }
.badge-warn { color: var(--warn); background: rgba(251, 191, 36, .13); border-color: rgba(251, 191, 36, .3); }
.badge-bad  { color: var(--bad);  background: rgba(251, 113, 133, .13); border-color: rgba(251, 113, 133, .3); }
.badge-info { color: var(--info); background: rgba(96, 165, 250, .13); border-color: rgba(96, 165, 250, .3); }
.badge-mute { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

.pulse { animation: pulse 1.7s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- 7. Form controls ---------- */

.field { display: block; margin-bottom: 14px; }
.field > label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.input, select.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .18);
  outline: none;
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2397a3c0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
select.input:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 8. Navbar (Clean Header Scroll Fix) ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(6, 8, 15, 0.94);
  backdrop-filter: blur(18px);
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
}

.nav.stuck {
  background: rgba(6, 8, 15, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="light"] .nav {
  background: rgba(245, 247, 252, 0.94);
}

html[data-theme="light"] .nav.stuck {
  background: rgba(245, 247, 252, 0.96) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.nav-inner { display: flex; align-items: center; gap: 18px; height: 72px; }
.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 2px;
  position: relative;
  transition: color .2s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #06080f;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, .9);
}

/* ---------- 9. Sections ---------- */

.section { padding: 96px 0; }
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; margin: 18px 0 14px; }
.section-head p { color: var(--muted); font-size: 17px; line-height: 1.65; margin: 0; }

/* ---------- 10. Landing bits ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-strip > div { background: var(--bg); padding: 24px 20px; text-align: center; }
.stat-strip .n { font-size: 30px; font-weight: 800; font-family: "Plus Jakarta Sans", sans-serif; letter-spacing: -.03em; }
.stat-strip .l { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

.icon-tile {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  color: var(--brand-1);
}

.step-line { position: relative; }
.step-line::before {
  content: "";
  position: absolute;
  left: 22px; top: 44px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand-2), transparent);
  opacity: .45;
}

.step-num {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  background: var(--grad);
  color: #06080f;
}

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 4px;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.faq-q svg { flex: 0 0 auto; transition: transform .3s var(--ease); color: var(--muted); }
.faq-item.open .faq-q svg { transform: rotate(45deg); color: var(--brand-1); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s var(--ease);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p { margin: 0 0 22px; color: var(--muted); line-height: 1.7; max-width: 68ch; }

/* ---------- 11. Dashboard shell ---------- */

.app { display: grid; grid-template-columns: 264px 1fr; height: 100vh; overflow: hidden; }
.app > div { min-height: 0; }

.sidebar {
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  backdrop-filter: blur(16px);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 16px 12px 6px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s var(--ease);
  font-family: inherit;
  background: none;
  width: 100%;
  text-align: left;
}
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active {
  background: var(--grad-soft);
  border-color: rgba(124, 92, 255, .38);
  color: var(--text);
  font-weight: 650;
}
.side-link .ico { flex: 0 0 auto; opacity: .9; }
.side-link .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--grad);
  color: #06080f;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
}

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.wallet-pill .amt { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

.number-plate {
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: .04em;
}

.otp-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .32em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 12. 3-Step Wizard & History UI ---------- */

.wizard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.wstep {
  background: var(--surface-2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: all .2s ease;
}
.wstep:last-child { border-right: none; }
.wstep .n {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.wstep.active {
  background: var(--grad-soft);
  color: var(--text);
}
.wstep.active .n {
  background: var(--grad);
  color: #06080f;
  border: none;
}
.wstep.done {
  color: var(--ok);
}
.wstep.done .n {
  background: rgba(52, 211, 153, .2);
  color: var(--ok);
  border-color: rgba(52, 211, 153, .4);
}

.pick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .2s ease;
}
.pick:hover {
  border-color: var(--brand-2);
  background: var(--grad-soft);
  transform: translateY(-2px);
}
.pick .flag { font-size: 26px; }
.pick .name { font-weight: 700; font-size: 15px; }
.pick .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pick .price { margin-left: auto; text-align: right; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.data-table th { padding: 14px 18px; background: var(--surface-2); color: var(--faint); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.data-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.data-table tr:hover td { background: var(--surface-2); }

/* Scroll reveal fallback */
.reveal { opacity: 1 !important; transform: none !important; }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 34px !important; }
}

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .nav-desktop { display: none !important; }
  .wizard { grid-template-columns: 1fr; }
}
