/**
 * Prime Self — Premium Visual Design System
 * ==========================================
 * premium.css — Award-winning depth, glass, aurora, and motion layer.
 *
 * Loaded last. Enhances without breaking base layout.
 * Respects prefers-reduced-motion via accessibility.css.
 *
 * Design language: Human Design meets the cosmos.
 * Dark celestial space, gold constellation channels, glass surfaces,
 * aurora light from below — as if the bodygraph itself illuminates the UI.
 */

/* ══════════════════════════════════════════════════════════
   1. COSMIC BACKGROUND SYSTEM
   Layered radial gradients simulating nebula depth.
   ══════════════════════════════════════════════════════════ */

body {
  /* Deep cosmic base — richer than plain #0a0a0a */
  background-color: var(--bg-cosmic);
  background-image:
    /* Aurora pulse — gold-tinted nebula cloud top-right */
    radial-gradient(
      ellipse 70% 45% at 85% 5%,
      rgba(201, 168, 76, 0.07) 0%,
      transparent 60%
    ),
    /* Blue stellar cloud — bottom-left */
    radial-gradient(
      ellipse 60% 40% at 10% 95%,
      rgba(74, 130, 240, 0.06) 0%,
      transparent 55%
    ),
    /* Deep teal undercurrent — center-bottom */
    radial-gradient(
      ellipse 80% 30% at 50% 100%,
      rgba(16, 168, 112, 0.04) 0%,
      transparent 50%
    );
  background-attachment: fixed;
}

/* Animate the background aurora glow (subtle, slow) — desktop only */
@media (prefers-reduced-motion: no-preference) and (min-width: 640px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
      radial-gradient(
        ellipse 50% 35% at 20% 30%,
        rgba(201, 168, 76, 0.08) 0%,
        transparent 65%
      ),
      radial-gradient(
        ellipse 45% 30% at 80% 60%,
        rgba(74, 130, 240, 0.08) 0%,
        transparent 65%
      );
    animation: ps-aurora-drift 18s ease-in-out infinite alternate;
    animation-play-state: paused;
  }
}

/* Opt-in: enable aurora animation when explicitly requested */
body[data-premium-motion="true"]::before {
  animation-play-state: running;
}


/* ══════════════════════════════════════════════════════════
   2. GLASS MORPHISM LAYER
   Cards become floating surfaces above the aurora.
   ══════════════════════════════════════════════════════════ */

.ps-card {
  background: rgba(16, 16, 26, 0.72);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  transition:
    transform var(--duration-normal) cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow var(--duration-normal) cubic-bezier(0.22, 1, 0.36, 1),
    border-color var(--duration-normal) ease;
  position: relative;
  overflow: hidden;
}

/* Subtle top-edge light sheen */
.ps-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 70%,
    transparent
  );
  pointer-events: none;
}

@media (hover: hover) {
  .ps-card:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 168, 76, 0.18);
    box-shadow:
      0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
      0 16px 48px rgba(0, 0, 0, 0.5),
      0 4px 16px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(201, 168, 76, 0.08);
  }
}

.ps-card--elevated {
  background: rgba(20, 20, 34, 0.85);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(201, 168, 76, 0.04);
}


/* ══════════════════════════════════════════════════════════
   3. PREMIUM NAVIGATION BAR
   Frosted glass nav, pill active indicator, SVG icon sizing.
   ══════════════════════════════════════════════════════════ */

