/* ── DESIGN SYSTEM — SELEA ── */
@import url('https://fonts.googleapis.com/css2?family=Fahkwang:wght@300;400;500&family=DM+Sans:wght@400;500;700;800&family=Kalam&display=swap');

:root {
  --blue-dark:  #081840;
  --blue-mid:   #2757D6;
  --blue-light: #C8DAFF;
  --cream:      #FAF7F2;
  --cream-deep: #F4EFE6;
  --copper:     #B5714A;
  --sage:       #7A9180;
  --slate:      #5E7198;

  --bg:           var(--cream);
  --surface:      #FFFFFF;
  --surface-blue: #EDF3FF;
  --border:       var(--cream-deep);
  --text-1:       var(--blue-dark);
  --text-2:       var(--blue-dark);
  --text-3:       var(--slate);
  --text-inv:     var(--cream);
  --accent:       var(--blue-mid);
  --accent-dark:  #1D45B8;

  --ff-display: 'Fahkwang', Georgia, serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;

  --txs:  0.75rem;
  --tsm:  0.875rem;
  --tbase:1rem;
  --tlg:  1.125rem;
  --txl:  1.375rem;
  --t2xl: 1.75rem;
  --t3xl: 2.25rem;
  --t4xl: 3rem;

  --s1:0.25rem; --s2:0.5rem;  --s3:0.75rem; --s4:1rem;
  --s5:1.25rem; --s6:1.5rem;  --s8:2rem;    --s10:2.5rem;
  --s12:3rem;   --s16:4rem;   --s20:5rem;

  --r-sm:4px; --r-md:8px; --r-lg:14px; --r-xl:24px; --r-full:9999px;

  --sh-sm: 0 1px 4px rgba(8,24,64,.07);
  --sh-md: 0 4px 16px rgba(8,24,64,.09), 0 1px 4px rgba(8,24,64,.05);
  --sh-lg: 0 12px 40px rgba(8,24,64,.12), 0 3px 10px rgba(8,24,64,.06);
  --sh-blue: 0 6px 24px rgba(39,87,214,.28);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 240ms;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  font-size: var(--tbase);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  min-height: 100vh;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
.site-header {
  background: var(--blue-dark);
  border-bottom: 1px solid rgba(200,218,255,.1);
  padding: var(--s3) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--s6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo { height: 40px; width: auto; display: block; }

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: rgba(200,218,255,.08);
  border: 1px solid rgba(200,218,255,.15);
  color: var(--cream);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--s1) var(--s4);
  border-radius: var(--r-full);
}

.header-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  flex-shrink: 0;
}

/* ── MAIN ── */
main {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--s16) var(--s6) var(--s20);
}

/* ── INTRO SECTION ── */
.intro {
  text-align: center;
  margin-bottom: var(--s12);
}

.intro-eyebrow {
  font-size: var(--tsm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: var(--s4);
}

.intro-title {
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 4vw, var(--t4xl));
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--blue-dark);
  margin-bottom: var(--s6);
}

.intro-desc {
  font-size: var(--tlg);
  color: var(--text-3);
  max-width: 560px;
  margin: 0 auto var(--s8);
  line-height: 1.7;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--blue-mid);
  color: #fff;
  font-family: var(--ff-body);
  font-size: var(--tbase);
  font-weight: 500;
  padding: var(--s4) var(--s8);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: var(--sh-blue);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-decoration: none;
}

.btn-start:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(39,87,214,.42);
}

/* ── INTRO SECTION ── */
#intro-section { display: none; }
#intro-section.active { display: block; }

/* ── QUIZ SECTION ── */
#quiz-section { display: none; }
#quiz-section.active { display: block; }

/* Progress */
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
  font-size: var(--tsm);
  color: var(--text-3);
  font-weight: 500;
}

.progress-label { font-weight: 700; color: var(--blue-mid); }

.progress-track {
  height: 4px;
  background: var(--cream-deep);
  border-radius: var(--r-full);
  margin-bottom: var(--s8);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue-mid);
  border-radius: var(--r-full);
  transition: width 400ms var(--ease);
}

