:root {
  --ink: #0a0a1a;
  --mist: #e8e4f0;
  --violet: #6b4ce6;
  --violet-soft: #8b6fef;
  --lavender: #c4b5fd;
  --glow: #a78bfa;
  --cream: #faf8ff;
  --deep: #1a1033;
  --card: rgba(107, 76, 230, 0.06);
  --border: rgba(107, 76, 230, 0.12);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --nav-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ink);
  color: var(--cream);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
}

#app {
  min-height: 100vh;
  position: relative;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3 { font-family: 'Syne', sans-serif; letter-spacing: -0.02em; }

/* ─── AUTH PAGES ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--cream);
}
.auth-logo span { color: var(--glow); }

.auth-box {
  width: 100%;
  max-width: 400px;
  margin-top: 2rem;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-sub {
  color: var(--lavender);
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--lavender);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--violet);
  background: rgba(107, 76, 230, 0.06);
}
.form-input::placeholder { color: rgba(196, 181, 253, 0.3); }

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.9rem 2rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--violet);
  color: white;
  box-shadow: 0 0 20px rgba(107, 76, 230, 0.2);
}
.btn-primary:hover { background: var(--violet-soft); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--lavender);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--glow); color: var(--cream); }

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--lavender);
  font-size: 0.9rem;
}
.auth-switch a {
  color: var(--glow);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-home {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  color: var(--lavender);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.auth-home:hover { opacity: 1; }

/* ─── ONBOARDING ─── */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.onboarding-box {
  width: 100%;
  max-width: 500px;
}

.onboarding-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.onboarding-q {
  color: var(--lavender);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.schredl-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.schredl-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.schredl-option:hover, .schredl-option.selected {
  border-color: var(--violet);
  background: rgba(107, 76, 230, 0.08);
}
.schredl-option .score {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--violet);
  opacity: 0.5;
  width: 28px;
  text-align: center;
}
.schredl-option.selected .score { opacity: 1; }
.schredl-option .label {
  font-size: 0.95rem;
  color: var(--cream);
}

.lang-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.lang-btn {
  flex: 1;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--lavender);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.lang-btn.selected {
  border-color: var(--violet);
  background: rgba(107, 76, 230, 0.08);
  color: var(--cream);
}

/* ─── APP LAYOUT ─── */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.app-header {
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
}

.app-header-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--cream);
}
.app-header-logo span { color: var(--glow); }

.header-streak {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--glow);
  font-weight: 500;
}

.app-content {
  flex: 1;
  padding: 0.5rem 1.5rem 2rem;
}

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(107, 76, 230, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.5rem 0.75rem;
  color: rgba(196, 181, 253, 0.4);
  text-decoration: none;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: var(--glow); }
.nav-item svg { width: 22px; height: 22px; }

.nav-item-add {
  background: var(--violet);
  color: white !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -12px;
  box-shadow: 0 0 20px rgba(107, 76, 230, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-item-add:active {
  transform: scale(0.92);
}
.nav-item-add svg { width: 24px; height: 24px; }

/* ─── DASHBOARD ─── */
.greeting {
  font-size: 1.1rem;
  color: var(--lavender);
  font-weight: 300;
  margin-bottom: 0.25rem;
}

.greeting-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(145deg, var(--card), rgba(10, 10, 26, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(107, 76, 230, 0.25); }

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-value .unit {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--lavender);
  margin-left: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--lavender);
  letter-spacing: 0.05em;
}

.stat-card.streak .stat-value { color: var(--warning); }
.stat-card.recall .stat-value { color: var(--success); }

/* Quick action */
.quick-action {
  background: linear-gradient(135deg, rgba(107, 76, 230, 0.15), rgba(107, 76, 230, 0.05));
  border: 1px solid rgba(107, 76, 230, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
  -webkit-tap-highlight-color: transparent;
}
.quick-action:hover {
  border-color: var(--violet);
  background: linear-gradient(135deg, rgba(107, 76, 230, 0.2), rgba(107, 76, 230, 0.08));
}
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon svg { width: 22px; height: 22px; color: white; }
.quick-action-text h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.quick-action-text p {
  font-size: 0.85rem;
  color: var(--lavender);
  font-weight: 300;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}
.section-link {
  font-size: 0.85rem;
  color: var(--glow);
  text-decoration: none;
  cursor: pointer;
}

/* Dream Card */
.dream-card {
  background: linear-gradient(145deg, var(--card), rgba(10, 10, 26, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.dream-card:hover { border-color: rgba(107, 76, 230, 0.25); }

.dream-card-date {
  font-size: 0.75rem;
  color: var(--lavender);
  opacity: 0.7;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.dream-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.dream-card-excerpt {
  font-size: 0.9rem;
  color: var(--lavender);
  font-weight: 300;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dream-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag-pill {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: rgba(107, 76, 230, 0.12);
  color: var(--lavender);
  border: 1px solid rgba(107, 76, 230, 0.15);
}

.clarity-dots {
  display: flex;
  gap: 3px;
  margin-top: 0.5rem;
}
.clarity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(107, 76, 230, 0.2);
}
.clarity-dot.filled { background: var(--violet); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.empty-sub {
  color: var(--lavender);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── NEW DREAM ─── */
.new-dream-page {
  padding-bottom: 100px;
}

.page-back {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--lavender);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 1rem;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  font-family: inherit;
}
.page-back:hover { color: var(--cream); }
.page-back svg { width: 18px; height: 18px; }

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* REVER Steps */
.rever-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
}
.rever-dot {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: rgba(107, 76, 230, 0.15);
  transition: background 0.3s;
}
.rever-dot.active { background: var(--violet); }
.rever-dot.done { background: var(--success); }

.step-section {
  margin-bottom: 2rem;
}

.step-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--glow);
  margin-bottom: 0.5rem;
}

.step-prompt {
  color: var(--lavender);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: 300;
}

.dream-textarea {
  width: 100%;
  min-height: 180px;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.dream-textarea:focus {
  border-color: var(--violet);
  background: rgba(107, 76, 230, 0.04);
}
.dream-textarea::placeholder { color: rgba(196, 181, 253, 0.3); }

.recurrence-textarea {
  min-height: 80px;
}

/* Emotion Picker */
.emotion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.emotion-btn {
  padding: 0.6rem 1rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--lavender);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.emotion-btn:hover, .emotion-btn.selected {
  border-color: var(--violet);
  background: rgba(107, 76, 230, 0.12);
  color: var(--cream);
}

/* Clarity Slider */
.clarity-slider-wrap {
  padding: 0.5rem 0;
}
.clarity-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(107, 76, 230, 0.15);
  outline: none;
}
.clarity-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(107, 76, 230, 0.4);
}
.clarity-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
  border: none;
}
.clarity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--lavender);
  opacity: 0.6;
  margin-top: 0.5rem;
}
.clarity-value {
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--violet);
  margin-bottom: 0.5rem;
}

