/* ============================================================
   Score santé financière — diagnostic tool
   Builds on the tokens defined in style.css so the tool feels
   like part of the same brand, not a bolted-on form.
   ============================================================ */
:root {
  --score-low:  #c0392b;   /*  0 – 49  */
  --score-mid:  #e07b26;   /* 50 – 69  */
  --score-good: #8a9b1f;   /* 70 – 84  */
  --score-high: #2e9e5b;   /* 85 – 100 */
}

.score-page {
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */
.score-header {
  border-bottom: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.score-header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1rem var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.score-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.score-brand img { width: 28px; height: auto; }
.score-brand small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--c-text-dim);
  margin-top: 2px;
}
.score-back-link {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  transition: color 0.25s var(--ease-out);
}
.score-back-link:hover { color: var(--c-accent); }

/* ---------- layout ---------- */
.score-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-5) var(--space-3) var(--space-6);
}
.screen { display: none; width: 100%; }
.screen.is-active { display: block; }
.screen-inner {
  max-width: 640px;
  margin: 0 auto;
}
.intro-inner { text-align: center; }

/* ---------- intro ---------- */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--c-text-dim);
}
.score-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
}
.score-page h1 {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.score-page h1 .accent {
  background: var(--gradient-metallic);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro-sub {
  margin: var(--space-3) auto 0;
  max-width: 46ch;
  color: var(--c-text-dim);
  font-size: 1.05rem;
}
.intro-points {
  margin: var(--space-4) auto 0;
  max-width: 25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.intro-points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--c-text-dim);
}
.intro-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
}
.intro-points strong { color: var(--c-text); font-weight: 600; }
.btn-lg {
  margin-top: var(--space-5);
  padding: 1.05rem 2rem;
  font-size: 0.98rem;
}

/* ---------- quiz ---------- */
.quiz-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 0.75rem;
}
.quiz-category {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.quiz-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-text-faint);
}
.progress-track {
  height: 3px;
  border-radius: 3px;
  background: var(--c-line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-metallic);
  transition: width 0.45s var(--ease-out);
}

.quiz-body {
  margin-top: var(--space-5);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.quiz-body.is-swapping {
  opacity: 0;
  transform: translateY(10px);
}
.quiz-question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3.4vw, 1.75rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}
.answers {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.answer {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-bg-card);
  font-size: 1rem;
  color: var(--c-text);
  transition:
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.answer:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}
.answer.is-selected {
  border-color: var(--c-accent);
  background: rgba(53, 85, 143, 0.06);
}
.answer-marker {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--c-line);
  position: relative;
  transition: border-color 0.2s var(--ease-out);
}
.answer:hover .answer-marker,
.answer.is-selected .answer-marker { border-color: var(--c-accent); }
.answer.is-selected .answer-marker::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--c-accent);
}

.quiz-nav { margin-top: var(--space-4); }
.btn-back {
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--c-text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s var(--ease-out);
}
.btn-back:hover { color: var(--c-accent); }
.btn-back[disabled] { opacity: 0.35; pointer-events: none; }

/* ---------- result ---------- */
.result-head { text-align: center; }
.result-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.gauge {
  position: relative;
  width: 200px;
  height: 200px;
  margin: var(--space-3) auto var(--space-3);
}
.gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge circle {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}
.gauge-bg { stroke: var(--c-line); }
.gauge-fill {
  stroke: var(--score-color, var(--c-accent));
  stroke-dasharray: 339.29;
  stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 1.2s var(--ease-out), stroke 0.4s var(--ease-out);
}
.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
}
.gauge-value span { font-size: 3rem; line-height: 1; color: var(--score-color, var(--c-text)); }
.gauge-value small {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--c-text-faint);
}
.result-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  line-height: 1.22;
  max-width: 24ch;
  margin: 0 auto;
}
.result-text {
  margin: var(--space-3) auto 0;
  max-width: 52ch;
  color: var(--c-text-dim);
  font-size: 1rem;
}
.result-position {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-faint);
}

/* category bars */
.breakdown {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bd-row { display: flex; flex-direction: column; gap: 0.45rem; }
.bd-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.bd-name { font-weight: 600; font-size: 0.95rem; }
.bd-score {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text-dim);
}
.bd-track {
  height: 8px;
  border-radius: 8px;
  background: var(--c-line-soft);
  overflow: hidden;
}
.bd-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: var(--gradient-metallic);
  transition: width 0.9s var(--ease-out);
}

/* insights */
.insights {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 620px) {
  .insights { grid-template-columns: 1fr 1fr; }
}
.insight {
  padding: var(--space-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-bg-card);
}
.insight-priority { border-color: rgba(53, 85, 143, 0.4); }
.insight-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.insight strong {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-accent);
}
.insight p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--c-text-dim);
}

/* CTA */
.cta-panel {
  margin-top: var(--space-5);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-m);
  border: 1px solid var(--c-line);
  background: var(--gradient-metallic-soft), var(--c-bg-card);
  text-align: center;
}
.cta-panel h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.cta-panel p {
  margin: var(--space-2) auto 0;
  max-width: 44ch;
  color: var(--c-text-dim);
  font-size: 0.98rem;
}
.cta-panel .btn { margin-top: var(--space-4); }
.btn-restart {
  display: block;
  margin: var(--space-3) auto 0;
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--c-text-faint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-restart:hover { color: var(--c-accent); }

/* guides on the result page */
.guides-block { margin-top: var(--space-6); }
.guides-head { text-align: center; margin-bottom: var(--space-4); }
.guides-head h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
.guides-head p {
  margin-top: var(--space-2);
  color: var(--c-text-dim);
  font-size: 0.95rem;
}
.guides-block .guide-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) {
  .guides-block .guide-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- footer ---------- */
.score-footer {
  border-top: 1px solid var(--c-line);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-size: 0.82rem;
  color: var(--c-text-dim);
}
.score-footer a { color: var(--c-text-dim); }
.score-footer a:hover { color: var(--c-accent); }
.score-disclaimer {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--c-text-faint);
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-body,
  .progress-fill,
  .gauge-fill,
  .bd-fill { transition: none; }
  .answer:hover { transform: none; }
}