/* Axe tag */
.axe-tag {
  display: inline-block;
  font-size: var(--txs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  background: rgba(181,113,74,.1);
  border: 1px solid rgba(181,113,74,.2);
  padding: 2px var(--s3);
  border-radius: var(--r-full);
  margin-bottom: var(--s4);
}

/* Question */
.question-text {
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 3vw, var(--t2xl));
  font-weight: 300;
  line-height: 1.35;
  color: var(--blue-dark);
  margin-bottom: var(--s8);
  letter-spacing: -0.01em;
}

/* Answers */
.answers-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-bottom: var(--s8);
}

.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  text-align: left;
  font-family: var(--ff-body);
  font-size: var(--tbase);
  color: var(--text-1);
  line-height: 1.5;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  box-shadow: var(--sh-sm);
}

.answer-btn:hover {
  border-color: var(--blue-mid);
  background: var(--surface-blue);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

.answer-btn.selected {
  border-color: var(--blue-mid);
  background: var(--surface-blue);
  box-shadow: var(--sh-blue);
}

.answer-btn.selected .answer-emoji {
  background: var(--blue-mid);
}

.answer-emoji {
  font-size: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-deep);
  border-radius: var(--r-md);
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}

.answer-btn:hover .answer-emoji {
  background: var(--blue-mid);
}

/* Nav */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-prev {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s5);
  font-family: var(--ff-body);
  font-size: var(--tsm);
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.btn-prev:hover {
  border-color: var(--blue-mid);
  color: var(--blue-mid);
  background: var(--surface-blue);
}

.btn-prev:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-prev:disabled:hover {
  border-color: var(--border);
  color: var(--text-3);
  background: none;
}

/* ── RESULTS SECTION ── */
#results-section { display: none; }
#results-section.active {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

/* ── Résultats header ── */
.results-header {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.results-eyebrow {
  font-size: var(--tsm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  text-align: center;
  margin: 0;
}

/* Card copper pleine largeur */
.level-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: var(--copper);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s10);
  gap: var(--s8);
  box-shadow: var(--sh-md);
}

/* Score gauche */
.score-note {
  flex: 0 0 auto;
  font-size: var(--t2xl);
  color: rgba(250,247,242,.7);
  white-space: nowrap;
  line-height: 1;
}

.score-note strong {
  font-family: var(--ff-display);
  font-size: 4.5rem;
  font-weight: 300;
  color: var(--cream);
  line-height: 1;
}

.note-denom {
  font-size: var(--t2xl);
  color: rgba(250,247,242,.7);
}

/* Séparateur vertical dans la card */
.level-card-divider {
  flex: 0 0 1px;
  align-self: stretch;
  background: rgba(250,247,242,.35);
}

/* Partie droite : label + description */
.level-card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.level-card-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.level-label {
  font-family: var(--ff-display);
  font-size: var(--t2xl);
  font-weight: 300;
  color: var(--cream);
}

.level-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.level-desc {
  font-size: var(--tsm);
  color: rgba(250,247,242,.8);
  line-height: 1.55;
  margin: 0;
}

/* Radar chart */
.chart-section {
  margin-bottom: 0;
}

.chart-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--s4) 0 var(--s2);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

#radar-chart {
  display: block;
  max-width: 100%;
}

.chart-legend {
  display: none;
}

.legend-item {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-size: var(--txs);
  color: var(--text-3);
  line-height: 1.4;
}

.legend-key {
  font-weight: 800;
  font-size: var(--txs);
  color: var(--blue-mid);
  background: var(--surface-blue);
  padding: 1px 5px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* Axes prioritaires */
.axes-section {
  margin-bottom: var(--s12);
}

.section-title {
  font-family: var(--ff-display);
  font-size: var(--txl);
  font-weight: 400;
  color: var(--blue-dark);
  margin-bottom: var(--s6);
  letter-spacing: -0.01em;
}

.axes-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.axe-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5) var(--s6);
  box-shadow: var(--sh-sm);
}

.axe-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}

