@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Space+Grotesk:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg-deep: #0a0a14;
  --bg-mid: #12121f;
  --bg-card: #1a1a2e;
  --accent-violet: #8b5cf6;
  --accent-magenta: #d946ef;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --text-primary: #f0f0f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --glow-violet: rgba(139, 92, 246, 0.3);
  --glow-magenta: rgba(217, 70, 239, 0.2);
  --gradient-hero: linear-gradient(135deg, #0a0a14 0%, #1a0a2e 40%, #0f1a2e 70%, #0a0a14 100%);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #d946ef);
  --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.08), rgba(217, 70, 239, 0.04));
  --border-subtle: rgba(139, 92, 246, 0.15);
  --radius: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* === GEOMETRIC OVERLAY === */
.geo-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 80px, rgba(139, 92, 246, 0.4) 80px, rgba(139, 92, 246, 0.4) 81px),
    repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(139, 92, 246, 0.4) 80px, rgba(139, 92, 246, 0.4) 81px);
}

/* === FLOATING ORBS === */
.orb { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.orb-1 { width: 500px; height: 500px; background: var(--glow-violet); top: -100px; right: -150px; animation: drift 18s ease-in-out infinite; }
.orb-2 { width: 400px; height: 400px; background: var(--glow-magenta); bottom: -80px; left: -120px; animation: drift 22s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: rgba(6, 182, 212, 0.12); top: 40%; left: 50%; transform: translateX(-50%); animation: drift 16s ease-in-out infinite 4s; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.97); }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; font-weight: 800; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mono { font-family: 'Space Mono', monospace; }

/* === LAYOUT === */
.page { position: relative; z-index: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }

/* === NAV === */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
.nav-link:hover { color: var(--text-primary); background: rgba(139, 92, 246, 0.1); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 0 20px var(--glow-violet);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 35px var(--glow-violet); }
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { border-color: var(--accent-violet); background: rgba(139, 92, 246, 0.08); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(139, 92, 246, 0.12); color: var(--text-primary); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === CARDS === */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-accent);
  opacity: 0.4;
}
.card-glow { box-shadow: 0 0 30px var(--glow-violet); }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus { border-color: var(--accent-violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-violet { background: rgba(139, 92, 246, 0.15); color: var(--accent-violet); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-magenta { background: rgba(217, 70, 239, 0.12); color: var(--accent-magenta); border: 1px solid rgba(217, 70, 239, 0.25); }
.badge-cyan { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.25); }
.badge-gold { background: rgba(245, 158, 11, 0.12); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.25); }

/* === EMOTIONAL SCALE COLORS === */
.level-high { color: #34d399; }
.level-mid { color: var(--accent-gold); }
.level-low { color: #f87171; }

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 0 80px;
  background: var(--gradient-hero);
}
.hero-content { max-width: 700px; }
.hero-eyebrow { margin-bottom: 20px; }
.hero-title { margin-bottom: 24px; }
.hero-sub { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 40px; max-width: 540px; line-height: 1.8; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* === FEATURES GRID === */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* === EMOTIONAL SCALE BAR === */
.scale-bar { display: flex; gap: 3px; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.scale-segment { flex: 1; border-radius: 2px; }

/* === VIBE METER === */
.vibe-meter {
  display: flex; align-items: center; gap: 12px;
}
.vibe-dial {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent);
  position: relative;
}
.vibe-dial::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-violet) calc(var(--vibe) * 36deg), transparent 0deg);
  z-index: -1;
  opacity: 0.6;
}

/* === AFFIRMATION CARD === */
.affirmation-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  min-height: 160px;
  display: flex; align-items: center; justify-content: center;
}
.affirmation-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px var(--glow-violet); }
.affirmation-text { font-size: 1.1rem; font-style: italic; line-height: 1.7; color: var(--text-primary); }