/* Fragment toggle */
.fragment-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track.on { background: var(--violet); }
.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-track.on .toggle-thumb { transform: translateX(20px); }
.toggle-label {
  font-size: 0.9rem;
  color: var(--lavender);
}

.save-btn-wrap {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 1.5rem;
  right: 1.5rem;
  z-index: 50;
}
.save-btn-wrap .btn {
  box-shadow: 0 -10px 30px rgba(10, 10, 26, 0.8);
}

/* ─── DREAM DETAIL ─── */
.dream-detail {
  padding-bottom: 2rem;
}

.dream-detail-date {
  font-size: 0.8rem;
  color: var(--lavender);
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.dream-detail-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.dream-detail-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--cream);
  font-weight: 300;
  margin-bottom: 2rem;
  white-space: pre-wrap;
}

.dream-meta-section {
  margin-bottom: 1.5rem;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--glow);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.dream-delete-btn {
  margin-top: 2rem;
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.dream-delete-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: var(--danger);
}

/* ─── PROGRESS PAGE ─── */
.progress-page {
  padding-bottom: 2rem;
}

.recall-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.recall-card {
  background: linear-gradient(145deg, var(--card), rgba(10, 10, 26, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
}
.recall-card .value {
  font-family: 'Syne', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.recall-card.baseline .value { color: var(--lavender); opacity: 0.5; }
.recall-card.current .value { color: var(--success); }
.recall-card .label {
  font-size: 0.8rem;
  color: var(--lavender);
}

.improvement-badge {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0.75rem;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 10px;
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Heatmap */
.heatmap-section {
  margin-bottom: 2rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.heatmap-day-label {
  font-size: 0.6rem;
  color: var(--lavender);
  opacity: 0.5;
  text-align: center;
  padding-bottom: 4px;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(107, 76, 230, 0.06);
  border: 1px solid rgba(107, 76, 230, 0.05);
}
.heatmap-cell.level-1 { background: rgba(107, 76, 230, 0.2); }
.heatmap-cell.level-2 { background: rgba(107, 76, 230, 0.4); }
.heatmap-cell.level-3 { background: rgba(107, 76, 230, 0.7); }
.heatmap-cell.today {
  border-color: var(--glow);
}
.heatmap-cell.future { opacity: 0.3; }

/* Recall Chart */
.recall-chart {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: linear-gradient(145deg, var(--card), rgba(10, 10, 26, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
}

.chart-canvas {
  width: 100%;
  height: 150px;
  position: relative;
}

.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  height: 120px;
  gap: 4px;
  padding: 0 4px;
}

.chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--violet);
  opacity: 0.6;
  min-height: 4px;
  transition: opacity 0.2s;
}
.chart-bar:last-child { opacity: 1; }

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--lavender);
  opacity: 0.5;
}

.chart-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--lavender);
  opacity: 0.4;
  margin-bottom: 0.25rem;
}

/* Emotions summary */
.emotions-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.emotion-summary-pill {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: rgba(107, 76, 230, 0.08);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--cream);
}
.emotion-count {
  color: var(--glow);
  margin-left: 0.3rem;
  font-weight: 500;
}

/* Assessment prompt */
.assessment-card {
  background: linear-gradient(135deg, rgba(107, 76, 230, 0.1), rgba(107, 76, 230, 0.03));
  border: 1px solid rgba(107, 76, 230, 0.2);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.assessment-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.assessment-card p {
  font-size: 0.9rem;
  color: var(--lavender);
  font-weight: 300;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ─── SETTINGS PAGE ─── */
.settings-page {
  padding-bottom: 2rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(145deg, var(--card), rgba(10, 10, 26, 0.8));
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.settings-item:hover { border-color: rgba(107, 76, 230, 0.25); }
.settings-item-label {
  font-size: 0.95rem;
}
.settings-item-value {
  font-size: 0.9rem;
  color: var(--lavender);
}

.settings-logout {
  width: 100%;
  margin-top: 2rem;
  padding: 1rem;
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-logout:hover {
  background: rgba(248, 113, 113, 0.08);
}

.settings-version {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--lavender);
  opacity: 0.4;
}

/* ─── LOADING ─── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(107, 76, 230, 0.15);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  color: var(--cream);
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52, 211, 153, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ─── RESPONSIVE ─── */
@media (min-width: 768px) {
  .app-content { max-width: 600px; margin: 0 auto; }
  .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  .save-btn-wrap { max-width: 568px; left: 50%; right: auto; transform: translateX(-50%); }
  .app-header { max-width: 600px; margin: 0 auto; }
}