.axe-card-label {
  font-weight: 700;
  font-size: var(--tbase);
  color: var(--blue-dark);
}

.axe-pct {
  font-size: var(--tsm);
  font-weight: 700;
  color: var(--copper);
  background: rgba(181,113,74,.1);
  padding: 2px var(--s3);
  border-radius: var(--r-full);
}

.axe-bar-track {
  height: 6px;
  background: var(--cream-deep);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--s4);
}

.axe-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--copper), var(--blue-mid));
  border-radius: var(--r-full);
  transition: width 600ms var(--ease);
}

.axe-recommendation {
  font-size: var(--tsm);
  color: var(--text-3);
  line-height: 1.6;
}

/* ── FORM ── */
.form-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s8);
  box-shadow: var(--sh-md);
  margin-bottom: var(--s8);
}

.form-intro {
  font-size: var(--tsm);
  color: var(--text-3);
  line-height: 1.65;
  margin-bottom: var(--s8);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4) var(--s5);
  margin-bottom: var(--s6);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.form-field.full { grid-column: 1 / -1; }

.form-label {
  font-size: var(--tsm);
  font-weight: 700;
  color: var(--text-1);
}

.form-label .req { color: var(--copper); margin-left: 2px; }

.form-input {
  font-family: var(--ff-body);
  font-size: var(--tbase);
  color: var(--text-1);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  transition: border-color var(--dur), box-shadow var(--dur);
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(39,87,214,.12);
}

.form-input::placeholder { color: var(--slate); opacity: 0.6; }

.form-input.input-error {
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,.10);
}

.field-hint {
  font-size: var(--txs);
  color: #C0392B;
  margin: var(--s1) 0 0;
  line-height: 1.4;
}

.rgpd-field {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-bottom: var(--s6);
}

.rgpd-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--blue-mid);
  cursor: pointer;
}

.rgpd-label {
  font-size: var(--tsm);
  color: var(--text-3);
  line-height: 1.55;
  cursor: pointer;
}

.form-error {
  font-size: var(--tsm);
  color: #C0392B;
  margin-bottom: var(--s4);
  display: none;
}

.form-error.visible { display: block; }

.btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  background: var(--blue-mid);
  color: #fff;
  font-family: var(--ff-body);
  font-size: var(--tbase);
  font-weight: 500;
  padding: var(--s4) var(--s8);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: var(--sh-blue);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn-submit:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(39,87,214,.42);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-label { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── CONFIRMATION ── */
.confirmation {
  display: none;
  text-align: center;
  padding: var(--s12) var(--s8);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  margin-bottom: var(--s8);
}

.confirmation.active { display: block; }

.confirmation-icon {
  font-size: 3rem;
  margin-bottom: var(--s4);
}

.confirmation-title {
  font-family: var(--ff-display);
  font-size: var(--t2xl);
  font-weight: 300;
  color: var(--blue-dark);
  margin-bottom: var(--s4);
}

.confirmation-text {
  font-size: var(--tbase);
  color: var(--text-3);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto var(--s6);
}

.confirmation-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--blue-mid);
  font-weight: 600;
  font-size: var(--tbase);
  text-decoration: none;
  transition: color var(--dur);
}

.confirmation-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ── FOOTER ── */
.site-footer {
  background: var(--blue-dark);
  padding: var(--s8) 0;
  text-align: center;
  color: white;
  font-size: var(--tsm);
}

.footer-logo { height: 32px; width: auto; margin-bottom: var(--s4); opacity: 0.8; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.5s var(--ease) both; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  main { padding: var(--s10) var(--s4) var(--s16); }

  .form-grid { grid-template-columns: 1fr; }

  .form-section { padding: var(--s6) var(--s5); }

  .level-card {
    flex-direction: column;
    padding: var(--s6);
    gap: var(--s5);
  }

  .level-card-divider {
    width: 100%;
    height: 1px;
    align-self: auto;
  }

  .score-note strong { font-size: 3rem; }

  .intro-desc { font-size: var(--tbase); }

  .chart-legend { grid-template-columns: 1fr; }

  .chart-wrap { padding: var(--s3); }
}
