/* Shared tokens + front styles (mobile first). Colours come from /theme.css (Paramètres > Habillage). */
:root {
  --radius: 14px;
  --radius-sm: 10px;
  font-family: Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-soft); color: var(--navy-900); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--magenta); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--slate-500); }
.text-navy { color: var(--navy-700); }
.text-magenta { color: var(--magenta); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy-900); color: white; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1.5rem; border: 2px solid transparent; border-radius: var(--radius-sm); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; min-height: 48px; }
.btn--primary { background: var(--navy-700); color: white; }
.btn--primary:hover { background: var(--navy-900); }
.btn--magenta { background: var(--magenta); color: white; }
.btn--magenta:hover { background: var(--magenta-700); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--navy-700); }
.btn--danger { background: var(--white); border-color: var(--danger); color: var(--danger-text); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--line); color: var(--slate-500); cursor: not-allowed; }

/* Badges / chips */
.badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: white; font-weight: 700; }
.badge--navy { background: var(--navy-700); }
.badge--magenta { background: var(--magenta); }
.badge--lg { width: 56px; height: 56px; font-size: 1.4rem; }
.chip { display: inline-block; padding: .35rem .85rem; border-radius: 8px; background: var(--bg-soft); font-weight: 700; font-size: .9rem; }
.chip--selected { background: var(--magenta-50); color: var(--magenta); }
.tag-full { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: var(--slate-300); color: white; font-size: .75rem; font-weight: 700; letter-spacing: .03em; }

/* Cards, progress */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--navy-700); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--navy-700); border-radius: 999px; }
.is-full progress::-webkit-progress-value { background: var(--slate-300); }
.is-full progress::-moz-progress-bar { background: var(--slate-300); }

/* Flash */
.flash { padding: .85rem 1.25rem; font-weight: 700; }
.flash--success { background: var(--success-50); color: var(--success-700); }
.flash--error { background: var(--danger-50); color: var(--danger-text); }
.flash--info { background: var(--magenta-50); color: var(--magenta); }

/* Forms */
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: .35rem; font-weight: 700; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select {
  width: 100%; min-height: 48px; padding: .65rem .9rem; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: white; color: var(--navy-900); font: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--navy-700); box-shadow: var(--focus); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin: .35rem 0 0; color: var(--danger-text); font-size: .9rem; font-weight: 700; }
.hint { margin: .35rem 0 0; color: var(--slate-500); font-size: .875rem; }
.field--title select { max-width: 160px; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.field--check { display: grid; grid-template-columns: 24px 1fr; gap: .25rem .75rem; align-items: start; }
.field--check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--magenta); }
.field--check label { font-weight: 400; margin: 0; }
.field--check .field__error { grid-column: 2; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 1rem; background: white; border-bottom: 1px solid var(--line); }
.topbar__logo img { display: block; }
.topbar__nav { display: flex; gap: .25rem; order: 3; width: 100%; overflow-x: auto; }
.topbar__nav a { padding: .55rem .9rem; border-radius: var(--radius-sm); color: var(--slate-500); text-decoration: none; white-space: nowrap; }
.topbar__nav a:hover { color: var(--navy-900); }
.topbar__nav a.is-active { background: var(--bg-hover); color: var(--navy-700); font-weight: 700; }

/* Hero banner (home) */
.hero { background: var(--slate-300) var(--hero-image) center / cover no-repeat; color: white; padding: 1.5rem 1rem; }
.hero h1 { margin: 0 0 .25rem; }
.hero p { margin: 0; }

