/* ═══════════════════════════════════════════════════════════════════
   AURALIS · Onboarding v2.0 — chat.php token system
   ───────────────────────────────────────────────────────────────────
   Visual recipes идват от base.css (.glass, .icon-btn, etc.)
   Тук са САМО onboarding-specific layouts.
   ═══════════════════════════════════════════════════════════════════ */

/* ───── Container fade ───── */

#app {
  opacity: 1;
  transition: opacity 200ms ease;
}

#app.is-fading {
  opacity: 0;
}

.ob-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
  animation: fadeInUp 0.5s var(--ease-spring) both;
}

/* ═══════════════════════════════════════════════════════════════════
   TOP ROW · back (left) + progress dots (center)
   ═══════════════════════════════════════════════════════════════════ */

.ob-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.ob-back-spacer {
  display: block;
  width: 40px;
  height: 40px;
}

.ob-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-icon);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease);
}

[data-theme="light"] .ob-dot,
:root:not([data-theme]) .ob-dot {
  background: var(--surface);
  box-shadow: var(--shadow-pressed);
}

[data-theme="dark"] .ob-dot {
  background: hsl(220 25% 12%);
}

.ob-dot.active {
  transform: scale(1.5);
  background: var(--accent);
  box-shadow: 0 2px 8px hsl(var(--hue1) 70% 50% / 0.45);
}

[data-theme="dark"] .ob-dot.active {
  background: hsl(var(--hue1) 80% 65%);
  box-shadow: 0 0 12px hsl(var(--hue1) 80% 60% / 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 1 · Wave illustration
   ═══════════════════════════════════════════════════════════════════ */

.ob-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  min-height: 130px;
}

.ob-wave {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.ob-wave-primary {
  animation: ob-wave-pulse 4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes ob-wave-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   TITLES & SUBTITLES
   ═══════════════════════════════════════════════════════════════════ */

.ob-title {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
  margin: 0;
}

.ob-title--sm {
  font-size: 18px;
  font-weight: 800;
}

.ob-subtitle {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 320px;
  margin: -6px auto 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 2 · Value cards (HTML има class="glass ob-value-card")
   ═══════════════════════════════════════════════════════════════════ */

.ob-value-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Beta callout card — преди value cards */
.ob-beta-card {
  position: relative;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid hsl(var(--hue3) 65% 55%);
}
.ob-beta-card > * { position: relative; z-index: 5; }
[data-theme="light"] .ob-beta-card,
:root:not([data-theme]) .ob-beta-card {
  background: var(--surface);
  box-shadow: var(--shadow-card-sm);
  border: none;
  border-left: 3px solid hsl(var(--hue3) 65% 55%);
}
[data-theme="dark"] .ob-beta-card {
  background:
    linear-gradient(235deg, hsl(var(--hue3) 50% 12% / .6), hsl(var(--hue3) 50% 12% / 0) 50%),
    linear-gradient(hsl(220 25% 5% / .8));
  backdrop-filter: blur(8px);
}
.ob-beta-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--hue3) 60% 55%);
  margin-bottom: 6px;
}
[data-theme="dark"] .ob-beta-title { color: hsl(var(--hue3) 70% 70%); }
.ob-beta-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

.ob-value-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.ob-value-card > * { position: relative; z-index: 5; }

.ob-value-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-icon);
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
}

[data-theme="light"] .ob-value-icon,
:root:not([data-theme]) .ob-value-icon {
  background: var(--surface);
  box-shadow: var(--shadow-pressed);
  border: none;
}

[data-theme="dark"] .ob-value-icon {
  background: hsl(220 25% 4%);
}

.ob-value-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .ob-value-icon svg {
  stroke: hsl(var(--hue1) 80% 70%);
}

.ob-value-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ob-value-heading {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0;
}

.ob-value-body {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 2 · Timeline (.glass)
   ═══════════════════════════════════════════════════════════════════ */

.ob-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
}

.ob-timeline > * { position: relative; z-index: 5; }

.ob-timeline-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
  margin: 0;
}

.ob-timeline-label {
  color: var(--text-muted);
  font-weight: 600;
}

.ob-timeline-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

[data-theme="light"] .ob-timeline-value,
:root:not([data-theme]) .ob-timeline-value {
  color: hsl(var(--hue2) 60% 40%);
}

[data-theme="dark"] .ob-timeline-value {
  color: hsl(var(--hue3) 70% 65%);
}

