/* Charte Brocéliande Digital : bandeau en dégradé bleu avec liseré, crochet rose devant les titres,
   touche de rose dans le titre de l'offre, signature « Brocéliande Digital » sur une ligne en pied de page.
   Mise en page : une seule colonne aérée, tous les thèmes sur la même page, résultats en bas. */
:root {
  /* Couleurs de la charte */
  --bd-navy: #080739;   /* bleu secondaire : expertise et professionnalisme */
  --bd-blue: #3c5599;   /* bleu principal : couleur signature */
  --bd-sky: #5ac1da;    /* bleu rappel : innovation et tech */
  --bd-pink: #e622a5;   /* rose : proximité humaine */

  /* Jetons d'interface : thème clair uniquement (pas de mode sombre) */
  color-scheme: light;
  --bg: #f5f6fc;
  --surface: #ffffff;
  --ink: #080739;
  --muted: #5b5f86;
  --line: #dfe2f0;
  --hover: #eef3fb;
  --accent: #3c5599;
  --accent-ink: #ffffff;
  --accent-strong: #080739;
  --pink: #e622a5;
  --sky: #5ac1da;
  --crit: #c32f3b;
  --warn: #b86e00;
  --ok: #23845a;
  --hero-from: #080739;
  --hero-mid: #3c5599;
  --hero-to: #5ac1da;

  /* Typographie : Nexa (charte) si installée, sinon Outfit, très proche */
  --f-body: "Nexa", "Outfit", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Nexa", "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.6 var(--f-body);
  padding-inline: 16px;
  padding-block: 32px 40px;
}
.wrap { max-width: 760px; margin: 0 auto; }
h1, h2 { margin: 0; font-weight: 700; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 24px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }

/* Crochet rose devant les titres (repris des supports de la marque) */
.bracket { position: relative; padding-left: 22px; }
.bracket::before {
  content: ""; position: absolute; left: 0; top: -6px; bottom: -6px; width: 7px;
  border: 1.5px solid var(--pink); border-right: 0;
}

/* Bandeau : dégradé bleu + liseré clair aux coins arrondis */
.hero {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 48px 40px 44px;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 58%, var(--hero-to) 130%);
  color: #ffffff;
  margin-bottom: 28px;
}
.hero::after {
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 12px;
}
.hero .brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 700; letter-spacing: .02em; margin-bottom: 18px; }
/* Logo Brocéliande Digital : pastille blanche pour rester lisible sur le dégradé bleu */
.hero .logo { width: 28px; height: 28px; padding: 3px; border-radius: 50%; background: var(--surface); flex: none; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); letter-spacing: -0.01em; color: #ffffff; }
.hl {
  display: inline-block; background: var(--bd-pink); color: #ffffff;
  padding: 0 .22em .06em; margin-left: .08em; border-radius: 3px;
}
.hero .sub { font-size: clamp(18px, 2.6vw, 22px); font-weight: 700; margin-top: 14px; max-width: 30ch; }
.hero a { color: #ffffff; }

/* Coordonnées */
.meta {
  display: flex; flex-wrap: wrap; gap: 16px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 36px;
}
.meta label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); flex: 1 1 160px; min-width: 0; }
.meta input, .meta select {
  font: inherit; font-weight: 400; font-size: 15px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line);
  padding: 4px 2px; width: 100%; min-width: 0;
}
.meta input:focus-visible, .meta select:focus-visible { outline: none; border-bottom-color: var(--accent); }
.meta select option { color: var(--ink); background: var(--surface); }


/* Questions */
.domain-head { margin-bottom: 24px; }
.domain-head h2 { margin-bottom: 14px; }
.domain-head p { color: var(--muted); max-width: 62ch; }
.q { border: 0; margin: 0 0 48px; padding: 0; }
.q legend { padding: 0; margin-bottom: 16px; font-weight: 700; font-size: 16.5px; line-height: 1.4; }
.q legend span { color: var(--pink); margin-right: 8px; }

