/* ==========================================================================
   Faire-part — feuille de style de l'application (site, tableau de bord, admin)
   Palette : encre bleu nuit, papier froid, sceau de cire bordeaux, laiton.
   ========================================================================== */

:root {
    --ink: #1D2230;
    --ink-soft: #4A5165;
    --paper: #F6F5F2;
    --surface: #FFFFFF;
    --line: #E1DFDA;
    --seal: #8E2F3C;
    --seal-dark: #6E2230;
    --brass: #A8844A;
    --ok: #2F6B4F;
    --warn: #9A6A12;
    --danger: #B3261E;
    --info: #2D5D8A;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(29, 34, 48, .06), 0 8px 24px rgba(29, 34, 48, .06);
    --font-display: 'Gilda Display', Georgia, serif;
    --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --ink: #ECE9E4;
    --ink-soft: #A9ADBA;
    --paper: #14171F;
    --surface: #1D212C;
    --line: #2E3342;
    --seal: #C0505F;
    --seal-dark: #A63F4E;
    --brass: #CBA56A;
    --ok: #5FB38B;
    --warn: #D9A441;
    --danger: #E5675F;
    --info: #6FA3D6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #ECE9E4;
        --ink-soft: #A9ADBA;
        --paper: #14171F;
        --surface: #1D212C;
        --line: #2E3342;
        --seal: #C0505F;
        --seal-dark: #A63F4E;
        --brass: #CBA56A;
        --ok: #5FB38B;
        --warn: #D9A441;
        --danger: #E5675F;
        --info: #6FA3D6;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.6 var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--seal); text-underline-offset: 3px; }
a:hover { color: var(--seal-dark); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 36rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-soft); }
.inline { display: inline; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* ----------------------------------------------------------- Mise en page */

.container { width: min(1180px, 100% - 2rem); margin: 1.5rem auto 3rem; flex: 1; }
.narrow { max-width: 560px; margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.align-start { align-items: start; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: .8rem clamp(1rem, 3vw, 2rem);
    background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.seal {
    width: 26px; height: 26px; border-radius: 50%; display: inline-block; flex: none;
    background: radial-gradient(circle at 35% 30%, #B34A58, var(--seal) 55%, var(--seal-dark));
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .12), 0 1px 2px rgba(0, 0, 0, .25);
}
.seal-large { width: 64px; height: 64px; margin-bottom: 1rem; }
.topnav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .92rem; }
.topnav > a:not(.btn) { color: var(--ink); text-decoration: none; }
.topnav > a:not(.btn):hover { color: var(--seal); }
.lang-switch a { color: var(--ink-soft); text-decoration: none; font-size: .8rem; padding: 0 .15rem; }
.lang-switch a[aria-current] { color: var(--ink); font-weight: 700; }
.icon-btn, .link-btn { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: .25rem .4rem; border-radius: 6px; }
.icon-btn { font-size: 1.1rem; line-height: 1; }
.icon-btn:hover { background: var(--line); }
.link-btn { color: var(--seal); text-decoration: underline; text-underline-offset: 3px; padding: 0; }

.site-footer { padding: 1.5rem; text-align: center; color: var(--ink-soft); font-size: .85rem; border-top: 1px solid var(--line); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Boutons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--ink);
    background: var(--ink); color: var(--paper); font: 600 .9rem/1.2 var(--font-ui);
    text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--seal); border-color: var(--seal); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-gold { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn-gold:hover { background: var(--seal); border-color: var(--seal); }
.btn-small { padding: .35rem .8rem; font-size: .82rem; }
.btn-large { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.file-btn { position: relative; }

/* ------------------------------------------------------------ Formulaires */

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .9rem; }
input, select, textarea {
    display: block; width: 100%; margin-top: .3rem;
    padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink); font: 400 .95rem/1.4 var(--font-ui);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--seal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: auto; margin: 0 .35rem 0 0; accent-color: var(--seal); }
input[type="color"] { height: 42px; padding: .2rem; cursor: pointer; }
input[type="file"] { padding: .45rem; font-size: .85rem; }
textarea { resize: vertical; min-height: 5rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.card { padding: 1.3rem; }
legend { font-family: var(--font-display); font-size: 1.2rem; padding: 0; margin-bottom: .8rem; float: left; width: 100%; }
legend + * { clear: both; }
.check { display: inline-flex; align-items: center; font-weight: 500; margin: 0 1rem .6rem 0; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; margin: 0; }

.auth-card, .narrow-card { max-width: 440px; margin: 2rem auto; }
.auth-card h1 { text-align: center; }

.copy-field { display: flex; gap: .4rem; align-items: center; }
.copy-field input { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.copy-field code { background: var(--paper); border: 1px dashed var(--line); padding: .5rem .8rem; border-radius: 6px; font-size: 1.1rem; letter-spacing: .08em; }

/* ------------------------------------------------------ Cartes / alertes */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card > :last-child { margin-bottom: 0; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; background: var(--surface); }
.alert-success { border-color: var(--ok); }
.alert-error { border-color: var(--danger); }
.alert-warn, .alert-warning { border-color: var(--warn); }
.alert-info { border-color: var(--info); }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--ink-soft); white-space: nowrap; }
.badge-ok, .badge-yes, .badge-status-responded { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge-no { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge-warn, .badge-maybe, .badge-status-viewed { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge-gold { background: color-mix(in srgb, var(--brass) 20%, transparent); color: var(--brass); }
.badge-pending, .badge-muted, .badge-status-not_sent { background: var(--line); color: var(--ink-soft); }
.badge-status-sent { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }

/* ----------------------------------------------------- Onglets / tableaux */

.event-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.event-head h1 { margin: 0; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; scrollbar-width: thin; }
.tabs a { padding: .6rem .9rem; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--seal); border-bottom-color: var(--seal); }

.table-wrap { overflow-x: auto; border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; color: var(--ink-soft); font-weight: 700; background: var(--paper); }
.table tbody tr:hover { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.guests-table td:first-child { width: 2rem; }

.pagination { display: flex; gap: .3rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .3rem .7rem; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; }
.pagination [aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.filters, .filters-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label, .filters-form label { margin: 0; flex: 1 1 160px; }
.bulk-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .8rem; }
.bulk-bar .check { margin: 0 .5rem 0 0; }

/* ------------------------------------------------------------ Statistiques */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.stat-label { color: var(--ink-soft); font-size: .82rem; }
.mini-stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-soft); margin: .5rem 0 0; padding: 0; list-style: none; }
.mini-stats strong { color: var(--ink); }

.bars { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.bars li { display: grid; grid-template-columns: 8rem 1fr 3rem; gap: .6rem; align-items: center; font-size: .85rem; }
.bars b { text-align: right; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--seal); }
.bar i.yes { background: var(--ok); }
.bar i.maybe { background: var(--warn); }
.bar i.no { background: var(--danger); }
.bar i.pending { background: var(--ink-soft); }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span, .progress > i { display: block; height: 100%; background: var(--seal); border-radius: inherit; }
progress { width: 100%; accent-color: var(--seal); }

/* -------------------------------------------------------------- Événements */

.event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.event-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem; position: relative; }
.event-card h2 { margin: 0; }
.event-card h2 a { color: var(--ink); text-decoration: none; }
.event-card h2 a::after { content: ''; position: absolute; inset: 0; }
.event-card h2 a:hover { color: var(--seal); }
.event-card .badge { align-self: flex-start; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.danger-zone h2 { color: var(--danger); }

.schedule-rows { display: grid; gap: .5rem; margin-bottom: .8rem; }
.schedule-row { display: grid; grid-template-columns: 7rem 1fr 1.4fr auto; gap: .5rem; align-items: center; }
.schedule-row input { margin: 0; }
@media (max-width: 640px) { .schedule-row { grid-template-columns: 6.5rem 1fr auto; } .schedule-row input[name="sched_desc[]"] { grid-column: 1 / -2; } }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.photo-item { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; display: grid; gap: .4rem; }
.photo-item img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 5px; }
.photo-item input { margin: 0; font-size: .82rem; padding: .35rem .5rem; }
.order-input { max-width: 5rem; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; vertical-align: middle; border: 1px solid var(--line); }

.message-list { list-style: none; padding: 0; margin: 0; }
.message-list li { display: grid; grid-template-columns: auto 1fr; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.message-list blockquote { margin: 0 0 .3rem; white-space: pre-line; }
.msg-meta { font-size: .8rem; color: var(--ink-soft); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.email-preview { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; background: var(--paper); white-space: pre-line; font-size: .9rem; }

.plan-card { text-align: center; }
.plan-price { font-family: var(--font-display); font-size: 2.4rem; margin: .2rem 0; color: var(--seal); }
.plan-card .step-list { text-align: left; }

/* ------------------------------------------------------- Éditeur de design */

.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 960px) { .design-layout { grid-template-columns: 1fr; } .design-preview-wrap { order: -1; } }
.design-preview-wrap { position: sticky; top: 5rem; }
.design-preview {
    --primary: #8E2F3C; --secondary: #C9A96E;
    aspect-ratio: 3 / 4.2; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
    padding: 2rem 1.5rem; text-align: center; color: #2A2A2A;
    background-color: #FDFCFA; background-image: var(--bg-image); background-size: cover; background-position: center;
    border: 10px solid #fff; outline: 1px solid var(--secondary); outline-offset: -18px;
    font-family: var(--font-body), system-ui, sans-serif;
}
.dp-monogram { font-family: var(--font-heading), serif; font-size: 1.4rem; color: var(--primary); border: 1px solid var(--secondary); border-radius: 50%; width: 3.2rem; height: 3.2rem; display: grid; place-items: center; }
.dp-monogram:empty { display: none; }
.dp-kicker { font-size: .8rem; letter-spacing: .12em; color: var(--secondary); margin: 0; }
.dp-names { font-family: var(--font-heading), serif; font-size: 2rem; line-height: 1.15; color: var(--primary); margin: 0; }
.dp-names span { display: block; font-size: .7em; color: var(--secondary); }
.dp-date { font-size: .95rem; margin: 0; }
.dp-button { margin-top: .8rem; background: var(--primary); color: #fff; padding: .45rem 1.2rem; border-radius: 999px; font-size: .85rem; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.template-option { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; cursor: pointer; display: grid; gap: .25rem; margin: 0; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-option:has(input:checked) { border-color: var(--seal); box-shadow: 0 0 0 2px var(--seal); }
.template-option:has(input:focus-visible) { outline: 2px solid var(--seal); outline-offset: 2px; }
.template-option.locked { opacity: .55; cursor: not-allowed; }
.template-option small { color: var(--ink-soft); font-size: .78rem; }
.template-option .lock { color: var(--brass); font-weight: 700; }
.swatch { height: 46px; border-radius: 6px; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 100%); }

.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.bg-option { margin: 0; font-weight: 500; font-size: .8rem; text-align: center; cursor: pointer; }
.bg-option input { position: absolute; opacity: 0; }
.bg-option span { display: block; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: #FDFCFA center / cover no-repeat; margin-bottom: .3rem; }
.bg-option:has(input:checked) span { box-shadow: 0 0 0 3px var(--seal); }
.bg-option:has(input:focus-visible) span { outline: 2px solid var(--seal); outline-offset: 2px; }

/* ----------------------------------------------------------------- Check-in */

.checkin { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .checkin { grid-template-columns: 1fr; } }
.checkin-counter { font-family: var(--font-display); font-size: 2.2rem; text-align: center; margin-bottom: .6rem; }
.checkin-counter span { color: var(--seal); }
.reader { width: 100%; min-height: 60px; border-radius: 10px; overflow: hidden; background: var(--paper); }
.reader video { width: 100% !important; border-radius: 10px; }
.scanner-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0; }
.scan-result { border-radius: 10px; padding: 1rem; text-align: center; font-size: 1.05rem; animation: pop .25s ease-out; }
.scan-result strong { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
.scan-result.ok { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); border: 2px solid var(--ok); }
.scan-result.already { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); border: 2px solid var(--warn); }
.scan-result.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 2px solid var(--danger); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.manual-list { list-style: none; padding: 0; margin: .8rem 0 0; max-height: 480px; overflow-y: auto; }
.manual-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.manual-list li[hidden] { display: none; }

/* ------------------------------------------------------------ Accueil public */

.home-main { flex: 1; }
.hero {
    width: min(1180px, 100% - 2rem); margin: 0 auto; padding: clamp(2.5rem, 7vw, 5.5rem) 0 3rem;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center;
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero .lead { margin-inline: auto; } .hero-actions { justify-content: center; } }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

.hero-envelope { position: relative; width: min(100%, 380px); aspect-ratio: 1.45; margin: 2rem auto 0; perspective: 900px; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; border-radius: 6px; }
.env-back { background: #D9D4CC; }
.env-front { background: linear-gradient(to top right, #EAE6DF 50%, transparent 50.5%) left / 50.5% 100% no-repeat, linear-gradient(to top left, #E4DFD7 50%, transparent 50.5%) right / 50.5% 100% no-repeat; z-index: 3; }
.env-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, #EFEBE5 0 45%, transparent 45%); clip-path: polygon(0 100%, 50% 45%, 100% 100%); }
.env-flap { background: #CFC9BF; clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: top; z-index: 4; animation: flap 1.1s .5s cubic-bezier(.6, 0, .3, 1) forwards; }
.env-card {
    position: absolute; left: 7%; right: 7%; top: 8%; bottom: 8%; z-index: 2;
    background: #FFFDF9; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2A2A2A;
    outline: 1px solid var(--brass); outline-offset: -8px;
    animation: rise 1s 1.3s cubic-bezier(.3, .7, .3, 1) forwards;
}
.env-names { font-family: var(--font-display); font-size: 1.6rem; margin: 0; color: #8E2F3C; }
.env-date { letter-spacing: .3em; font-size: .85rem; color: #7A6A50; margin: 0; }
.env-seal {
    position: absolute; left: 50%; top: 52%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; z-index: 5;
    background: radial-gradient(circle at 35% 30%, #B34A58, #8E2F3C 55%, #6E2230);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3), inset 0 0 0 5px rgba(255, 255, 255, .08);
    animation: seal-off .4s .3s ease-in forwards;
}
@keyframes seal-off { to { transform: scale(.4) translateY(40px); opacity: 0; } }
@keyframes flap { to { transform: rotateX(180deg); z-index: 1; } }
@keyframes rise { to { transform: translateY(-42%); z-index: 6; } }

.steps { padding-bottom: 3rem; }
.step-list { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.step-list li { counter-increment: step; position: relative; padding-left: 2.6rem; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--seal); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 700; }
.steps .step-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem 1.2rem 3.6rem; }
.steps .step-list li::before { left: 1.1rem; top: 1.2rem; }
.plan-card .step-list { grid-template-columns: 1fr; gap: .4rem; margin-bottom: 1rem; }
.plan-card .step-list li { padding-left: 1.6rem; }
.plan-card .step-list li::before { content: '✓'; background: none; color: var(--ok); width: auto; height: auto; }

/* ------------------------------------------------------------ Pages erreur */

.error-page { display: grid; place-items: center; min-height: 70vh; text-align: center; padding: 2rem; }
.error-box { max-width: 460px; }
.error-code { font-family: var(--font-display); font-size: 5rem; line-height: 1; color: var(--seal); margin: 0; }

/* ------------------------------------------------------------ Pass imprimable */

.print-pass { background: var(--paper); align-items: center; justify-content: center; padding: 2rem 1rem; }
.pass-card { background: #fff; color: #222; width: min(360px, 100%); border-radius: 14px; padding: 2rem 1.5rem; text-align: center; box-shadow: var(--shadow); border-top: 8px solid var(--primary, #8E2F3C); margin: 0 auto 1.5rem; }
.pass-card .muted { color: #666; }
.pass-couple { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: .2rem; color: var(--primary, #8E2F3C); }
.pass-name { font-weight: 700; font-size: 1.15rem; margin: 1rem 0 .2rem; }
#qr, #guest-qr { display: flex; justify-content: center; margin: 1rem auto; }
#qr img, #qr canvas { width: 220px; height: 220px; }

/* ------------------------------------------------------------ Divers */

.preview-bar { background: var(--ink); color: var(--paper); text-align: center; padding: .5rem; font-size: .85rem; }
.preview-bar a { color: var(--paper); margin-left: .8rem; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .6rem 1.1rem; border-radius: 999px; font-size: .88rem; z-index: 200; box-shadow: var(--shadow); animation: pop .2s ease-out; }

@media (max-width: 640px) {
    .topbar { padding: .6rem 1rem; }
    .topnav { gap: .6rem; font-size: .85rem; }
    .card { padding: 1rem; }
    .bars li { grid-template-columns: 6rem 1fr 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

@media print {
    .no-print, .topbar, .site-footer, .tabs, .skip-link { display: none !important; }
    body { background: #fff; }
    .pass-card { box-shadow: none; border: 1px solid #ccc; }
}

/* Compléments tableau de bord */
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats dt { font-size: .75rem; }
.mini-stats dd { margin: 0; font-weight: 700; color: var(--ink); }
.countdown-small { font-family: var(--font-display); color: var(--seal); font-size: 1.1rem; margin: 0; }
.event-card .progress { margin: .4rem 0; }
.event-card a:not(h2 a), .event-card form, .event-card button { position: relative; z-index: 1; }
.copy-field + p, .copy-field + .share-row { margin-top: .6rem; }
.filters > input, .filters > select, .filters-form > input, .filters-form > select { width: auto; flex: 1 1 180px; margin: 0; }
.filters-form > input[type="search"] { flex-basis: 260px; }
details.card > summary { cursor: pointer; font-weight: 700; }
details.card[open] > summary { margin-bottom: 1rem; }
label.btn { margin: 0; font-weight: 600; }