/* Layout containers */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem; }
.cards-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.panel__title { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.panel__title h2 { margin: 0; font-size: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.25rem; }

/* Talking circles grid */
.circle-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.25rem; }
.circle { position: relative; display: grid; grid-template-columns: 36px 1fr 28px; gap: .25rem .85rem; padding: 1rem; background: white; border: 2px solid var(--line); border-radius: var(--radius); }
.circle:hover { box-shadow: var(--shadow); }
.circle.is-selected { border-color: var(--magenta); }
.circle.is-full { background: var(--bg-hover); color: var(--slate-300); }
.circle.is-full .circle__title, .circle.is-full .circle__mod strong { color: var(--slate-300); }
.circle__title { font-weight: 700; margin: 0; }
.circle__meta { grid-column: 2 / 4; font-size: .95rem; color: var(--slate-500); }
.circle__mod strong { color: var(--magenta); }
.circle__count { display: flex; justify-content: space-between; align-items: center; margin: .15rem 0 .35rem; }
.circle__count strong { color: var(--navy-900); }
.circle input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 0; border: 2px solid var(--line); border-radius: 8px; background: white; display: grid; place-content: center; cursor: pointer; }
.circle input[type="checkbox"]:checked { background: var(--magenta); border-color: var(--magenta); }
.circle input[type="checkbox"]:checked::after { content: "✓"; color: white; font-weight: 700; line-height: 1; }
.circle input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .6; }
.circle input[type="checkbox"]:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.circle .badge { grid-row: 1; }
.circle.is-full .badge { background: var(--slate-300); }
.circle.is-selected .badge { background: var(--magenta); }
.circle__label { grid-column: 2; cursor: pointer; }
.circle__label::after { content: ""; position: absolute; inset: 0; }  /* whole card clickable */
.circle input { position: relative; z-index: 1; }
.circle.is-full .circle__label { cursor: not-allowed; }

.selection-bar { position: sticky; bottom: 0; background: white; border-top: 1px solid var(--line); padding: .75rem 1rem; display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; box-shadow: 0 -4px 14px color-mix(in srgb, var(--navy-900) 6%, transparent); }
.selection-bar__count { font-weight: 700; }
.selection-bar__chips { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1; }
.selection-bar .btn { margin-left: auto; }

/* Centered pages (errors, confirmations) */
.center-page { max-width: 520px; margin: 0 auto; padding: 4rem 1.25rem; text-align: center; }
.center-page__code { font-size: 4rem; font-weight: 700; color: var(--magenta); margin: 0; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .circle-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .topbar { padding: .6rem 2rem; }
  .topbar__nav { order: 0; width: auto; }
  .hero { padding: 2rem 2rem; }
  .container { padding: 2rem; }
  .cards-2 { grid-template-columns: 1fr 1fr; }
  .circle-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .circle { transition: background .15s, box-shadow .15s, border-color .15s; }
}

/* Legibility of white text over the light areas of the background visual */
.hero h1, .hero p { text-shadow: 0 1px 4px color-mix(in srgb, var(--navy-900) 55%, transparent); }

/* Pages: banners, lists, actions */
.container--narrow { max-width: 760px; }
.banner { padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--warning-50); border: 1px solid var(--warning); color: var(--warning-700); font-weight: 700; }
.prose :first-child { margin-top: 0; }

.recap { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.recap__item { display: grid; grid-template-columns: 36px 1fr; gap: .5rem 1rem; align-items: start; }


/* Fixes after visual review */
.topbar__logo img { height: 44px; width: auto; }
.selection-bar__chips .chip { max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-bar__count { white-space: nowrap; }
@media (max-width: 639px) {
  .selection-bar__chips { order: 3; flex-basis: 100%; }
  .selection-bar__chips .chip { max-width: 100%; }
  .selection-bar .btn { min-height: 44px; padding: .6rem 1.1rem; }
}

.topbar__logo img { height: 54px; }
.selection-bar { z-index: 10; }
@media (max-width: 639px) {
  .selection-bar__chips { display: none; }   /* count + Confirm are enough on small screens */
  .selection-bar .btn { margin-left: auto; }
}

/* V2 registration form: identity block, final-choice note, recap */
.identity { margin: 1.25rem 0 0; border: 1px solid var(--line); min-width: 0; }
.identity__legend { float: left; width: 100%; margin: 0 0 1rem; padding: 0; font-size: 1.15rem; font-weight: 700; }
.identity__legend + * { clear: both; }
.identity .field:last-child { margin-bottom: 0; }
.topics-title { margin-top: 2rem; font-size: 1.3rem; }
.circle.is-locked { opacity: .55; }
.circle.is-locked .circle__label { cursor: not-allowed; }
.final-note { margin: 1.25rem 0 0; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--magenta-50); color: var(--navy-900); font-weight: 700; }
.recap__item { align-items: center; }
.recap__item strong { display: block; }
.recap__item .muted { font-size: .95rem; }
.banner--ok { background: var(--success-50); border-color: var(--success); color: var(--success-700); }

/* Footer */
.site-footer { margin-top: 2rem; padding: 1.25rem 1rem 1.5rem; border-top: 1px solid var(--line); color: var(--slate-500); font-size: .875rem; text-align: center; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer__notes { white-space: normal; }
