/* ========================================================
   Mivoatsa CM Quiz – Feuille de style principale
   Police : Sora (titres) + Inter (corps)
   Palette : Bleu foncé #1E3A5F + accents catégories
   ======================================================== */

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

:root {
  --navy:    #1E3A5F;
  --navy-lt: #2D5080;
  --cream:   #F8F6F1;
  --white:   #FFFFFF;
  --gray100: #F3F4F6;
  --gray200: #E5E7EB;
  --gray400: #9CA3AF;
  --gray600: #6B7280;
  --gray800: #1F2937;
  --radius:  14px;
  --shadow:  0 4px 24px rgba(30,58,95,.10);
  --shadow-lg: 0 12px 40px rgba(30,58,95,.16);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--gray800);
  min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, #2563EB 100%);
  color: var(--white);
  padding: 2.4rem 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='28' fill='none' stroke='rgba(255,255,255,.06)' stroke-width='1'/%3E%3C/svg%3E") 0 0;
  background-size: 60px 60px;
  pointer-events: none;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo-zone { display: flex; align-items: center; gap: .9rem; }
.logo-badge {
  width: 54px; height: 54px;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.logo-sub  { font-size: .75rem; opacity: .7; letter-spacing: .06em; text-transform: uppercase; }
.logo-title { font-family: 'Sora', sans-serif; font-size: 1.35rem; font-weight: 700; }
.header-meta { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.header-lead {
  max-width: 860px;
  margin: 1rem auto .5rem;
  font-size: .93rem;
  opacity: .85;
  line-height: 1.5;
}
.progress-track {
  max-width: 860px;
  margin: 0 auto;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: #FCD34D;
  border-radius: 99px;
  width: 0;
  transition: width .4s ease;
}

/* ── CONTAINER ─────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── ERREURS ────────────────────────────────────────────── */
.alert-errors {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-left: 5px solid #DC2626;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  color: #7F1D1D;
}
.alert-errors ul { margin-top: .5rem; padding-left: 1.2rem; }
.alert-errors li { margin-top: .25rem; }

/* ── CARTE IDENTITÉ ─────────────────────────────────────── */
.identity-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.identity-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.25rem;
}
.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media(max-width:580px){ .identity-grid { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray600);
  margin-bottom: .4rem;
  letter-spacing: .02em;
}
.req { color: #DC2626; margin-left: .2rem; }
.opt { color: var(--gray400); font-weight: 400; }
.field input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--gray200);
  border-radius: 9px;
  font-size: .93rem;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, box-shadow .2s;
  background: var(--gray100);
  color: var(--gray800);
}
.field input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: var(--white);
}

/* ── LÉGENDE ────────────────────────────────────────────── */
.legend-card {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1.5px solid #DBEAFE;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}
.legend-title {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}
.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--white);
  border-radius: 8px;
  padding: .35rem .65rem;
  font-size: .78rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.leg-num {
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--navy);
  min-width: 1.1rem;
  text-align: center;
}
.leg-txt { color: var(--gray600); }

/* ── SECTIONS CATÉGORIES ────────────────────────────────── */
.cat-section {
  margin-bottom: 2.5rem;
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1rem;
  border-left: 5px solid;
  box-shadow: var(--shadow);
}
.cat-header-icon { font-size: 1.75rem; }
.cat-header-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}
.cat-header-count {
  font-size: .78rem;
  color: var(--gray400);
  margin-top: .15rem;
}