/* === TIMELINE / STEPS === */
.step-list { display: flex; flex-direction: column; gap: 16px; }
.step-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.step-num {
  min-width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

/* === SLIDER === */
.slider-wrapper { position: relative; padding: 8px 0; }
.slider {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}
/* Track fill variant — uses CSS custom property --fill set via JS */
.slider.slider-fill {
  background: linear-gradient(to right, var(--accent-violet) 0%, var(--accent-magenta) var(--fill, 50%), rgba(255,255,255,0.1) var(--fill, 50%));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient-accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--glow-violet);
  transition: box-shadow 0.2s;
}
.slider::-webkit-slider-thumb:hover { box-shadow: 0 0 20px var(--glow-violet); }
.slider::-moz-range-thumb {
  width: 24px; height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--glow-violet);
}
.slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}
.slider-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }

/* === PERSONA SELECTOR === */
.persona-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.persona-card {
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  background: rgba(255,255,255,0.02);
}
.persona-card:hover { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.06); }
.persona-card.selected { border-color: var(--accent-violet); background: rgba(139, 92, 246, 0.12); box-shadow: 0 0 20px var(--glow-violet); }
.persona-emoji { font-size: 2.5rem; margin-bottom: 8px; display: block; }
.persona-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; }

/* === GOALS CHIPS === */
.goals-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.goal-chip {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.goal-chip:hover { border-color: rgba(139, 92, 246, 0.4); color: var(--text-primary); }
.goal-chip.selected { border-color: var(--accent-violet); background: rgba(139, 92, 246, 0.15); color: var(--text-primary); box-shadow: 0 0 12px var(--glow-violet); }

/* === DASHBOARD LAYOUT === */
.dash-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; min-height: calc(100vh - 72px); padding-top: 72px; }
.dash-sidebar {
  background: var(--bg-mid);
  border-right: 1px solid var(--border-subtle);
  padding: 32px 20px;
  position: sticky; top: 72px; height: calc(100vh - 72px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.dash-main { padding: 32px 40px; overflow-y: auto; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: none; background: none; font-family: inherit; width: 100%; text-align: left;
}
.sidebar-item:hover { color: var(--text-primary); background: rgba(139, 92, 246, 0.08); }
.sidebar-item.active { color: var(--accent-violet); background: rgba(139, 92, 246, 0.12); font-weight: 600; }
.sidebar-divider { height: 1px; background: var(--border-subtle); margin: 12px 8px; }

/* === PLAN DISPLAY === */
.plan-section { margin-bottom: 32px; }
.plan-section-title {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 16px;
  font-family: 'Space Mono', monospace;
}
.intention-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 24px;
  font-size: 1.05rem;
  line-height: 1.8;
  font-style: italic;
}

/* === CHECKIN MODAL === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.06); border: none; border-radius: 8px;
  color: var(--text-secondary); cursor: pointer; padding: 8px 12px;
  font-size: 1.1rem; line-height: 1; transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); }

/* === LOADING === */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-violet);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* === TOASTS === */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  animation: slideUp 0.3s ease;
  max-width: 340px;
}
.toast-success { background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.3); color: #34d399; }
.toast-error { background: rgba(248, 113, 113, 0.15); border: 1px solid rgba(248, 113, 113, 0.3); color: #f87171; }
.toast-info { background: rgba(139, 92, 246, 0.15); border: 1px solid var(--border-subtle); color: var(--text-primary); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === AUTH PAGE === */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-tabs { display: flex; margin-bottom: 32px; border-bottom: 1px solid var(--border-subtle); }
.auth-tab {
  flex: 1; padding: 12px; text-align: center;
  cursor: pointer; border: none; background: none;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem;
  color: var(--text-muted); letter-spacing: 0.05em;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: var(--accent-violet); border-bottom-color: var(--accent-violet); }

/* === DIVIDER === */
.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 3px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 16px; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .sidebar-divider { display: none; }
  .dash-main { padding: 20px; }
  .persona-grid { grid-template-columns: 1fr 1fr; }
  .hero-cta { flex-direction: column; }
  .modal { padding: 28px 20px; }
}