.ob-disclaimer-soft {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 3 · Consent (.glass)
   ═══════════════════════════════════════════════════════════════════ */

.ob-consent-card {
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ob-consent-card > * { position: relative; z-index: 5; }

.ob-consent-intro {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin: 0;
}

.ob-consent-footer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

[data-theme="light"] .ob-consent-footer,
:root:not([data-theme]) .ob-consent-footer {
  border-top: 1px solid hsl(220 18% 80%);
}

.ob-consent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ob-consent-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.ob-consent-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.ob-consent-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ob-consent-line--no .ob-consent-icon { color: var(--text-faint); }
.ob-consent-line--yes .ob-consent-icon { color: var(--success); }

.ob-consent-text { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM CHECKBOX (neumorphism light / glass dark)
   ═══════════════════════════════════════════════════════════════════ */

.ob-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}

[data-theme="light"] .ob-checkbox-wrap:hover,
:root:not([data-theme]) .ob-checkbox-wrap:hover {
  background: hsl(220 18% 85%);
}

[data-theme="dark"] .ob-checkbox-wrap:hover {
  background: hsl(220 25% 8%);
}

.ob-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ob-checkbox-box {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

[data-theme="light"] .ob-checkbox-box,
:root:not([data-theme]) .ob-checkbox-box {
  background: var(--surface);
  box-shadow: var(--shadow-card-sm);
}

[data-theme="dark"] .ob-checkbox-box {
  background: hsl(220 25% 8%);
  border: 1.5px solid hsl(220 15% 30%);
}

.ob-checkbox-mark {
  opacity: 0;
  transform: scale(0.6);
  display: inline-flex;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease-spring);
}

.ob-checkbox-mark svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ob-checkbox:checked + .ob-checkbox-box {
  background: linear-gradient(135deg, hsl(var(--hue1) 70% 55%), hsl(var(--hue2) 65% 55%));
  box-shadow: 0 4px 12px hsl(var(--hue1) 60% 50% / 0.4);
  border: none;
}

.ob-checkbox:checked + .ob-checkbox-box .ob-checkbox-mark {
  opacity: 1;
  transform: scale(1);
}

.ob-checkbox:focus-visible + .ob-checkbox-box {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ob-checkbox-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   CTA · wide pill primary button
   ═══════════════════════════════════════════════════════════════════ */

.ob-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.005em;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: white;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}

[data-theme="light"] .btn-cta,
:root:not([data-theme]) .btn-cta {
  background: linear-gradient(135deg, hsl(var(--hue1) 65% 55%), hsl(var(--hue2) 60% 55%));
  box-shadow:
    0 6px 16px hsl(var(--hue1) 60% 50% / 0.35),
    inset 0 1px 0 hsl(0 0% 100% / 0.3);
}

[data-theme="dark"] .btn-cta {
  background: linear-gradient(135deg, hsl(var(--hue1) 80% 60%), hsl(var(--hue2) 80% 60%));
  box-shadow:
    0 6px 18px hsl(var(--hue1) 70% 50% / 0.55),
    inset 0 1px 0 hsl(0 0% 100% / 0.2);
}

.btn-cta:active { transform: scale(var(--press)); }

.btn-cta[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-cta[disabled]:active { transform: none; }

.btn-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════════
   HH3: VIDEO CTA
   ═══════════════════════════════════════════════════════════════════ */

.ob-video-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px auto 0;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ob-video-cta:hover,
.ob-video-cta:focus-visible {
  color: hsl(38 80% 55%);
  border-color: hsl(38 80% 55% / 0.4);
  outline: none;
}
.ob-video-icon { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════
   AA1: WELCOME SCREEN ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.ob-welcome-logo {
  animation: obLogoFadeIn 800ms var(--ease) both;
}
.ob-welcome-subtitle {
  animation: obSlideUp 400ms var(--ease) 600ms both;
}
.ob-welcome-cta {
  animation: obScaleIn 300ms var(--ease-spring) 1200ms both;
}
.ob-welcome-aurora {
  animation: obAuroraBreathe 8s ease-in-out infinite;
}

@keyframes obLogoFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes obSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes obScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes obAuroraBreathe {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.02); }
}

/* ═══════════════════════════════════════════════════════════════════
   AA2: VALUE SCREEN CARD STAGGER
   ═══════════════════════════════════════════════════════════════════ */

.ob-value-card {
  animation: obSlideUp 400ms var(--ease) both;
}
.ob-value-card:nth-child(1) { animation-delay: 0ms; }
.ob-value-card:nth-child(2) { animation-delay: 200ms; }
.ob-value-card:nth-child(3) { animation-delay: 400ms; }

.ob-beta-callout {
  animation: obPulseGlow 1.5s ease 600ms both;
}
@keyframes obPulseGlow {
  0%   { box-shadow: 0 0 0 0 hsl(38 80% 55% / 0.5); }
  50%  { box-shadow: 0 0 20px 4px hsl(38 80% 55% / 0.3); }
  100% { box-shadow: 0 0 0 0 hsl(38 80% 55% / 0); }
}

/* ═══════════════════════════════════════════════════════════════════
   AA4: PROFILE REVEAL
   ═══════════════════════════════════════════════════════════════════ */

.ob-calculating {
  animation: obLogoFadeIn 300ms ease both;
}
.ob-profile-code {
  animation: obTypewriter 1.2s steps(4) 300ms both;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid hsl(38 80% 55%);
  width: 4ch;
}
@keyframes obTypewriter {
  from { width: 0; }
  to   { width: 4ch; }
}
.ob-profile-name {
  animation: obLogoFadeIn 500ms ease 1600ms both;
}
.ob-profile-desc {
  animation: obSlideUp 400ms var(--ease) 2000ms both;
}
.ob-profile-cta {
  animation: obScaleIn 300ms var(--ease-spring) 2400ms both;
}

/* ═══════════════════════════════════════════════════════════════════
   AA5: PAGE TRANSITIONS
   ═══════════════════════════════════════════════════════════════════ */

.ob-transition-forward {
  animation: obSlideLeft 250ms ease-out both;
}
.ob-transition-back {
  animation: obSlideRight 250ms ease-out both;
}
@keyframes obSlideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes obSlideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   REDUCED MOTION (a11y)
   ═══════════════════════════════════════════════════════════════════ */

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