/* ==========================================================
   Quantleo Index — Design System
   Light theme, permanent. Transparent header on scroll-top.
   ========================================================== */

:root {
  /* Palette */
  --qi-white:       #ffffff;
  --qi-surface:      #f7f8fc;
  --qi-surface-2:    #eef0f9;
  --qi-border:       #e6e8f2;
  --qi-ink:          #161829;
  --qi-ink-soft:     #454a63;
  --qi-muted:        #6b7089;
  --qi-blue:         #1e3aff;
  --qi-blue-soft:    #eef1ff;
  --qi-purple:       #8b2fd6;
  --qi-cyan:         #17c3ec;
  --qi-success:      #16a34a;
  --qi-success-bg:   #e9f9ef;
  --qi-warn:         #d97706;
  --qi-warn-bg:      #fef3e2;
  --qi-error:        #dc2626;
  --qi-error-bg:     #fdecec;

  --qi-gradient: linear-gradient(135deg, var(--qi-blue) 0%, var(--qi-purple) 100%);
  --qi-gradient-soft: linear-gradient(135deg, rgba(30,58,255,0.08) 0%, rgba(139,47,214,0.08) 100%);

  /* Type */
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Radii / shadow */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(22, 24, 41, 0.06);
  --shadow-md: 0 8px 28px rgba(22, 24, 41, 0.09);
  --shadow-lg: 0 16px 48px rgba(30, 58, 255, 0.14);

  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--qi-white);
  color: var(--qi-ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--qi-ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

a { color: var(--qi-blue); text-decoration: none; }
code, .mono { font-family: var(--font-mono); }

img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header (transparent, sticky) ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(230, 232, 242, 0.7);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--qi-ink);
}
.brand img { height: 34px; width: auto; }
.brand span.accent {
  background: var(--qi-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--qi-ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--qi-blue); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--qi-gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 58, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(30, 58, 255, 0.35); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--qi-ink);
  border: 1.5px solid var(--qi-border);
}
.btn-ghost:hover { border-color: var(--qi-blue); color: var(--qi-blue); }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--qi-error-bg); color: var(--qi-error); }
.btn-danger:hover { background: #fbd5d5; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 108px 0 96px;
  overflow: hidden;
  background: var(--qi-white);
}
.hero-bg-orb {
  position: absolute;
  top: -180px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: var(--qi-gradient-soft);
  filter: blur(10px);
  z-index: 0;
  animation: orb-float 10s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 30px) scale(1.05); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--qi-blue-soft);
  color: var(--qi-blue);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--qi-success);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  font-weight: 700;
}
.hero h1 .accent {
  background: var(--qi-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 17.5px;
  color: var(--qi-muted);
  max-width: 480px;
  margin: 18px 0 32px;
}
.hero-cta { display: flex; gap: 14px; }

/* Signature element: orbit-scan ring around logo mark */
.orbit-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed rgba(30, 58, 255, 0.22);
}
.orbit-ring.r1 { width: 100%; height: 100%; animation: spin 22s linear infinite; }
.orbit-ring.r2 { width: 76%; height: 76%; border-color: rgba(139, 47, 214, 0.18); animation: spin-reverse 16s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.orbit-scan-line {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(23,195,236,0.35) 8%, transparent 16%);
  animation: spin 3.2s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 55%, black 56%, black 100%);
  mask: radial-gradient(circle, transparent 55%, black 56%, black 100%);
}
.orbit-logo {
  position: relative;
  z-index: 2;
  width: 46%;
  filter: drop-shadow(0 12px 28px rgba(30, 58, 255, 0.25));
  animation: float-logo 5s ease-in-out infinite;
}
@keyframes float-logo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------------- Trust bar ---------------- */
.trust-bar {
  padding: 28px 0;
  border-top: 1px solid var(--qi-border);
  border-bottom: 1px solid var(--qi-border);
  background: var(--qi-surface);
}
.trust-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.trust-stat { text-align: center; flex: 1; min-width: 140px; }
.trust-stat .num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: var(--qi-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.trust-stat .label { font-size: 13px; color: var(--qi-muted); margin-top: 4px; }

/* ---------------- Section generic ---------------- */
.section { padding: 88px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); }
.section-head p { color: var(--qi-muted); font-size: 16px; margin-top: 12px; }

