/* Espace organisateur : sobre et dense, l'organisateur doit aller vite. Mêmes repères que les maquettes de l'étape 3. */
:root {
  --bg: #F2F4F1;
  --surface: #FFFFFF;
  --fg: #1B2320;
  --muted: #5B6661;
  --line: #DCE1DC;
  --soft: #EAEEEA;
  --accent: #2C5A4D;
  --accent-fg: #FFFFFF;
  --good: #2F7D4F;
  --warn: #B26A12;
  --bad: #B23A3A;
  --wait: #6B6F86;
  --accent-soft: #DCE9E3;
  --f-display: "Gilda Display", "Didot", "Bodoni 72", Georgia, serif;
  --f-body: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513; --surface: #181D1A; --fg: #E3E9E5; --muted: #95A19A; --line: #29312D; --soft: #1F2622;
    --accent: #86C2AD; --accent-fg: #0F1A16; --good: #6FC28F; --warn: #E3A452; --bad: #E47C7C; --wait: #A5A9C2; --accent-soft: #1E3A31;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
h1, h2 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--f-display); font-weight: 400; font-size: 32px; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar-in { max-width: 1040px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-size: 22px; color: var(--fg); text-decoration: none; }
.topnav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topnav a, .linklike { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.topnav a:hover, .linklike:hover { color: var(--fg); }
.inline { display: inline; margin: 0; }

.page { max-width: 1040px; margin: 0 auto; padding-block: 32px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack, .stack-lg { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { gap: 22px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pagehead { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.help { font-size: 13px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.narrow { max-width: 480px; margin: 0 auto; }
.hero { max-width: 640px; display: flex; flex-direction: column; gap: 16px; padding-block: 24px; }
.hero h1 { font-size: 40px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.field label { font-weight: 500; }
.field input, .field select { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%; }
.field input.invalid { border-color: var(--bad); }
.validation-message { color: var(--bad); font-size: 13px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-form .span-2 { grid-column: 1 / -1; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form .field { flex: 1 1 200px; }
@media (max-width: 560px) { .grid-form { grid-template-columns: minmax(0, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 16px; min-height: 44px; font-weight: 500; color: var(--fg); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--soft); }
.btn-p { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-p:hover { background: var(--accent); filter: brightness(1.08); }

.alert { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.alert-bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.alert-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.alert-ok { background: color-mix(in srgb, var(--good) 12%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 500; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-yes { color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.st-wait { color: var(--wait); background: color-mix(in srgb, var(--wait) 14%, transparent); }
.st-draft { color: var(--muted); background: var(--soft); }

.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.code-secours, .key { font-family: var(--f-mono); font-size: 15px; background: var(--soft); border-radius: 8px; padding: 8px 10px; display: block; text-align: center; letter-spacing: .04em; }
.key { display: inline-block; margin: 6px 0; text-align: left; }
.uri { font-family: var(--f-mono); font-size: 12px; overflow-wrap: anywhere; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }

.events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.event { gap: 8px; }
.event-name { font-family: var(--f-display); font-size: 22px; color: var(--fg); text-decoration: none; }
.event-name:hover { text-decoration: underline; }
.empty { align-items: flex-start; }

/* ---------- Module 2 : espace d'un événement ---------- */
h3 { margin: 0; font-size: 16px; font-weight: 600; }
.h1-like { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.15; }
.row.between { justify-content: space-between; align-items: flex-end; }
.narrow-lg { max-width: 640px; margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; resize: vertical; font: inherit; color: inherit; }
.pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 500; margin-bottom: 6px; }
.btn-s { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-s.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.btn-danger { color: var(--bad); }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.linklike { color: var(--accent); text-decoration: underline; font-size: inherit; }
.st-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }

.workspace { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.ws-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.ws-back { color: var(--muted); text-decoration: none; font-size: 14px; }
.ws-name { font-family: var(--f-display); font-size: 20px; line-height: 1.2; }
.ws-nav nav { display: flex; flex-direction: column; gap: 2px; }
.ws-nav nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.ws-nav nav a:hover { background: var(--soft); color: var(--fg); }
.ws-nav nav a[aria-current="page"] { background: var(--accent-soft); color: var(--fg); font-weight: 500; }
.ws-main, .wizard-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.wizard-head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.wizard-body { grid-column: 1 / -1; }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.wizard-steps a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 14px; color: var(--fg); text-decoration: none; }
.wizard-steps span { width: 24px; height: 24px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; }
.wizard-steps li[aria-current="step"] a { border-color: var(--accent); }
.wizard-steps li[aria-current="step"] span, .wizard-steps li.done span { background: var(--accent); color: var(--accent-fg); }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ws-nav { position: static; }
  .ws-nav nav { flex-direction: row; overflow-x: auto; }
  .ws-nav nav a { white-space: nowrap; }
}

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.checklist li::before { font-weight: 700; width: 1em; }
.checklist li.ok::before { content: "✓"; color: var(--good); }
.checklist li.ko::before { content: "✕"; color: var(--bad); }
.checklist li.warn::before { content: "!"; color: var(--warn); }
.checklist li a { margin-left: auto; font-size: 14px; }

.life { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.life li { padding: 8px 14px; border: 1px solid var(--line); margin-left: -1px; font-size: 14px; background: var(--surface); }
.life li:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.life li:last-child { border-radius: 0 9px 9px 0; }
.life li[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; background: var(--bg); flex-wrap: wrap; align-self: flex-start; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--fg); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* Apparence */
.appear { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 20px; align-items: start; }
@media (max-width: 1020px) { .appear { grid-template-columns: minmax(0, 1fr); } }
.swatches { display: inline-flex; border-radius: 4px; overflow: hidden; }
.swatches i { width: 10px; height: 16px; display: block; }
.colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .colors { grid-template-columns: minmax(0, 1fr); } }
.color { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.color input[type="color"] { width: 44px; height: 44px; border: 0; padding: 0; background: none; border-radius: 8px; grid-row: span 2; cursor: pointer; }
.color label { font-size: 14px; font-weight: 500; }
.color input[type="text"] { font-family: var(--f-mono); font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; width: 100%; background: var(--surface); color: inherit; text-transform: uppercase; }
.contrast { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.contrast div { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.contrast dt { color: var(--muted); }
.contrast dd { margin: 0; }
.contrast b { font-family: var(--f-mono); font-weight: 500; }
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.drop-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 4px; }
.preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* Aperçu de l'écran invité : réduction exacte d'un écran de 390 × 760 */
.pv-phone { border-radius: 34px; border: 8px solid #141816; overflow: hidden; position: relative; max-width: 100%; flex: none; }
.pv-screen { position: absolute; top: 0; left: 0; width: 390px; height: 760px; transform-origin: top left; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 20px; text-align: center; font-family: var(--f-body); }
.pv-from, .pv-hint { font-size: 14px; }
.pv-env { width: 300px; aspect-ratio: 3 / 2; position: relative; border-radius: 6px; background: #D9D0BE; }
.pv-env .front { position: absolute; inset: 0; clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%); border-radius: 6px; background: #EFE6D4; }
.pv-env .flap { position: absolute; left: 0; right: 0; top: 0; height: 50%; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #E5DCC9; }
.pv-env .seal { position: absolute; left: 50%; top: 46%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: 19px; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25); }
.pv-env .nm { position: absolute; left: 0; right: 0; bottom: 9%; font-family: var(--f-display); font-size: 21px; color: #3A3226; }
.pv-env .nm small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.pv-inv { width: 350px; background: #EFE6D4; color: #3A3226; border-radius: 6px; padding: 20px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); }
.pv-inv.portrait { width: 300px; }
.pv-inv.square .pv-card { aspect-ratio: 1; }
.pv-inv.portrait .pv-card { aspect-ratio: 4 / 5; }
.pv-inv.has-img { padding: 0; overflow: hidden; background: transparent; }
.pv-inv img { width: 100%; max-height: 480px; object-fit: contain; display: block; }
.pv-card { border: 1px solid rgba(58,50,38,.35); outline: 1px solid rgba(58,50,38,.2); outline-offset: -6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; }
.pv-card .k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.pv-card .who { font-family: var(--f-display); font-size: 34px; line-height: 1.05; }
.pv-card .when { font-size: 14.5px; }
.pv-card .rule { width: 40px; height: 1px; background: currentColor; opacity: .4; }
.pv-card .name { font-family: var(--f-display); font-size: 22px; }
.pv-card .addr { font-size: 12.5px; opacity: .8; }
.pv-btns { display: flex; flex-direction: column; gap: 10px; }
.pv-btn { width: 350px; min-height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 16px; font-weight: 500; }

/* ---------- Module 3 : invités ---------- */
h4 { margin: 0; font-size: 15px; font-weight: 600; }
.search { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%; color: inherit; font: inherit; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .toggle input, .toggle input::after { transition: none; } }
.people-edit { display: flex; flex-direction: column; gap: 8px; }
.person-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; }
.person-row input { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; color: inherit; font: inherit; }
@media (max-width: 640px) { .person-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .person-row input[type="email"] { grid-column: 1 / -1; } }
.xbtn { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; }
.xbtn:hover { background: var(--soft); color: var(--bad); }
.groups { display: flex; flex-direction: column; gap: 12px; }
.group { gap: 0; padding: 0; }
.group-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.group-head > div { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.group-body { border-top: 1px solid var(--line); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.persons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.person:first-child { border-top: 0; padding-top: 0; }
.person-name { font-weight: 500; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person > .row { margin-left: auto; }
.person select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 36px; background: var(--surface); color: inherit; font: inherit; font-size: 14px; }
.linkbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.link { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pin { font-family: var(--f-mono); font-size: 16px; letter-spacing: .2em; }
