/* ═══════════════════════════════════════════════════════
   TELOIS — v2 SHARED design system
   Applies to body.v2 — universal across all pages.
   Adds: obsidian bg, aurora gradient, neon palette,
   strong cards, magnetic buttons, auto-hide nav.
═══════════════════════════════════════════════════════ */

body.v2 {
  --v2-obsidian:     #07081A;
  --v2-obsidian-2:   #0E1030;
  --v2-obsidian-3:   #161A45;

  --v2-violet:       #8B3FB8;
  --v2-violet-bright:#B96AFF;
  --v2-indigo:       #3D2773;
  --v2-rose:         #E78AA0;
  --v2-gold:         #F0D27A;
  --v2-gold-bright:  #FFE9A8;
  --v2-amber:        #D9B445;
  --v2-cyan:         #4DD4FF;
  --v2-cream:        #F5EFE6;

  --v2-text:         #F5EFE6;
  --v2-text-dim:     rgba(245, 239, 230, 0.78);
  --v2-text-muted:   rgba(245, 239, 230, 0.6);

  --v2-glass-bg:     rgba(255, 255, 255, 0.06);
  --v2-glass-border: rgba(255, 255, 255, 0.16);
  --v2-glass-hi:     rgba(255, 255, 255, 0.28);

  --v2-r-card:       24px;
}

/* ════════════════════════════════════════
   BASE — Obsidian + Aurora gradient
════════════════════════════════════════ */
body.v2 {
  background: var(--v2-obsidian);
  color: var(--v2-text);
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
}

html:has(body.v2) {
  overflow-x: hidden;
}

body.v2::before {
  content: '';
  position: fixed;
  inset: -20vh -20vw;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(55vw 65vh at 15% 20%, rgba(139, 63, 184, 0.55), transparent 60%),
    radial-gradient(50vw 60vh at 85% 25%, rgba(231, 138, 160, 0.45), transparent 60%),
    radial-gradient(65vw 75vh at 50% 95%, rgba(240, 210, 122, 0.25), transparent 65%),
    radial-gradient(45vw 55vh at 80% 75%, rgba(61, 39, 115, 0.6), transparent 60%);
  filter: blur(50px) saturate(1.4);
  animation: v2-aurora-drift 28s ease-in-out infinite alternate;
}

body.v2::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 60% at center, transparent 40%, rgba(7, 8, 26, 0.55) 100%);
}

@keyframes v2-aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1);    filter: blur(50px) saturate(1.4) hue-rotate(0deg);  }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); filter: blur(60px) saturate(1.5) hue-rotate(-10deg); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.03); filter: blur(55px) saturate(1.45) hue-rotate(6deg);  }
}

/* Hide old stars-bg on v2 pages */
body.v2 .stars-bg { display: none; }

/* ════════════════════════════════════════
   WebGL canvas — full-screen, dimmed for legibility
════════════════════════════════════════ */
body.v2 .webgl-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at center, transparent 0%, rgba(0,0,0,0.4) 45%, black 80%);
  mask-image: radial-gradient(ellipse 60% 50% at center, transparent 0%, rgba(0,0,0,0.4) 45%, black 80%);
}

/* ════════════════════════════════════════
   CUSTOM CURSOR — gold arrow + glow halo
════════════════════════════════════════ */
@media (hover: hover) and (min-width: 900px) {
  body.v2:not(.no-cursor-fx) { cursor: none; }
  body.v2:not(.no-cursor-fx) a,
  body.v2:not(.no-cursor-fx) button,
  body.v2:not(.no-cursor-fx) input,
  body.v2:not(.no-cursor-fx) textarea { cursor: none; }
}

body.v2 .cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle, rgba(240, 210, 122, 0.14) 0%, rgba(231, 138, 160, 0.07) 40%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.3s ease, width 0.25s ease, height 0.25s ease, background 0.3s ease;
  will-change: transform;
}

