/* Site d'inscription — mobile-first, thème clair/sombre automatique, aucune dépendance. */
:root {
  --accent: #e85d04; --accent-strong: #c24a00; --on-accent: #fff; --accent-soft: #fff0e6;
  --bg: #faf7f4; --surface: #fff; --surface-2: #f6f1ec; --ink: #231f1b; --muted: #6b625a; --border: #e8e0d8;
  --ok: #167a3e; --ok-soft: #e3f5ea; --warn: #a55a00; --warn-soft: #fff3dc; --err: #b42318; --err-soft: #fdebe9;
  --info: #1d5fb4; --info-soft: #e6f0fc;
  --radius: 16px; --shadow: 0 1px 2px rgba(35, 31, 27, .05), 0 8px 24px rgba(35, 31, 27, .06);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff8a3d; --accent-strong: #ffa062; --on-accent: #1d1209; --accent-soft: #3a2415;
    --bg: #17130f; --surface: #211b16; --surface-2: #2a231d; --ink: #f4ece4; --muted: #b3a79b; --border: #3a3129;
    --ok: #5fd08a; --ok-soft: #14301f; --warn: #ffbb5c; --warn-soft: #36270f; --err: #ff8a80; --err-soft: #3a1a17;
    --info: #8db8f5; --info-soft: #15263d; --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 5vw, 2.1rem); line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.stack { display: grid; gap: 1rem; }
.stack.tight { gap: .5rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---- structure ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.site-header .wrap { display: flex; align-items: center; gap: .6rem; min-height: 56px; font-weight: 800; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
main.wrap { padding-top: 1.25rem; padding-bottom: 8.5rem; display: grid; gap: 1rem; align-content: start; }
main.wrap.no-bar { padding-bottom: 3rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; background: var(--surface-2); }
.section-title { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }

/* ---- en-tête évènement ---- */
.hero { display: grid; gap: .6rem; }
.hero .meta { display: flex; gap: .4rem 1rem; flex-wrap: wrap; color: var(--muted); font-size: .95rem; }
.hero .meta span { display: inline-flex; align-items: center; gap: .35rem; }
.prose { white-space: pre-line; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--accent-strong); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: .4rem; }

/* ---- formulaires ---- */
.field { display: grid; gap: .3rem; align-content: start; }
.field > label, .label { font-weight: 700; font-size: .92rem; }
.field > label.req::after { content: " *"; color: var(--accent-strong); }
.hint { color: var(--muted); font-size: .85rem; }
.input, .select {
  width: 100%; min-height: 46px; padding: .6rem .8rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--focus); }
.input.invalid, .select.invalid { border-color: var(--err); }
.grid-2 { display: grid; gap: .8rem; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.btn {
  appearance: none; border: 1.5px solid transparent; border-radius: 999px; min-height: 46px; padding: .55rem 1.2rem;
  font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  text-decoration: none; transition: transform .06s, opacity .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not([disabled]) { background: var(--accent-strong); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn.danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.btn.small { min-height: 38px; padding: .3rem .9rem; font-size: .9rem; }
.btn.block { width: 100%; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* case à cocher type interrupteur */
.sw { position: relative; display: inline-flex; flex: none; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sw .track { width: 46px; height: 28px; border-radius: 999px; background: var(--border); transition: background .15s; position: relative; }
.sw .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.sw input:checked + .track { background: var(--accent); }
.sw input:checked + .track::after { transform: translateX(18px); }
.sw input:focus-visible + .track { box-shadow: var(--focus); }
.sw input:disabled { cursor: not-allowed; }
.sw input:disabled + .track { opacity: .45; }

/* ---- badges / bandeaux ---- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.banner { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.banner .icon { margin-top: .2rem; color: var(--info); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.warn .icon { color: var(--warn); }
.banner.err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.banner.err .icon { color: var(--err); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.banner.ok .icon { color: var(--ok); }
.banner .grow > * + * { margin-top: .35rem; }

/* ---- choix de l'évènement ---- */
.event-link { display: grid; gap: .3rem; text-decoration: none; color: inherit; }
.event-link:hover { border-color: var(--accent); }
.event-link h2 { color: var(--ink); }

/* ---- participants / éléments ---- */
.participant-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.participant-head h2 { display: flex; align-items: center; gap: .5rem; }
.items { display: grid; gap: .6rem; }
.item { border: 1.5px solid var(--border); border-radius: 14px; padding: .8rem .9rem; display: grid; gap: .55rem; background: var(--surface); transition: border-color .15s, background .15s; }
.item.on { border-color: var(--accent); background: var(--accent-soft); }
.item.closed { background: var(--surface-2); opacity: .75; }
.item-head { display: flex; gap: .75rem; align-items: flex-start; cursor: pointer; }
.item.closed .item-head { cursor: not-allowed; }
.item-title { font-weight: 800; display: flex; gap: .4rem .6rem; align-items: center; flex-wrap: wrap; }
.item-meta { display: flex; flex-wrap: wrap; gap: .1rem .9rem; color: var(--muted); font-size: .88rem; }
.item-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.prices { display: flex; flex-wrap: wrap; gap: .3rem; }
.price { font-size: .82rem; padding: .08rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.price.main { background: var(--ink); color: var(--bg); }
.item .sub { padding-left: calc(46px + .75rem); display: grid; gap: .5rem; }
@media (max-width: 420px) { .item .sub { padding-left: 0; } }
.upload { border: 1.5px dashed var(--border); border-radius: 14px; padding: .8rem .9rem; display: grid; gap: .5rem; background: var(--surface-2); }
.file-name { font-size: .9rem; word-break: break-all; }

/* ---- récapitulatif ---- */
.lines { display: grid; gap: .35rem; }
.line { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.line .l { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.line.total { font-size: 1.15rem; font-weight: 800; padding-top: .6rem; border-top: 1px solid var(--border); margin-top: .3rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: .2rem 0; width: 100%; }
.codes { display: grid; gap: .5rem; }
.code { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.code strong.mono { font-size: 1.15rem; }

/* ---- barre du bas ---- */
.total-bar { position: fixed; inset: auto 0 0 0; z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0); }
.total-bar .wrap { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding-top: .7rem; padding-bottom: .7rem; }
.total-bar .amount { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.total-bar .label { color: var(--muted); font-size: .8rem; font-weight: 700; display: block; }

/* ---- toasts / dialogue ---- */
.toasts { position: fixed; z-index: 60; inset: auto 0 5.5rem 0; display: grid; gap: .5rem; padding: 0 1rem; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .6rem; align-items: flex-start; max-width: 520px; width: 100%; padding: .75rem .9rem; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.ok .icon:first-child { color: #5fd08a; }
.toast.err .icon:first-child, .toast.warn .icon:first-child { color: #ffbb5c; }
.toast span { flex: 1; min-width: 0; }
.toast-x { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; opacity: .7; }
.dialog { border: 0; padding: 0; border-radius: 20px; width: min(520px, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(20, 14, 8, .55); }
.dialog-body { padding: 1.3rem; }

.loading { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.spinner { width: 28px; height: 28px; margin: 0 auto .8rem; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-status { display: grid; gap: .6rem; justify-items: center; text-align: center; padding: 1rem 0; }
.big-status .circle { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.big-status .circle .icon { width: 32px; height: 32px; }
.big-status.ok .circle { background: var(--ok-soft); color: var(--ok); }
.big-status.warn .circle { background: var(--warn-soft); color: var(--warn); }
.big-status.err .circle { background: var(--err-soft); color: var(--err); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Choix du rôle : tuiles (3 rôles ou moins). Pas de bouton radio visible : la tuile choisie est en couleur avec une coche. */
.field > .label { font-size: .9rem; font-weight: 700; }
.field > .label.req::after { content: " *"; color: var(--accent-strong); }
.role-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; border-radius: 14px; outline: none; }
.role-tiles.invalid { box-shadow: 0 0 0 2px var(--err); }
.role-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 64px; padding: .7rem .4rem; text-align: center; cursor: pointer;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px; color: var(--muted); font-weight: 700; transition: background .15s, border-color .15s, color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.role-tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--ink); }
.role-tile:active { transform: scale(.98); }
.role-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.role-tile .rt-name { font-size: 1.02rem; }
.role-tile .rt-note { font-size: .75rem; font-weight: 700; color: var(--muted); }
.role-tile .rt-note.warn { color: var(--warn); }
.role-tile .rt-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transform: scale(0); opacity: 0; transition: transform .15s, opacity .15s; }
.role-tile .rt-check svg { width: 14px; height: 14px; stroke-width: 3.2; }
.role-tile:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 25%, transparent); }
.role-tile:has(input:checked) .rt-check { transform: scale(1); opacity: 1; }
.role-tile:has(input:focus-visible) { box-shadow: var(--focus); }
.role-tile.off { opacity: .5; cursor: not-allowed; background: var(--surface-2); }
.role-tile.off input { cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .role-tile, .role-tile .rt-check { transition: none; } }
