/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
  min-height: 48px;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-gold);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-highlight); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.btn-text {
  background: transparent;
  color: var(--color-text-faint);
  border: none;
  font-weight: 500;
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
}
.btn-text:hover { color: var(--color-text-muted); }

.btn-full { width: 100%; }

/* ============================================================
   FOOTER
   ============================================================ */
.quiz-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: var(--space-3);
  z-index: 5;
}
.quiz-footer a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  transition: color var(--transition-interactive);
}
.quiz-footer a:hover { color: var(--color-text-muted); }

/* ============================================================
   AMBIENT BG
   ============================================================ */
.ambient-glow {
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 60vh;
  background: radial-gradient(ellipse, var(--color-primary-highlight) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .quiz-header { padding: var(--space-3) var(--space-4); }
  .screen { padding: var(--space-4); }
  .welcome-headline { font-size: var(--text-xl); }
  .question-title { font-size: var(--text-lg); }
  .result-headline { font-size: var(--text-xl); }
  .header-logo { display: none; }
  .budget-cards { grid-template-columns: 1fr !important; }
  .vision-card { flex-direction: column; align-items: center; text-align: center; }
  .vision-card .vision-content { text-align: center; }
}

/* ============================================================
   GAMIFICATION — Endowed Progress
   ============================================================ */
.progress-fill {
  min-width: 12%; /* Endowed progress — starts at ~12% */
}
.progress-bar {
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 6px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  animation: progressGlow 2s ease-in-out infinite;
}
@keyframes progressGlow {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px var(--color-primary); }
  50% { opacity: 1; box-shadow: 0 0 12px var(--color-primary); }
}

/* ============================================================
   GAMIFICATION — Dynamic Recap Panel
   ============================================================ */
.recap-panel {
  position: fixed;
  z-index: 20;
  display: none;
}
.recap-panel.visible { display: block; }

/* Desktop: sidebar right */
@media (min-width: 1024px) {
  .recap-panel {
    top: 80px;
    right: 24px;
    width: 220px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    transition: background-color 0.6s ease, border-color 0.6s ease;
  }
}

/* Tablet + Mobile: bottom drawer (compact) */
@media (max-width: 1023px) {
  .recap-panel {
    bottom: 40px;
    left: var(--space-4);
    right: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 -4px 24px oklch(0 0 0 / 0.3);
    max-height: 44px;
    overflow: hidden;
    transition: max-height 0.35s ease, background-color 0.6s ease, border-color 0.6s ease;
  }
  .recap-panel.expanded {
    max-height: 280px;
    overflow-y: auto;
  }
}

.recap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  cursor: pointer;
}
@media (min-width: 1024px) {
  .recap-header { cursor: default; }
}
.recap-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.recap-toggle {
  display: none;
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}
@media (max-width: 1023px) {
  .recap-toggle { display: block; }
  .recap-panel.expanded .recap-toggle { transform: rotate(180deg); }
}
.recap-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (max-width: 1023px) {
  .recap-items { flex-direction: row; flex-wrap: wrap; gap: var(--space-2); }
  .recap-panel:not(.expanded) .recap-items { flex-wrap: nowrap; overflow: hidden; }
}
.recap-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  opacity: 0;
  transform: translateY(6px);
  animation: recapItemIn 0.4s ease forwards;
}
@keyframes recapItemIn {
  to { opacity: 1; transform: translateY(0); }
}
.recap-item svg { flex-shrink: 0; width: 14px; height: 14px; color: var(--color-primary); opacity: 0.7; }
.recap-item-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   GAMIFICATION — Micro-feedback overlay
   ============================================================ */
.micro-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.4);
  text-align: center;
  max-width: 360px;
  opacity: 0;
  pointer-events: none;
  animation: feedbackIn 0.35s ease forwards;
}
.micro-feedback.out {
  animation: feedbackOut 0.3s ease forwards;
}
@keyframes feedbackIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes feedbackOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}
.micro-feedback-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
}
.micro-feedback-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  line-height: 1.5;
}

/* ============================================================
   GAMIFICATION — Enhanced selection pulse
   ============================================================ */
@keyframes selectPulse {
  0% { box-shadow: 0 0 0 0px var(--color-primary); }
  50% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0px transparent; }
}
.answer-card.selected,
.vision-card.selected,
.passion-card.selected,
.budget-card.selected,
.style-card.selected {
  animation: selectPulse 0.5s ease-out;
}

/* Subtle scan line on universe cards hover */
.universe-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--color-primary-highlight) 50%, transparent 100%);
  transition: left 0.6s ease;
  pointer-events: none;
}
.universe-card:hover::after {
  left: 100%;
}

/* ============================================================
   GAMIFICATION — Progressive result reveal
   ============================================================ */
.result-reveal { opacity: 0; transform: translateY(20px); }
.result-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ============================================================
   PROFILING (Temps 2) — Styles
   ============================================================ */
.profiling-transition {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}
.profiling-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

/* Profile completion gauge */
.profile-gauge-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto var(--space-6);
}
.profile-gauge-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.profile-gauge-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}
.profile-gauge-pct {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
}
.profile-gauge-bar {
  width: 100%;
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.profile-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Profiling text input field */
.profiling-text-input {
  width: 100%;
  max-width: 480px;
  margin-top: var(--space-4);
}
.profiling-text-input textarea {
  width: 100%;
  min-height: 80px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  resize: vertical;
  font-family: var(--font-body);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.profiling-text-input textarea::placeholder { color: var(--color-text-faint); }
.profiling-text-input textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

/* Profiling micro-validation message */
.profiling-validation {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-primary);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 480px;
}
.profiling-validation.show {
  opacity: 1;
  transform: translateY(0);
}
.profiling-validation-icon {
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}
.profiling-validation-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* No-result-screen overrides for profiling transition */
.profiling-screen .screen-inner {
  gap: var(--space-4);
  max-width: 560px;
}


/* Loading overlay */
.loading-overlay { position:fixed;inset:0;z-index:1000;background:var(--color-bg);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:var(--space-4);transition:opacity 0.5s ease; }
.loading-overlay.hidden { opacity:0;pointer-events:none; }
.loading-spinner { width:32px;height:32px;border:3px solid var(--color-surface-2);border-top-color:var(--color-primary);border-radius:50%;animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-text { font-size:var(--text-xs);color:var(--color-text-faint); }
.error-screen { text-align:center;padding:var(--space-8); }
.error-screen h2 { font-size:var(--text-xl);margin-bottom:var(--space-4);color:var(--color-text); }
.error-screen p { font-size:var(--text-sm);color:var(--color-text-muted);margin-bottom:var(--space-6); }