.ps-nav {
  /* Viewport-pinned positioning. Originally lived in components/nav-bar.css,
     which was orphaned during the migration to client/styles/. Consolidated
     here so .ps-nav has a single canonical home. See MOBILE_REBUILD_PLAN.md §0. */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;

  display: flex; /* shell anchor-item pattern needs flex parent for flex: 1 to work */
  align-items: stretch;
  background: rgba(7, 10, 20, 0.88);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

/* Mode pill: screen-reader-only label announcing the active workspace.
   It had no CSS at all, so the bare "Practitioner" text rendered as the first
   flex child of the fixed bottom bar — taking content width, stretching full
   height, and shoving the icon row off the left edge. The bar has no room for a
   text label; hide it visually while keeping it for assistive tech, which stops
   the clipping (UI/UX fix 2026-06-29). */
.ps-nav__mode-pill {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* SVG icon sizing override (replaces emoji sizing) */
.ps-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0; /* suppress any text fallback */
  transition: transform var(--duration-fast) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ps-nav__icon svg {
  display: block;
  transition: stroke var(--duration-fast, var(--duration-fast)) ease;
}

/* ── Active pill — gold underline tablet + ambient glow ── */

.ps-nav__item {
  position: relative;
}

/* The gold pill slides in under the active item */
.ps-nav__pip {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-gold-500, #c9a84c);
  opacity: 0;
  transition:
    transform var(--duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity var(--duration-fast) ease;
  pointer-events: none;
}

.ps-nav__item--active .ps-nav__pip {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

/* Active icon bounces up slightly */
@media (prefers-reduced-motion: no-preference) {
  .ps-nav__item--active .ps-nav__icon {
    transform: translateY(-2px);
  }
}

/* Active label color — personal shell gold */
.ps-nav--personal .ps-nav__item--active .ps-nav__label,
.ps-nav--personal .ps-nav__item--active .ps-nav__icon {
  color: var(--color-gold-400, #f0ca65);
}
.ps-nav--personal .ps-nav__item--active .ps-nav__pip {
  background: var(--color-gold-500, #c9a84c);
}

/* Active label color — practitioner shell (brighter gold) */
.ps-nav--practitioner .ps-nav__item--active .ps-nav__label,
.ps-nav--practitioner .ps-nav__item--active .ps-nav__icon {
  color: var(--color-gold-300, #f7d887);
}
.ps-nav--practitioner .ps-nav__item--active .ps-nav__pip {
  background: linear-gradient(90deg, var(--color-gold-400, #f0ca65), var(--color-gold-500, #c9a84c));
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
}

/* Active label color — guided client shell (teal) */
.ps-nav--guided-client .ps-nav__item--active .ps-nav__label,
.ps-nav--guided-client .ps-nav__item--active .ps-nav__icon {
  color: var(--color-teal-300, #5ee8b4);
}
.ps-nav--guided-client .ps-nav__item--active .ps-nav__pip {
  background: var(--color-teal-400, #22c78e);
  box-shadow: 0 0 8px rgba(34, 199, 142, 0.6);
}


/* ══════════════════════════════════════════════════════════
   4. PREMIUM BUTTONS
   Gold shimmer primary, glass secondary, floating tap state.
   ══════════════════════════════════════════════════════════ */

.ps-button--primary {
  background: linear-gradient(
    135deg,
    var(--color-gold-500, #c9a84c) 0%,
    var(--color-gold-400, #f0ca65) 60%,
    var(--color-gold-500, #c9a84c) 100%
  );
  background-size: 200% 100%;
  color: var(--color-black);
  border: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 4px 16px rgba(201, 168, 76, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    background-position var(--duration-slow) ease,
    box-shadow var(--duration-fast) ease,
    transform var(--duration-fast) cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .ps-button--primary:hover:not(:disabled) {
    background-position: 100% 0;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.35) inset,
      0 8px 24px rgba(201, 168, 76, 0.5),
      0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
  }
}

.ps-button--primary:active:not(:disabled) {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 2px 8px rgba(201, 168, 76, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Large primary — extra glow for CTAs */
.ps-button--primary.ps-button--lg {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 8px 32px rgba(201, 168, 76, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
}

.ps-button--secondary {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.ps-button--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(201, 168, 76, 0.3);
  transform: translateY(-1px);
}

.ps-button--ghost {
  color: rgba(255, 255, 255, 0.72); /* AA for interactive text (was 0.6) */
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.ps-button--ghost:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}


/* ══════════════════════════════════════════════════════════
   5. TYPOGRAPHY ENHANCEMENTS
   Display headings in Instrument Serif. Body in Inter.
   ══════════════════════════════════════════════════════════ */

h1, h2, h3, h4,
.ps-display,
.ps-home__title {
  font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
  font-weight: 400; /* Instrument Serif is beautiful at regular weight */
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--color-white, #ffffff);
}

/* Gold shimmer on primary display headings */
.ps-display--shimmer,
.ps-home__greeting h1,
.ps-blueprint__section-title--hero {
  background: linear-gradient(
    105deg,
    var(--color-gold-200, #fae6af) 0%,
    var(--color-gold-400, #f0ca65) 30%,
    var(--color-white, #ffffff) 55%,
    var(--color-gold-400, #f0ca65) 75%,
    var(--color-gold-200, #fae6af) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Shimmer animation — desktop only to avoid mobile jitter */
@media (min-width: 640px) and (prefers-reduced-motion: no-preference) {
  .ps-display--shimmer,
  .ps-home__greeting h1,
  .ps-blueprint__section-title--hero {
    background-size: 200% 100%;
    animation: ps-shimmer-text 6s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-display--shimmer,
  .ps-home__greeting h1,
  .ps-blueprint__section-title--hero {
    background: var(--color-gold-300, #f7d887);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: none;
  }
}

/* Label system — constellation-inspired caps */
.ps-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.7);
}

/* Section headers are SANS, not serif (Visual Language Spec §4.4: the display
   serif is reserved for page titles and ceremony headings at >= --text-2xl —
   never section headers, greetings, or labels). At small/mid sizes Instrument
   Serif reads as unstyled rather than premium, so every BEM __section-title
   uses the body sans with a quiet, wider label treatment. */
[class*="__section-title"] {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-weight: var(--font-semibold, 600);
  letter-spacing: var(--tracking-wide, 0.025em);
  line-height: 1.3;
}

/* Guided-client and practitioner page main titles */
[class*="__title"]:is(h1, h2),
[class*="__welcome-heading"],
[class*="__heading"]:is(h1, h2, h3) {
  font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
  font-weight: 400;
  letter-spacing: 0;
}


/* ══════════════════════════════════════════════════════════
   6. PAGE TRANSITIONS
   Smooth enter for every route change.
   ══════════════════════════════════════════════════════════ */

.ps-page-enter {
  animation: ps-page-reveal 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ps-page-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}


/* ══════════════════════════════════════════════════════════
   7. HOME PAGE — COSMIC IDENTITY HERO
   ══════════════════════════════════════════════════════════ */

.ps-page--home {
  padding-top: var(--space-6, 24px);
  position: relative;
}

/* Ambient orb behind greeting — desktop only, too heavy on small screens */
@media (max-width: 639px) {
  .ps-home__inner::before { display: none; }
}

.ps-home__inner::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 200px;
  background: radial-gradient(
    ellipse,
    rgba(201, 168, 76, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  animation: ps-breathe-orb 8s ease-in-out infinite;
  animation-play-state: paused;
}

/* Opt-in: run breathe-orb on hover or when premium motion enabled */
.ps-home__inner:hover::before,
body[data-premium-motion="true"] .ps-home__inner::before {
  animation-play-state: running;
}

.ps-home__title {
  font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: var(--space-1, 4px);
}

/* Next-action card — premium glow border */
.ps-home__cta-card {
  background: rgba(201, 168, 76, 0.04);
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.08) inset,
    0 8px 32px rgba(201, 168, 76, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Stat row for design facts */
.ps-home__design-row {
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color var(--duration-fast) ease;
}

@media (hover: hover) {
  .ps-home__design-row:hover {
    border-color: rgba(201, 168, 76, 0.15);
  }
}

.ps-home__transit-loading {
  font-size: var(--text-sm, 0.8125rem);
  color: var(--color-text-muted, rgba(255, 255, 255, 0.45));
  margin-top: var(--space-2, 8px);
  font-style: italic;
}


/* ══════════════════════════════════════════════════════════
   8. BLUEPRINT PAGE — IMMERSIVE CHART EXPERIENCE
   ══════════════════════════════════════════════════════════ */

.ps-page--blueprint {
  background: transparent;
  position: relative;
}

/* Constellation background for the chart area */
.ps-blueprint__panel--source::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(201, 168, 76, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(74, 130, 240, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.ps-blueprint__panel--source {
  position: relative;
}

/* Tab nav — premium pill */
.ps-blueprint__nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 10, 20, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ps-blueprint__nav-btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  color: var(--text-muted); /* was rgba(255,255,255,0.4) ~3.5:1 — AA fail */
  border-bottom-width: 2px;
  padding: 14px 16px;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.ps-blueprint__nav-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.ps-blueprint__nav-btn--active {
  color: var(--color-gold-300, #f7d887);
  border-bottom-color: var(--color-gold-500, #c9a84c);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

/* Fact grid — glass cards */
.ps-blueprint__fact {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: var(--space-4, 16px);
  transition: border-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

@media (hover: hover) {
  .ps-blueprint__fact:hover {
    border-color: rgba(201, 168, 76, 0.2);
    transform: translateY(-1px);
  }
}

.ps-blueprint__fact-label {
  color: rgba(201, 168, 76, 0.6);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.ps-blueprint__fact-value {
  color: var(--color-white, #ffffff);
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: 2px;
}


/* ══════════════════════════════════════════════════════════
   9. PRACTITIONER DASHBOARD — STAT CARDS
   ══════════════════════════════════════════════════════════ */

.ps-prac-dash__stat-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: var(--space-4, 16px);
  text-align: center;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  position: relative;
  overflow: hidden;
}

.ps-prac-dash__stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.5), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

@media (hover: hover) {
  .ps-prac-dash__stat-card:hover {
    border-color: rgba(201, 168, 76, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  .ps-prac-dash__stat-card:hover::after {
    opacity: 1;
  }
}

.ps-prac-dash__stat-value {
  font-family: var(--font-serif, 'Instrument Serif', serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 400;
  color: var(--color-gold-300, #f7d887);
  line-height: 1;
  letter-spacing: 0;
}

.ps-prac-dash__stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted); /* was rgba(255,255,255,0.4) ~3.5:1 — AA fail */
  margin-top: 6px;
}


/* ══════════════════════════════════════════════════════════
   10. UPGRADE CTA — STELLAR SURFACE
   ══════════════════════════════════════════════════════════ */

.ps-upgrade-cta {
  background:
    linear-gradient(
      135deg,
      rgba(201, 168, 76, 0.08) 0%,
      rgba(201, 168, 76, 0.02) 60%,
      rgba(74, 130, 240, 0.04) 100%
    );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(201, 168, 76, 0.06);
  position: relative;
  overflow: hidden;
}

/* Star-field shimmer sweep */
.ps-upgrade-cta::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -100%;
  width: 60%;
  height: calc(100% + 4px);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.04),
    transparent
  );
  animation: ps-sheen-sweep 4s ease-in-out 3;
  pointer-events: none;
}

.ps-upgrade-cta__badge {
  font-size: var(--text-3xl);
  filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.6));
  animation: ps-star-pulse 3s ease-in-out 3;
}

.ps-upgrade-cta__feature {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-white, #ffffff);
}

.ps-upgrade-cta__tier {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gold-400, #f0ca65);
  opacity: 0.85;
}


/* ══════════════════════════════════════════════════════════
   11. SKELETON SHIMMER — ENHANCED
   ══════════════════════════════════════════════════════════ */

.ps-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.07) 40%,
    rgba(255, 255, 255, 0.03) 80%
  );
  background-size: 300% 100%;
  border-radius: 6px;
  animation: ps-shimmer 1.8s ease-in-out infinite;
}

.ps-skeleton--rounded { border-radius: 50%; }


/* ══════════════════════════════════════════════════════════
   12. EMPTY STATES — AMBIENT GLOW
   ══════════════════════════════════════════════════════════ */

.ps-empty-state {
  text-align: center;
  padding: var(--space-12, 48px) var(--space-6, 24px);
}

.ps-empty-state__svg {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-5, 20px);
  color: rgba(201, 168, 76, 0.5);
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.2));
}

.ps-empty-state__title {
  font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-white, #ffffff);
  margin: 0 0 var(--space-3, 12px);
  letter-spacing: 0;
}

.ps-empty-state__body {
  font-size: var(--text-sm);
  color: var(--text-muted); /* was rgba(255,255,255,0.45) ~4:1 — AA fail */
  max-width: 280px;
  margin: 0 auto var(--space-6, 24px);
  line-height: 1.6;
}


/* ══════════════════════════════════════════════════════════
   13. SECTION HEADERS — CONSTELLATION STYLE
   ══════════════════════════════════════════════════════════ */

.ps-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.7);
  margin-bottom: var(--space-4, 16px);
}

/* Decorative line extending from section title */
.ps-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(201, 168, 76, 0.3),
    transparent
  );
}


/* ══════════════════════════════════════════════════════════
   14. MODAL — PREMIUM GLASS OVERLAY
   ══════════════════════════════════════════════════════════ */

.ps-modal__overlay {
  background: rgba(7, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ps-modal__dialog {
  background: rgba(16, 16, 26, 0.92);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 8px 32px rgba(0, 0, 0, 0.4);
}


/* ══════════════════════════════════════════════════════════
   15. ALERT — PREMIUM STATUS SYSTEM
   ══════════════════════════════════════════════════════════ */

.ps-alert {
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left-width: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ps-alert--info {
  background: rgba(74, 130, 240, 0.08);
  border-color: rgba(74, 130, 240, 0.5);
}

.ps-alert--success {
  background: rgba(80, 200, 120, 0.08);
  border-color: rgba(80, 200, 120, 0.5);
}

.ps-alert--warning {
  background: rgba(201, 168, 76, 0.08);
  border-color: rgba(201, 168, 76, 0.5);
}

.ps-alert--error {
  background: rgba(224, 80, 80, 0.08);
  border-color: rgba(224, 80, 80, 0.5);
}


/* ══════════════════════════════════════════════════════════
   16. FORM FIELDS — PREMIUM FOCUS
   ══════════════════════════════════════════════════════════ */

.ps-form-field__input,
.ps-form-field__select,
.ps-form-field__textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--color-white, #ffffff);
  transition:
    border-color var(--duration-fast) ease,
    background var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.ps-form-field__input::placeholder,
.ps-form-field__textarea::placeholder {
  color: var(--text-tertiary); /* was rgba(255,255,255,0.25) ~2:1 — too faint */
}

.ps-form-field__input:focus,
.ps-form-field__select:focus,
.ps-form-field__textarea:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.03);
  box-shadow:
    0 0 0 3px rgba(201, 168, 76, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.2);
}


/* ══════════════════════════════════════════════════════════
   17. SCROLL BAR STYLING
   ══════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 168, 76, 0.3);
}


/* ══════════════════════════════════════════════════════════
   18. LOADING SPINNER — GOLD RING
   ══════════════════════════════════════════════════════════ */

.ps-loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(201, 168, 76, 0.15);
  border-top-color: var(--color-gold-500, #c9a84c);
  border-radius: 50%;
  animation: ps-spin 0.8s linear infinite;
  margin: 0 auto;
}

#app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  flex-direction: column;
  gap: var(--space-4, 16px);
}


/* ══════════════════════════════════════════════════════════
   KEYFRAMES — Aurora, Shimmer, Breaths, Sweeps
   ══════════════════════════════════════════════════════════ */

@keyframes ps-aurora-drift {
  0%   { opacity: 0.6; transform: scale(1) rotate(0deg); }
  50%  { opacity: 1;   transform: scale(1.1) rotate(2deg); }
  100% { opacity: 0.7; transform: scale(0.95) rotate(-1deg); }
}

@keyframes ps-breathe-orb {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

@keyframes ps-shimmer-text {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes ps-sheen-sweep {
  0%   { left: -100%; }
  60%  { left: 200%; }
  100% { left: 200%; }
}

@keyframes ps-star-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.5)); }
  50%       { transform: scale(1.12); filter: drop-shadow(0 0 14px rgba(201, 168, 76, 0.9)); }
}

/* Staggered list reveal — apply --stagger-i CSS variable to each child */
.ps-stagger > * {
  animation: ps-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger-i, 0) * 60ms);
}

@keyframes ps-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ══════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════════════════ */

[data-theme="light"] body {
  background-color: var(--color-bg-light);
  background-image:
    radial-gradient(
      ellipse 70% 45% at 85% 5%,
      rgba(201, 168, 76, 0.06) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 40% at 10% 95%,
      rgba(74, 130, 240, 0.04) 0%,
      transparent 55%
    );
}

[data-theme="light"] .ps-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .ps-nav {
  background: rgba(250, 247, 242, 0.92);
  border-top-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ps-nav__item {
  color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .ps-nav--personal .ps-nav__item--active .ps-nav__label,
[data-theme="light"] .ps-nav--personal .ps-nav__item--active .ps-nav__icon {
  color: var(--color-gold-600, #a88840);
}

[data-theme="light"] .ps-blueprint__fact {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.07);
}

/* Light theme modal & dialog overrides */
[data-theme="light"] .ps-modal {
  background: rgba(250, 247, 242, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ps-modal__backdrop {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .ps-modal__overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Light theme form field overrides */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] input:focus-visible,
[data-theme="light"] textarea:focus-visible,
[data-theme="light"] select:focus-visible {
  border-color: var(--color-gold-500, #c9a84c);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

[data-theme="light"] .ps-form-field .ps-error-text {
  color: var(--color-error-light-bg);
}

/* Light theme button overrides */
[data-theme="light"] .ps-button--primary {
  background: linear-gradient(135deg, #f0ca65, #c9a84c);
  color: rgba(0, 0, 0, 0.87);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.25);
}

[data-theme="light"] .ps-button--primary:hover {
  box-shadow: 0 6px 16px rgba(201, 168, 76, 0.35);
}

[data-theme="light"] .ps-button--secondary {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.87);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ps-button--secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ps-button--ghost {
  color: var(--color-gold-600, #a88840);
}

[data-theme="light"] .ps-button--ghost:hover {
  background: rgba(201, 168, 76, 0.08);
}

[data-theme="light"] .ps-button--danger {
  background: var(--color-danger-material);
  color: var(--color-white);
}

/* Light theme alert overrides */
[data-theme="light"] .ps-alert {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ps-alert--info {
  background: rgba(66, 133, 244, 0.08);
  border-color: rgba(66, 133, 244, 0.3);
  color: var(--color-info-text);
}

[data-theme="light"] .ps-alert--success {
  background: rgba(76, 175, 80, 0.08);
  border-color: rgba(76, 175, 80, 0.3);
  color: var(--color-success-text);
}

[data-theme="light"] .ps-alert--error {
  background: rgba(244, 67, 54, 0.08);
  border-color: rgba(244, 67, 54, 0.3);
  color: var(--color-error-text);
}

/* Light theme skeleton overrides */
[data-theme="light"] .ps-skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: ps-shimmer-light 2s infinite;
}

@keyframes ps-shimmer-light {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Light theme scrollbar overrides */
[data-theme="light"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: transparent;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Light theme empty state overrides */
[data-theme="light"] .ps-empty-state {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .ps-empty-state__title {
  color: rgba(0, 0, 0, 0.87);
}

/* Light theme upgrade CTA overrides */
[data-theme="light"] .ps-upgrade-cta {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(255, 255, 255, 0.3));
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.12);
}

[data-theme="light"] .ps-upgrade-cta__badge {
  background: rgba(201, 168, 76, 0.08);
  color: var(--color-gold-600, #a88840);
}

[data-theme="light"] .ps-upgrade-cta__title {
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] .ps-upgrade-cta__description {
  color: rgba(0, 0, 0, 0.6);
}

/* Light theme practitioner dashboard overrides */
[data-theme="light"] .ps-prac-dash__stat-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ps-prac-dash__stat-label {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .ps-prac-dash__stat-value {
  color: rgba(0, 0, 0, 0.87);
}

/* Light theme section headers overrides */
[data-theme="light"] .ps-section-header {
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] .ps-section-header::before {
  background: rgba(201, 168, 76, 0.3);
}

/* Light theme bodygraph overrides */
[data-theme="light"] .ps-bodygraph {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .ps-bodygraph__center {
  fill: rgba(255, 255, 255, 0.6);
  stroke: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ps-bodygraph__channel {
  stroke: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .ps-bodygraph__gate-badge {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.87);
}

/* Light theme guided client page overrides */
[data-theme="light"] .ps-gc-banner {
  background: rgba(34, 199, 142, 0.08);
  border-color: rgba(34, 199, 142, 0.2);
}

[data-theme="light"] .ps-gc-banner__name,
[data-theme="light"] .ps-gc-banner__practice {
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] .ps-gc-banner__contact {
  color: rgba(0, 0, 0, 0.6);
}

/* Light theme pill/badge overrides */
[data-theme="light"] .ps-pill,
[data-theme="light"] .ps-badge {
  background: rgba(201, 168, 76, 0.12);
  color: var(--color-gold-600, #a88840);
  border-color: rgba(201, 168, 76, 0.2);
}

/* Light theme heading color */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] .ps-display {
  color: rgba(0, 0, 0, 0.87);
}

[data-theme="light"] p, [data-theme="light"] li {
  color: rgba(0, 0, 0, 0.6);
}


/* ══════════════════════════════════════════════════════════
   SUNRISE THEME — Dawn sky ambience
   Light-mode overrides for home page hero and ambient orb.
   ══════════════════════════════════════════════════════════ */

/* Dawn gradient wash across the home page background */
[data-theme="light"] .ps-page--home {
  background: linear-gradient(
    180deg,
    #fdf6ee 0%,       /* soft amber dawn */
    #faf7f2 55%,      /* warm ivory */
    #f0ebe3 100%      /* parchment base */
  );
}

/* Replace cosmic gold orb with rose-gold dawn warmth */
[data-theme="light"] .ps-home__inner::before {
  background: radial-gradient(
    ellipse,
    rgba(196, 122, 138, 0.14) 0%,   /* rose-gold (Sunrise --gold) */
    rgba(240, 178, 102, 0.07) 45%,  /* amber warmth */
    transparent 70%
  );
}

/* Warmer blueprint hero title in Sunrise */
[data-theme="light"] .ps-blueprint__section-title--hero {
  background: linear-gradient(
    135deg,
    #c47a8a 0%,   /* rose-gold */
    #d4956a 100%  /* warm amber */
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION SAFETY NET
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  .ps-home__inner::before { display: none; }
  .ps-upgrade-cta::before { display: none; }
  .ps-upgrade-cta__badge { animation: none; }
  .ps-display--shimmer,
  .ps-home__greeting h1 { animation: none; }
  .ps-prac-dash__stat-value { font-family: inherit; }
  .ps-stagger > * { animation: none; opacity: 1; transform: none; }
  .ps-page-enter { animation: none; opacity: 1; transform: none; filter: none; }
}