/* ── BLOCS QUESTION ─────────────────────────────────────── */
.question-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: .85rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.question-block:hover { box-shadow: var(--shadow); }
.question-block.answered { border-left: 3px solid #10B981; }

.q-header { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1rem; }
.q-num {
  min-width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--white);
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.q-text { font-size: .92rem; line-height: 1.55; color: var(--gray800); }

/* ── RATING BUTTONS ─────────────────────────────────────── */
.rating-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.rating-label {
  flex: 1;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  cursor: pointer;
  padding: .5rem .3rem;
  border: 2px solid var(--gray200);
  border-radius: 10px;
  transition: all .18s ease;
  background: var(--gray100);
}
.rating-label input { display: none; }
.rating-num {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gray600);
  transition: color .18s;
}
.rating-hint {
  font-size: .62rem;
  color: var(--gray400);
  text-align: center;
  line-height: 1.2;
}
.rating-label:hover {
  border-color: var(--accent, #2563EB);
  background: color-mix(in srgb, var(--accent, #2563EB) 8%, white);
}
.rating-label:hover .rating-num { color: var(--accent, #2563EB); }
.rating-label.selected {
  border-color: var(--accent, #2563EB);
  background: color-mix(in srgb, var(--accent, #2563EB) 15%, white);
}
.rating-label.selected .rating-num { color: var(--accent, #2563EB); }
.rating-label.selected .rating-hint { color: var(--accent, #2563EB); }

@media(max-width:500px){
  .rating-hint { display: none; }
  .rating-label { padding: .5rem .2rem; }
}

/* ── BOUTON SOUMETTRE ───────────────────────────────────── */
.submit-zone {
  text-align: center;
  margin-top: 2.5rem;
}
.submit-hint {
  font-size: .85rem;
  color: var(--gray400);
  margin-bottom: 1rem;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  background: linear-gradient(135deg, var(--navy) 0%, #2563EB 100%);
  color: var(--white);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: .9rem 2.5rem;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(37,99,235,.4);
  transition: transform .2s, box-shadow .2s;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(37,99,235,.5);
}
.btn-submit:active { transform: translateY(0); }

/* ═══════════════════════════  RÉSULTATS  ════════════════ */
.result-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.result-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2563EB);
  color: var(--white);
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
}
.result-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
}
.result-sub { color: var(--gray400); font-size: .9rem; margin-top: .25rem; }

.score-ring-wrap {
  position: relative;
  width: 200px;
  margin: 1.75rem auto 0;
}
.score-ring { width: 200px; height: 200px; }
.ring-anim {
  transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1);
}
.score-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.score-num { font-family: 'Sora', sans-serif; font-size: 2.5rem; font-weight: 800; color: var(--navy); line-height: 1; }
.score-denom { font-size: .85rem; color: var(--gray400); margin-top: -.1rem; }
.score-badge {
  display: inline-block;
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  margin-top: .4rem;
}

/* Sections résultat */
.result-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.25rem;
}
.cat-grid { display: flex; flex-direction: column; gap: .85rem; }
.cat-card {
  background: var(--gray100);
  border-radius: 10px;
  padding: .9rem 1.1rem;
}
.cat-card-header {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .55rem;
}
.cat-icon { font-size: 1.2rem; }
.cat-name { flex: 1; font-size: .88rem; font-weight: 600; color: var(--gray800); }
.cat-score { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1rem; }
.bar-track { background: var(--gray200); border-radius: 99px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width 1s ease; }
.cat-level { font-size: .75rem; font-weight: 600; margin-top: .35rem; }

/* Point list */
.point-list { display: flex; flex-direction: column; gap: .75rem; }
.point-card {
  display: flex; align-items: flex-start; gap: .85rem;
  border-radius: 10px; padding: .85rem 1rem;
}
.point-card.weak  { background: #FEF2F2; border-left: 4px solid #DC2626; }
.point-card.strong{ background: #F0FDF4; border-left: 4px solid #059669; }
.point-rank {
  min-width: 26px; height: 26px; border-radius: 50%;
  background: #DC2626; color: var(--white);
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.strong-rank { background: #059669; }
.point-content { flex: 1; }
.point-q { font-size: .87rem; color: var(--gray800); line-height: 1.45; }
.point-cat { font-size: .75rem; color: var(--gray400); margin-top: .25rem; font-weight: 500; }
.point-note {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1rem;
  min-width: 2.5rem; text-align: right; flex-shrink: 0;
}
.weak-note   { color: #DC2626; }
.strong-note { color: #059669; }

/* Résultat footer */
.result-footer {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem 1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.result-footer p { color: var(--gray600); font-size: .9rem; line-height: 1.6; }
.btn-retry {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .65rem 1.75rem;
  border-radius: 99px;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: all .2s;
}
.btn-retry:hover { background: var(--navy); color: var(--white); }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--gray400);
  border-top: 1px solid var(--gray200);
}
