/* Charte Comandflow : dark luxury, fond #110E17, or #D4A853 */

:root {
  --bg: #110E17;
  --bg-2: #1A1523;
  --card: #1E1928;
  --gold: #D4A853;
  --gold-dark: #8B7340;
  --light: #F5F0EB;
  --body: #E8E0D8;
  --muted: #A09890;
  --heading: 'Cormorant Garamond', Georgia, serif;
  --font: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Structure ---------- */

.app {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
}

.brand-line {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 48px;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.screen.is-active { display: flex; }

.fade-in { animation: fadeUp 0.45s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Écran d'accueil ---------- */

.intro { text-align: center; }

.intro .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.intro h1 {
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 3.3rem);
  line-height: 1.12;
  color: var(--light);
  margin-bottom: 20px;
}

.intro .lead {
  font-size: 1.1rem;
  color: var(--body);
  max-width: 34em;
  margin: 0 auto 36px;
}

.intro .note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Boutons ---------- */

.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: #110E17;
  border: none;
  border-radius: 12px;
  padding: 18px 40px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-gold:active { transform: none; }
.btn-gold:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }

/* ---------- Écran question ---------- */

.quiz-head {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.progress {
  display: flex;
  gap: 6px;
  width: 100%;
}

.progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(212, 168, 83, 0.16);
  transition: background 0.3s ease;
}

.progress span.done { background: var(--gold); }
.progress span.current { background: rgba(212, 168, 83, 0.45); }

.q-counter {
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.q-phrase {
  font-family: var(--heading);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.28;
  color: var(--light);
  min-height: 3.4em;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.answer {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 14px;
  padding: 18px 20px;
  font-family: var(--font);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--light);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.answer:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.08);
}

.answer.selected {
  border-color: var(--gold);
  background: var(--gold);
  color: #110E17;
}

.answer:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
.answer:disabled { cursor: default; }

/* ---------- Écran de calcul ---------- */

.calc {
  align-items: center;
  text-align: center;
  gap: 20px;
}

.loader {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.loader span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.calc h2 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--light);
}

.calc p { color: var(--muted); }

/* ---------- Écran résultats ---------- */

.results { justify-content: flex-start; padding-top: 8px; }

.result-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.result-profil {
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(2.3rem, 8vw, 3.4rem);
  line-height: 1.1;
  color: var(--light);
  margin-bottom: 16px;
}

.gold-separator {
  width: 64px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 0 0 24px;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
}

.result-score .num {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--gold);
  line-height: 1;
}

.result-score .sur {
  font-size: 1rem;
  color: var(--muted);
}

.result-accroche {
  font-size: 1.15rem;
  color: var(--light);
  margin-bottom: 20px;
  max-width: 36em;
}

.result-diagnostic p {
  color: var(--body);
  margin-bottom: 14px;
  max-width: 38em;
}

.result-diagnostic a { color: var(--gold); text-decoration: underline; }
.result-diagnostic a:hover { color: var(--light); }

/* ---------- Barres ---------- */

.bars-section { margin: 36px 0 8px; }

.bars-title {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.bar-row { margin-bottom: 16px; }

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.bar-label { font-size: 0.95rem; color: var(--body); }
.bar-value { font-size: 0.85rem; color: var(--muted); }

.bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--gold);
  transition: width 0.7s ease;
}

/* ---------- Priorités ---------- */

.priorities { margin: 40px 0 12px; }

.priorities-title {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--light);
  margin-bottom: 20px;
}

.no-prio { color: var(--body); max-width: 38em; }

.prio-card {
  background: var(--card);
  border: 1px solid rgba(212, 168, 83, 0.22);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
}

.prio-card h4 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.prio-phrase {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 12px;
}

.prio-conseil { color: var(--body); }

/* ---------- CTA final ---------- */

.results-cta {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.cta-note { font-size: 0.9rem; color: var(--muted); }

.link-secondary {
  color: var(--gold);
  text-decoration: underline;
  font-size: 0.95rem;
}

.link-secondary:hover { color: var(--light); }

.btn-retake {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 12px;
  padding: 4px 0;
}

.btn-retake:hover { color: var(--light); }

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 24px 20px 32px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.footer a:hover { color: var(--gold); }

/* ---------- Mode debug ---------- */

#debug-panel {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 100;
  background: var(--bg-2);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#debug-panel button {
  background: none;
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 8px;
  color: var(--body);
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
}

#debug-panel button:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Accessibilité ---------- */

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