body.v2 .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.v2 .cursor-arrow {
  width: 22px;
  height: 22px;
  filter:
    drop-shadow(0 0 8px rgba(240, 210, 122, 0.9))
    drop-shadow(0 0 18px rgba(240, 210, 122, 0.5))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: filter 0.2s ease;
}

body.v2.cursor-active .cursor-glow {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(231, 138, 160, 0.18) 0%, rgba(240, 210, 122, 0.10) 40%, transparent 70%);
}

body.v2.cursor-active .cursor-arrow {
  filter:
    drop-shadow(0 0 10px rgba(231, 138, 160, 0.95))
    drop-shadow(0 0 22px rgba(231, 138, 160, 0.6))
    drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}

body.v2.cursor-active .cursor-arrow path { fill: #E78AA0; }

@media (max-width: 900px), (hover: none) {
  body.v2 .cursor-glow,
  body.v2 .cursor-dot { display: none; }
}

/* ════════════════════════════════════════
   NAV — always visible, blurred backdrop on scroll
════════════════════════════════════════ */
body.v2 .nav {
  background: transparent;
  border-bottom: 0;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

body.v2 .nav.scrolled {
  background: rgba(7, 8, 26, 0.55);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.v2 .nav-logo {
  background: linear-gradient(135deg, var(--v2-gold) 0%, var(--v2-rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.18em;
  font-weight: 800;
}

/* ════════════════════════════════════════
   BUTTONS — Liquid gold
════════════════════════════════════════ */
body.v2 .btn-primary {
  background: linear-gradient(135deg, var(--v2-gold) 0%, var(--v2-amber) 50%, #B8932A 100%);
  background-size: 200% 200%;
  color: #07081A;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(240, 210, 122, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.v2 .btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transition: left 0.6s ease;
}

body.v2 .btn-primary:hover {
  background-position: 100% 100%;
  transform: translateY(-3px);
  box-shadow:
    0 16px 50px rgba(240, 210, 122, 0.55),
    0 0 0 1px rgba(240, 210, 122, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.v2 .btn-primary:hover::before { left: 100%; }

body.v2 .btn-outline {
  border: 1.5px solid rgba(240, 210, 122, 0.45);
  color: var(--v2-gold);
  background: transparent;
  transition: all 0.3s ease;
}

body.v2 .btn-outline:hover {
  background: rgba(240, 210, 122, 0.08);
  border-color: var(--v2-gold);
  transform: translateY(-2px);
}

body.v2 .btn-ghost {
  color: rgba(245, 239, 230, 0.78);
}
body.v2 .btn-ghost:hover {
  color: var(--v2-gold);
}

/* ════════════════════════════════════════
   GLASS CARDS — generic
   (q-card from questionnaire, kyc-step, etc.)
════════════════════════════════════════ */
/* Card visual upgrade — keep entrance animations intact */
body.v2 .q-card,
body.v2 .q-pledge-card,
body.v2 .auth-box,
body.v2 .kyc-step,
body.v2 .onb-card {
  background:
    linear-gradient(160deg, rgba(15, 16, 38, 0.85) 0%, rgba(7, 8, 26, 0.78) 60%, rgba(20, 16, 40, 0.82) 100%);
  border: 1.5px solid rgba(240, 210, 122, 0.35);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-radius: var(--v2-r-card);
  box-shadow:
    0 0 30px rgba(240, 210, 122, 0.18),
    0 0 60px rgba(240, 210, 122, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(240, 210, 122, 0.03);
}

/* Breathing glow without overriding entrance fades — uses ::before pseudo */
body.v2 .q-card,
body.v2 .q-pledge-card,
body.v2 .auth-box,
body.v2 .kyc-step,
body.v2 .onb-card {
  position: relative;
}

body.v2 .q-card::after,
body.v2 .q-pledge-card::after,
body.v2 .auth-box::after,
body.v2 .kyc-step::after,
body.v2 .onb-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  box-shadow: 0 0 50px rgba(240, 210, 122, 0.15);
  animation: v2-card-breathe-glow 6s ease-in-out infinite;
}

@keyframes v2-card-breathe-glow {
  0%, 100% { box-shadow: 0 0 50px rgba(240, 210, 122, 0.15);  }
  50%      { box-shadow: 0 0 80px rgba(240, 210, 122, 0.35);  }
}

/* ════════════════════════════════════════
   FORM INPUTS
════════════════════════════════════════ */
body.v2 input[type="text"],
body.v2 input[type="email"],
body.v2 input[type="tel"],
body.v2 input[type="password"],
body.v2 input[type="number"],
body.v2 textarea,
body.v2 select {
  background: rgba(7, 8, 26, 0.6);
  border: 1.5px solid rgba(240, 210, 122, 0.25);
  color: var(--v2-text);
  border-radius: 12px;
  transition: all 0.3s ease;
}

body.v2 input:focus,
body.v2 textarea:focus,
body.v2 select:focus {
  outline: 0;
  border-color: var(--v2-gold);
  box-shadow:
    0 0 0 3px rgba(240, 210, 122, 0.15),
    0 0 24px rgba(240, 210, 122, 0.25);
}

/* ════════════════════════════════════════
   HEADINGS — readable on aurora bg
════════════════════════════════════════ */
body.v2 h1, body.v2 h2, body.v2 h3 {
  text-shadow:
    0 2px 24px rgba(7, 8, 26, 0.75),
    0 0 60px rgba(7, 8, 26, 0.4);
}

body.v2 .gold-text,
body.v2 .text-gold {
  background: linear-gradient(135deg, var(--v2-gold) 0%, var(--v2-rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ════════════════════════════════════════
   QUESTIONNAIRE OPTIONS — neon hover
════════════════════════════════════════ */
body.v2 .q-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: var(--v2-text);
  border-radius: 14px;
  transition: all 0.3s ease;
}

body.v2 .q-opt:hover {
  border-color: rgba(240, 210, 122, 0.5);
  background: rgba(240, 210, 122, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(240, 210, 122, 0.18);
}

body.v2 .q-opt.selected,
body.v2 .q-opt[data-selected="true"] {
  border-color: var(--v2-gold);
  background: linear-gradient(135deg, rgba(240, 210, 122, 0.18), rgba(231, 138, 160, 0.10));
  box-shadow:
    0 0 0 1px var(--v2-gold) inset,
    0 0 24px rgba(240, 210, 122, 0.4);
}

/* ════════════════════════════════════════
   PROGRESS BARS — aurora gradient
════════════════════════════════════════ */
body.v2 .onb-progress-fill,
body.v2 .progress-fill {
  background: linear-gradient(90deg, var(--v2-gold), var(--v2-rose), var(--v2-violet-bright));
  box-shadow: 0 0 12px rgba(240, 210, 122, 0.5);
}

/* ════════════════════════════════════════
   FLOATING ADVISOR BUTTON
════════════════════════════════════════ */
body.v2 .advisor-float__btn {
  background: linear-gradient(135deg, var(--v2-gold), var(--v2-rose));
  box-shadow:
    0 8px 30px rgba(240, 210, 122, 0.5),
    0 0 50px rgba(231, 138, 160, 0.3);
}

body.v2 .advisor-float__ring {
  background: linear-gradient(135deg, var(--v2-gold), var(--v2-rose));
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
body.v2 .footer {
  border-top: 1px solid var(--v2-glass-border);
  background: rgba(7, 8, 26, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.v2 .footer-logo {
  background: linear-gradient(135deg, var(--v2-gold), var(--v2-rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.18em;
}

body.v2 .footer-links a {
  color: rgba(245, 239, 230, 0.55);
  transition: color 0.3s ease;
}

body.v2 .footer-links a:hover { color: var(--v2-gold); }

/* ════════════════════════════════════════
   ACCESSIBILITY
════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  body.v2 *,
  body.v2 *::before,
  body.v2 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