/* ---------------- Steps (genuinely sequential -> numbered) ---------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  counter-reset: step;
}
.step-card {
  position: relative;
  background: var(--qi-white);
  border: 1px solid var(--qi-border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.step-num {
  counter-increment: step;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--qi-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 18px;
}
.step-num::before { content: counter(step); }
.step-card h3 { font-size: 17.5px; margin-bottom: 8px; }
.step-card p { color: var(--qi-muted); font-size: 14.5px; margin: 0; }

/* ---------------- Feature grid ---------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--qi-surface);
  border: 1px solid var(--qi-border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.feature-card:hover { background: var(--qi-white); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--qi-blue-soft);
  color: var(--qi-blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: var(--qi-muted); font-size: 14px; margin: 0; }

/* ---------------- Forms ---------------- */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--qi-surface);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--qi-white);
  border: 1px solid var(--qi-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  animation: card-rise 0.5s ease both;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--qi-muted); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--qi-ink-soft);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--qi-border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-body);
  color: var(--qi-ink);
  background: var(--qi-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--qi-blue);
  box-shadow: 0 0 0 3.5px rgba(30, 58, 255, 0.12);
}
.field .hint { font-size: 12.5px; color: var(--qi-muted); margin-top: 6px; }
.field input.mono { font-family: var(--font-mono); letter-spacing: 0.05em; }

.otp-inputs { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.otp-inputs input {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 22px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0;
}

.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error { background: var(--qi-error-bg); color: var(--qi-error); }
.alert-success { background: var(--qi-success-bg); color: var(--qi-success); }
.alert-warn { background: var(--qi-warn-bg); color: var(--qi-warn); }
.alert-info { background: var(--qi-blue-soft); color: var(--qi-blue); }

.auth-footer { text-align: center; margin-top: 22px; font-size: 14px; color: var(--qi-muted); }

/* ---------------- Dashboard shell ---------------- */
.app-shell { display: flex; min-height: calc(100vh - var(--header-h)); background: var(--qi-surface); }
.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--qi-white);
  border-right: 1px solid var(--qi-border);
  padding: 24px 16px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--qi-ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-link:hover { background: var(--qi-surface); color: var(--qi-ink); }
.sidebar-link.active { background: var(--qi-blue-soft); color: var(--qi-blue); font-weight: 600; }
.app-main { flex: 1; padding: 36px 40px; max-width: 1080px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.page-head h1 { font-size: 25px; margin: 0; }
.page-head p { color: var(--qi-muted); font-size: 14px; margin: 4px 0 0; }

.card {
  background: var(--qi-white);
  border: 1px solid var(--qi-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-box {
  background: var(--qi-white);
  border: 1px solid var(--qi-border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.stat-box .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--qi-ink); }
.stat-box .label { font-size: 13px; color: var(--qi-muted); margin-top: 2px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--qi-muted);
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--qi-border);
}
.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--qi-border);
  font-size: 14px;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--qi-surface); }
.url-cell { font-family: var(--font-mono); font-size: 12.5px; color: var(--qi-ink-soft); word-break: break-all; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: var(--qi-success-bg); color: var(--qi-success); }
.badge-pending { background: var(--qi-warn-bg); color: var(--qi-warn); }
.badge-error { background: var(--qi-error-bg); color: var(--qi-error); }
.badge-neutral { background: var(--qi-surface-2); color: var(--qi-muted); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.scanning .dot { animation: pulse-dot 1.2s ease-in-out infinite; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--qi-muted); }
.empty-state h3 { color: var(--qi-ink); margin-bottom: 8px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--qi-surface); border-top: 1px solid var(--qi-border); padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.footer-brand p { color: var(--qi-muted); font-size: 14px; max-width: 260px; margin-top: 12px; }
.footer-col h4 { font-size: 13.5px; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--qi-muted); font-size: 14px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--qi-blue); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 22px; border-top: 1px solid var(--qi-border);
  font-size: 13px; color: var(--qi-muted); flex-wrap: wrap; gap: 12px;
}

/* ---------------- Utility ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }

/* ---------------- Scroll reveal ---------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .steps, .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--qi-border); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .app-main { padding: 24px 18px; }
  .trust-stats { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