/* QCM : chaque réponse est une ligne cliquable */
.choices { display: grid; gap: 18px; }
.choice {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1.45;
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--sky); }
.choice input {
  appearance: none; flex: none; margin: 1px 0 0;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--muted); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
}
.choice input::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform .12s;
}
.choice input:checked { border-color: var(--accent); }
.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--hover); font-weight: 700; }
/* Bonne réponse cochée : cadre et mention en vert */
.choice .good { display: none; margin-left: auto; flex: none; color: var(--ok); font-size: 13px; font-weight: 700; white-space: nowrap; }
.choice.best:has(input:checked) { border-color: var(--ok); }
.choice.best input:checked { border-color: var(--ok); }
.choice.best input:checked::after { background: var(--ok); }
.choice.best:has(input:checked) .good { display: inline; }

/* Résultats */
.summary {
  display: flex; align-items: center; gap: 28px; margin-bottom: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px;
}
.summary .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.ring { width: 116px; height: 116px; flex: none; }
.ring circle { fill: none; stroke-width: 9; }
.ring .trk { stroke: var(--line); }
.ring .val {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transition: stroke-dashoffset .5s ease;
}
.ring text { fill: var(--ink); font: 700 32px var(--f-body); }
.level { font-size: 24px; font-weight: 700; margin: 2px 0 4px; }

.bars { list-style: none; margin: 0 0 48px; padding: 0; display: grid; gap: 18px; }
.bars .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; font-weight: 700; margin-bottom: 7px; }
.bars .row span:last-child { font-weight: 400; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .5s ease; }

.results h2 { margin-bottom: 14px; }
.results #who { margin-bottom: 28px; }
.actions.next { align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 32px; }
.plan { list-style: none; margin: 0 0 32px; padding: 0; }
.plan li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.plan li:last-child { border-bottom: 0; }
.plan .tag { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.plan .src { font-size: 13px; color: var(--muted); }

/* Boutons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
button {
  font: 700 14.5px var(--f-body); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 10px 22px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
button:hover { border-color: var(--accent); }
button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
/* Lien présenté comme un bouton (prise de rendez-vous) */
a.button {
  display: inline-block; padding: 10px 22px; border-radius: 999px; font: 700 14.5px var(--f-body);
  text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
}
a.button:hover { border-color: var(--accent); }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
a.button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

/* Prise de rendez-vous, à la fin des résultats */
.rdv { margin-top: 48px; padding: 24px; border: 1.5px solid var(--line); border-left: 4px solid var(--pink); border-radius: 12px; background: var(--surface); }
.rdv p { margin: 10px 0 18px; color: var(--muted); }

button.danger { color: var(--crit); border-color: var(--crit); }
.actions button:disabled { opacity: .6; cursor: progress; }

.toast { font-size: 14px; font-weight: 700; color: var(--accent); min-height: 1.4em; margin-top: 14px; }
.fallback {
  width: 100%; min-height: 160px; margin-top: 8px; padding: 10px;
  font: 13px ui-monospace, Consolas, monospace; color: var(--ink); background: var(--hover);
  border: 1px solid var(--line); border-radius: 8px;
}

/* Signature : ligne de pied de page coupée par le nom, qui remonte en arrondi à droite */
.signature {
  display: flex; align-items: flex-end; gap: 14px;
  max-width: 760px; margin: 64px auto 0; color: var(--ink);
  font-size: 15px; font-weight: 700; line-height: 1;
}
.signature::before { content: ""; flex: 1; border-bottom: 1.5px solid var(--pink); margin-bottom: 5px; }
.signature::after {
  content: ""; width: 48px; height: 40px; flex: none;
  border-bottom: 1.5px solid var(--pink); border-right: 1.5px solid var(--pink);
  border-bottom-right-radius: 14px; margin-bottom: 5px;
}
.signature a { color: inherit; text-decoration: none; }
.signature small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

@media (max-width: 520px) {
  body { padding-block: 16px 32px; }
  .hero { padding: 36px 26px 32px; }
  .hero::after { inset: 10px; }
  .summary { gap: 18px; padding: 18px; }
  .ring { width: 90px; height: 90px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
