/* =====================================================================
   INVITATION - INTERFACE APPLICATIVE (auth, tableau de bord, formulaires)
   Identite visuelle : BLEU MARINE + DORE
   Approche Mobile First
   ===================================================================== */

/* ---------------- 1. Tokens ---------------- */
:root {
    /* Bleu marine */
    --navy-950: #040C1A;
    --navy-900: #071630;
    --navy-800: #0B2145;
    --navy-700: #102C58;
    --navy-600: #17396D;
    --navy-500: #1F4A87;
    --navy-100: #E6EBF3;

    /* Dore */
    --gold-700: #8A6A1F;
    --gold-600: #B08A2E;
    --gold-500: #C9A227;
    --gold-400: #D8B860;
    --gold-300: #E7D39A;
    --gold-100: #F6EEDA;

    /* Neutres raffines */
    --cream:   #FBF8F2;
    --ivory:   #FFFFFF;
    --sand:    #F3EDE2;
    --ink:     #0C1526;
    --muted:   #5E6B80;
    --line:    #E4DED1;

    /* Etats */
    --success: #1F7A54;
    --success-bg: #E7F4ED;
    --danger:  #B3261E;
    --danger-bg: #FBEAE8;
    --info-bg: #EAF0F9;

    /* Rayons, ombres, transitions */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;
    --sh-xs: 0 1px 2px rgba(7, 22, 48, .06);
    --sh-sm: 0 4px 14px rgba(7, 22, 48, .07);
    --sh-md: 0 10px 30px rgba(7, 22, 48, .10);
    --sh-lg: 0 24px 60px rgba(7, 22, 48, .16);
    --ease: cubic-bezier(.22, .61, .36, 1);

    --font-title: "Playfair Display", "Georgia", serif;
    --font-body:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --gold-gradient: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 45%, var(--gold-600) 100%);
    --navy-gradient: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
}

/* ---------------- 2. Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;              /* lisibilité mobile */
    line-height: 1.62;
    color: var(--ink);
    background: var(--cream);
    overflow-x: hidden;           /* aucun debordement horizontal */
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; display: block; }

/* Taille par defaut des icones SVG (surchargee par les regles de composant) */
svg { width: 18px; height: 18px; flex: 0 0 auto; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--gold-600); }

h1, h2, h3, h4 {
    font-family: var(--font-title);
    font-weight: 600;
    line-height: 1.22;
    margin: 0 0 .5rem;
    color: var(--navy-900);
    letter-spacing: -.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

button { font-family: inherit; }
::selection { background: var(--gold-300); color: var(--navy-900); }

:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
    border-radius: 6px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- 3. Mise en page ---------------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 16px;
}
.container-narrow { max-width: 760px; }

.page { padding: 20px 0 96px; }

.stack  { display: grid; gap: 16px; }
.row    { display: flex; flex-wrap: wrap; gap: 12px; }
.between{ display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.center { text-align: center; }
.muted  { color: var(--muted); }
.small  { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------------- 4. Marque ---------------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-title);
    font-size: 1.15rem;
    letter-spacing: .16em;
    color: var(--navy-900);
    text-transform: uppercase;
}
.brand:hover { color: var(--navy-900); }
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--navy-gradient);
    color: var(--gold-400);
    display: grid; place-items: center;
    font-size: 1.05rem;
    box-shadow: var(--sh-sm);
    border: 1px solid rgba(201, 162, 39, .45);
    flex: 0 0 auto;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-light, .brand-light:hover { color: var(--ivory); }

/* ---------------- 5. En-tete applicative ---------------- */
.appbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(251, 248, 242, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.appbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; min-height: 64px;
}
.appbar-actions { display: flex; align-items: center; gap: 8px; }

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--navy-gradient);
    color: var(--gold-300);
    display: grid; place-items: center;
    font-size: .8rem; font-weight: 600; letter-spacing: .04em;
    border: 1px solid rgba(201, 162, 39, .4);
    flex: 0 0 auto;
}
.user-chip {
    display: none;
    align-items: center; gap: 10px;
    padding: 5px 12px 5px 5px;
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    box-shadow: var(--sh-xs);
}
.user-chip strong { font-size: .82rem; font-weight: 600; }
.user-chip span { display: block; font-size: .72rem; color: var(--muted); }

/* ---------------- 6. Boutons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-size: .95rem; font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
    text-align: center;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.btn-primary {
    background: var(--navy-gradient);
    color: var(--ivory);
    box-shadow: 0 8px 24px rgba(11, 33, 69, .28);
}
.btn-primary:hover { color: var(--ivory); box-shadow: 0 12px 30px rgba(11, 33, 69, .36); }

.btn-gold {
    background: var(--gold-gradient);
    color: var(--navy-900);
    box-shadow: 0 8px 24px rgba(201, 162, 39, .34);
}
.btn-gold:hover { color: var(--navy-900); }

.btn-outline {
    background: var(--ivory);
    border-color: var(--line);
    color: var(--navy-800);
    box-shadow: var(--sh-xs);
}
.btn-outline:hover { border-color: var(--gold-400); color: var(--navy-900); }

.btn-ghost { background: transparent; color: var(--navy-700); min-height: 44px; padding: 10px 14px; }
.btn-ghost:hover { background: var(--navy-100); color: var(--navy-900); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(179, 38, 30, .22); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 9px 16px; font-size: .86rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------------- 7. Cartes ---------------- */
.card {
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 20px;
}
.card-lg { padding: 24px; border-radius: var(--r-xl); }
.card-head { margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin-bottom: 4px; }

.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .7rem; font-weight: 700;
    letter-spacing: .22em; text-transform: uppercase;
    color: var(--gold-600);
    margin-bottom: 10px;
}
.eyebrow::before {
    content: ""; width: 26px; height: 1px; background: var(--gold-400);
}

/* ---------------- 8. Formulaires ---------------- */
.field { margin-bottom: 18px; }
.field > label, .label {
    display: block;
    font-size: .95rem; font-weight: 600;
    letter-spacing: .01em;
    color: var(--navy-800);
    margin-bottom: 8px;
}
.hint { display: block; font-size: .88rem; color: var(--muted); margin-top: 7px; font-weight: 400; text-transform: none; letter-spacing: 0; line-height: 1.5; }

.input, .textarea, .select {
    width: 100%;
    min-height: 54px;
    padding: 15px 16px;
    font-size: 1.02rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--ivory);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
    appearance: none;
}
.textarea { min-height: 118px; resize: vertical; line-height: 1.55; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6B80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 44px;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, .16);
}
.input::placeholder, .textarea::placeholder { color: #9AA5B5; }
.input.is-invalid, .textarea.is-invalid, .select.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(179, 38, 30, .1);
}
.field-error { display: block; color: var(--danger); font-size: .82rem; margin-top: 6px; font-weight: 500; }

.input-icon { position: relative; }
.input-icon .input { padding-left: 46px; }
.input-icon > svg {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    width: 19px; height: 19px; color: var(--muted); pointer-events: none;
}
.pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; cursor: pointer;
    padding: 9px; border-radius: 50%; color: var(--muted); line-height: 0;
}
.pw-toggle:hover { background: var(--navy-100); color: var(--navy-800); }
.pw-toggle svg { width: 20px; height: 20px; }

.grid-2 { display: grid; gap: 16px; }

.check {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 14px 16px;
    background: var(--cream);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: border-color .18s var(--ease), background .18s var(--ease);
}
.check:hover { border-color: var(--gold-400); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy-700); flex: 0 0 auto; }
.check span { font-size: .92rem; }
.check strong { display: block; font-size: .95rem; }

/* Force du mot de passe */
.pw-meter { display: flex; gap: 5px; margin-top: 9px; }
.pw-meter i {
    height: 4px; flex: 1; border-radius: 2px; background: var(--line);
    transition: background .25s var(--ease);
}
.pw-meter.s1 i:nth-child(1) { background: var(--danger); }
.pw-meter.s2 i:nth-child(-n+2) { background: #D98324; }
.pw-meter.s3 i:nth-child(-n+3) { background: var(--gold-500); }
.pw-meter.s4 i { background: var(--success); }

/* ---------------- 8b. Liste des invités ---------------- */
.guest-list { display: grid; gap: 10px; margin-bottom: 12px; }

.guest-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--cream);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    animation: guestIn .3s var(--ease);
}
@keyframes guestIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
.guest-index {
    width: 30px; height: 30px; flex: 0 0 auto;
    border-radius: 50%;
    background: var(--navy-gradient);
    color: var(--gold-300);
    display: grid; place-items: center;
    font-size: .85rem; font-weight: 700;
    margin-top: 11px;
}
.guest-fields { flex: 1; min-width: 0; display: grid; gap: 8px; }
.guest-fields .input { min-height: 50px; }
.guest-seat { font-size: .95rem; }
.guest-del { margin-top: 11px; }
.guest-del:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------------- 8b-bis. Fiches invités ---------------- */
.guest-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }

.guest-card {
    padding: 16px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold-500);
    border-radius: var(--r-md);
    transition: border-color .2s var(--ease);
    min-width: 0;
    overflow: hidden;
}
.guest-card.is-off { border-left-color: var(--line); opacity: .78; }

.guest-card-head { display: flex; align-items: center; gap: 12px; }
.guest-card-id { flex: 1; min-width: 0; }
.guest-card-id b { display: block; font-size: 1.02rem; font-weight: 600; color: var(--navy-900); word-break: break-word; }
.guest-card-id span { display: block; font-size: .83rem; color: var(--muted); }

.guest-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}
.guest-card-actions form { display: contents; }
.guest-card-actions .btn { width: 100%; min-width: 0; padding-inline: 10px; }

/* ---------------- 8b-ter. Tableau des invités ---------------- */
.table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;              /* le tableau défile si l'écran est étroit */
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.data-table thead th {
    text-align: left;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 12px 12px;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .18s var(--ease); }
.data-table tbody tr:hover { background: var(--cream); }
.data-table tbody tr.is-off { opacity: .62; }
.data-table .col-num { width: 44px; color: var(--muted); font-weight: 600; }
.data-table .col-mid { width: 1%; white-space: nowrap; }
.data-table .col-act { width: 1%; }

@media (min-width: 760px) {
    /* Les actions tiennent sur une seule ligne, la colonne « Invité » respire */
    .data-table .col-act { min-width: 272px; }
    .data-table thead th:nth-child(2),
    .data-table tbody td:nth-child(2) { width: auto; min-width: 190px; }
    .data-table .row-actions { flex-wrap: nowrap; justify-content: flex-end; }
}

/* Colonne « Invité » */
.guest-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.guest-cell .avatar { width: 40px; height: 40px; font-size: .82rem; }
.guest-cell-id { min-width: 0; }
.guest-cell-id b {
    display: block;
    font-size: 1rem; font-weight: 600;
    color: var(--navy-900);
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
}
.guest-cell-id span { display: block; font-size: .8rem; color: var(--muted); }

/* Compteur d'ouvertures */
.count-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--navy-100);
    color: var(--navy-700);
    font-size: .85rem; font-weight: 600;
}
.count-pill svg { width: 15px; height: 15px; }

/* Étiquettes de réponse */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    font-size: .8rem; font-weight: 600;
    white-space: nowrap;
}
.tag svg { width: 14px; height: 14px; }
.tag-yes   { background: var(--success-bg); color: var(--success); }
.tag-no    { background: var(--danger-bg);  color: var(--danger); }
.tag-maybe { background: var(--gold-100);   color: var(--gold-700); }
.tag-wait  { background: var(--sand);       color: var(--muted); }

/* Actions de ligne */
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-actions form { display: inline-flex; margin: 0; }
.icon-btn.is-danger { color: var(--danger); border-color: rgba(179, 38, 30, .28); }
.icon-btn.is-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Bouton WhatsApp */
.btn-wa {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, #2BC25F 0%, #1EA952 60%, #178F45 100%);
    color: #fff;
    font-size: .86rem; font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(30, 169, 82, .3);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn-wa:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(30, 169, 82, .38); filter: brightness(1.05); }
.btn-wa:active { transform: translateY(0); }
.btn-wa svg { width: 17px; height: 17px; }

/* ---- Tableau empilé sur téléphone ---- */
@media (max-width: 759px) {
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }

    .data-table tbody tr {
        position: relative;
        margin-bottom: 12px;
        padding: 14px 14px 12px;
        background: var(--cream);
        border: 1px solid var(--line);
        border-left: 3px solid var(--gold-500);
        border-radius: var(--r-md);
    }
    .data-table tbody tr:hover { background: var(--cream); }
    .data-table tbody tr.is-off { border-left-color: var(--line); }

    .data-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--line);
    }
    .data-table tbody td:last-child { border-bottom: 0; padding-bottom: 0; }
    .data-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: .74rem; font-weight: 700;
        letter-spacing: .08em; text-transform: uppercase;
        color: var(--muted);
    }
    .data-table .col-num, .data-table .col-mid, .data-table .col-act { width: auto; white-space: normal; }

    /* Le numéro se place en pastille dans le coin */
    .data-table tbody td.col-num {
        position: absolute;
        top: 14px; right: 14px;
        width: auto; padding: 0; border: 0;
        font-size: .78rem; color: var(--muted);
    }
    .data-table tbody td.col-num::before { content: "N° "; letter-spacing: .04em; }

    /* La ligne « Invité » occupe toute la largeur, sans étiquette */
    .data-table tbody td:nth-child(2) { display: block; padding: 0 60px 12px 0; }
    .data-table tbody td:nth-child(2)::before { display: none; }

    /* Les actions passent en pleine largeur : WhatsApp en avant, icônes dessous */
    .data-table tbody td.col-act {
        display: block;
        padding-top: 12px;
    }
    .data-table tbody td.col-act::before { display: block; margin-bottom: 9px; }

    .row-actions { width: 100%; gap: 8px; }
    .row-actions .btn-wa { flex: 1 0 100%; min-height: 46px; font-size: .9rem; }
    .row-actions .icon-btn { width: 44px; height: 44px; }
}

/* ---------------- 8c. Musique d'ambiance ---------------- */
.audio-drop {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    background: var(--cream);
    border: 2px dashed var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    position: relative;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.audio-drop:hover { border-color: var(--gold-500); background: var(--gold-100); }
.audio-drop.is-filled { border-style: solid; border-color: var(--gold-400); background: var(--gold-100); }
.audio-drop.is-error  { border-color: var(--danger); background: var(--danger-bg); }
.audio-drop input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.audio-ico {
    width: 46px; height: 46px; flex: 0 0 auto;
    border-radius: 14px;
    background: var(--ivory); color: var(--gold-600);
    display: grid; place-items: center;
    box-shadow: var(--sh-xs);
}
.audio-ico svg { width: 22px; height: 22px; }
.audio-text { flex: 1; min-width: 0; }
.audio-text b { display: block; font-size: .97rem; color: var(--navy-900); word-break: break-word; }
.audio-text small { display: block; font-size: .83rem; color: var(--muted); margin-top: 2px; }
.audio-drop .icon-btn { position: relative; z-index: 2; }

.audio-current {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--gold-100);
    border: 1px solid var(--gold-300);
    border-radius: var(--r-md);
    margin-bottom: 12px;
}
.audio-current svg { width: 20px; height: 20px; color: var(--gold-700); }
.audio-current b { font-size: .92rem; word-break: break-word; }

/* ---------------- 9. Alertes ---------------- */
.alert {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    font-size: .92rem;
    border: 1px solid transparent;
    margin-bottom: 16px;
}
.alert svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #145C3E; border-color: rgba(31, 122, 84, .2); }
.alert-error   { background: var(--danger-bg); color: #8C1E18; border-color: rgba(179, 38, 30, .2); }
.alert-info    { background: var(--info-bg); color: var(--navy-700); border-color: rgba(23, 57, 109, .16); }
.alert code { background: rgba(255,255,255,.6); padding: 1px 5px; border-radius: 5px; font-size: .85em; }

/* ---------------- 10. Pages d'authentification ---------------- */
.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--cream);
}
.auth-aside {
    display: none;
    position: relative;
    padding: 48px 44px;
    background: var(--navy-gradient);
    color: var(--ivory);
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
}
.auth-aside::before {
    content: "";
    position: absolute; inset: -30% -40% auto auto;
    width: 540px; height: 540px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,.30), transparent 68%);
}
.auth-aside::after {
    content: "";
    position: absolute; inset: auto auto -25% -25%;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,.16), transparent 70%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 {
    color: var(--ivory);
    font-size: 2.3rem;
    max-width: 15ch;
    margin-bottom: 14px;
}
.auth-aside h2 em { color: var(--gold-400); font-style: italic; }
.auth-aside p { color: rgba(255,255,255,.76); max-width: 42ch; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: .94rem; color: rgba(255,255,255,.88); }
.auth-points svg { width: 22px; height: 22px; color: var(--gold-400); flex: 0 0 auto; }
.auth-quote { font-family: var(--font-title); font-style: italic; font-size: 1.05rem; color: rgba(255,255,255,.7); }

.auth-main {
    display: flex; flex-direction: column; justify-content: center;
    padding: 28px 18px 48px;
}
.auth-box { width: 100%; max-width: 440px; margin-inline: auto; }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-head p  { color: var(--muted); margin: 0; }
.auth-logo { margin-bottom: 30px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: .92rem; color: var(--muted); }
.auth-foot a { font-weight: 600; }
.link-gold { color: var(--gold-600); font-weight: 600; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------------- 11. Tableau de bord ---------------- */
.dash-hero {
    background: var(--navy-gradient);
    color: var(--ivory);
    border-radius: var(--r-xl);
    padding: 26px 22px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--sh-md);
}
.dash-hero::after {
    content: "";
    position: absolute; top: -70px; right: -70px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,.26), transparent 70%);
}
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero h1 { color: var(--ivory); font-size: 1.7rem; margin-bottom: 6px; }
.dash-hero h1 em { color: var(--gold-400); font-style: italic; }
.dash-hero p { color: rgba(255,255,255,.75); margin-bottom: 20px; max-width: 46ch; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.stat {
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--sh-xs);
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--gold-gradient);
}
.stat-ico {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--gold-100); color: var(--gold-700);
    display: grid; place-items: center; margin-bottom: 10px;
}
.stat-ico svg { width: 19px; height: 19px; }
.stat b { display: block; font-family: var(--font-title); font-size: 2rem; line-height: 1; color: var(--navy-900); }
.stat span { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: 6px; letter-spacing: 0; }

.toolbar {
    display: grid; gap: 10px;
    margin-bottom: 20px;
}
.toolbar form { display: grid; gap: 10px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 15px;
    border-radius: var(--r-pill);
    background: var(--ivory);
    border: 1px solid var(--line);
    font-size: .85rem; font-weight: 600; color: var(--muted);
    white-space: nowrap;
}
.chip:hover { border-color: var(--gold-400); color: var(--navy-800); }
.chip.is-active { background: var(--navy-800); border-color: var(--navy-800); color: var(--ivory); }
.chip.is-active:hover { color: var(--ivory); }

/* Liste des invitations */
.inv-grid { display: grid; gap: 16px; }
.inv-card {
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
    display: flex; flex-direction: column;
}
.inv-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.inv-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--navy-800);
    overflow: hidden;
}
.inv-cover img { width: 100%; height: 100%; object-fit: cover; }
.inv-cover-empty {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background: var(--navy-gradient);
    color: var(--gold-400);
}
.inv-cover-empty svg { width: 36px; height: 36px; }
.inv-cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(7,22,48,.72) 0%, rgba(7,22,48,.08) 52%, transparent 100%);
}
.inv-cover-text {
    position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 13px;
    color: #fff;
}
.inv-cover-text strong {
    display: block; font-family: var(--font-title); font-size: 1.2rem; font-weight: 600;
    text-shadow: 0 1px 10px rgba(0,0,0,.45);
}
.inv-cover-text span { font-size: .8rem; color: rgba(255,255,255,.82); }
.badge {
    position: absolute; z-index: 2; top: 12px; left: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; border-radius: var(--r-pill);
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    backdrop-filter: blur(6px);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active   { background: rgba(231,244,237,.94); color: #14603F; }
.badge-inactive { background: rgba(255,255,255,.9); color: var(--muted); }
.badge-views {
    left: auto; right: 12px;
    background: rgba(7,22,48,.56); color: #fff; letter-spacing: .04em;
}
.badge-views svg { width: 13px; height: 13px; }

.inv-body { padding: 16px; display: grid; gap: 11px; flex: 1; }
.inv-meta { display: grid; gap: 7px; font-size: .88rem; color: var(--muted); }
.inv-meta div { display: flex; align-items: flex-start; gap: 9px; }
.inv-meta svg { width: 16px; height: 16px; color: var(--gold-600); flex: 0 0 auto; margin-top: 2px; }
.inv-meta span { word-break: break-word; }

.inv-link {
    display: flex; align-items: center; gap: 8px;
    background: var(--cream);
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    padding: 9px 11px;
    font-size: .76rem; color: var(--muted);
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.guest-card .inv-link { background: var(--ivory); }
.inv-link > svg { width: 16px; height: 16px; color: var(--gold-600); flex: 0 0 auto; }
.inv-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.icon-btn {
    width: 36px; height: 36px; flex: 0 0 auto;
    border-radius: 9px; border: 1px solid var(--line);
    background: var(--ivory); color: var(--navy-700);
    display: grid; place-items: center; cursor: pointer;
    transition: all .18s var(--ease);
}
.icon-btn:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.is-done { background: var(--success-bg); color: var(--success); border-color: rgba(31,122,84,.3); }

.inv-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 16px 16px;
}
.inv-actions .btn { min-height: 44px; padding: 10px 12px; font-size: .84rem; }
.inv-actions form { display: contents; }
.act-row { display: flex; gap: 8px; }
.act-row > * { flex: 1; }

/* Etat vide */
.empty {
    text-align: center;
    padding: 46px 22px;
    background: var(--ivory);
    border: 1px dashed var(--line);
    border-radius: var(--r-xl);
}
.empty-ico {
    width: 74px; height: 74px; margin: 0 auto 18px;
    border-radius: 22px;
    background: var(--gold-100); color: var(--gold-600);
    display: grid; place-items: center;
}
.empty-ico svg { width: 34px; height: 34px; }
.empty h3 { font-size: 1.3rem; }
.empty p { color: var(--muted); max-width: 42ch; margin-inline: auto; }

/* ---------------- 12. Formulaire multi-etapes ---------------- */
.wizard-head { margin-bottom: 22px; }

.steps { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 24px; }
.step-item { flex: 1; text-align: center; position: relative; }
.step-item::before {
    content: ""; position: absolute; top: 17px; left: 0; right: 50%;
    height: 2px; background: var(--line); z-index: 0;
}
.step-item::after {
    content: ""; position: absolute; top: 17px; left: 50%; right: 0;
    height: 2px; background: var(--line); z-index: 0;
}
.step-item:first-child::before, .step-item:last-child::after { display: none; }
.step-item.is-done::before, .step-item.is-done::after,
.step-item.is-active::before { background: var(--gold-500); }
.step-dot {
    position: relative; z-index: 1;
    width: 36px; height: 36px; margin: 0 auto 8px;
    border-radius: 50%;
    background: var(--ivory);
    border: 2px solid var(--line);
    color: var(--muted);
    display: grid; place-items: center;
    font-size: .88rem; font-weight: 700;
    transition: all .3s var(--ease);
}
.step-dot svg { width: 17px; height: 17px; }
.step-item.is-active .step-dot {
    background: var(--navy-gradient); border-color: var(--navy-800); color: var(--gold-400);
    box-shadow: 0 0 0 5px rgba(23,57,109,.1);
}
.step-item.is-done .step-dot { background: var(--gold-gradient); border-color: var(--gold-500); color: var(--navy-900); }
.step-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); display: block; padding: 0 2px;
}
.step-item.is-active .step-label { color: var(--navy-800); }

.progress-rail { height: 5px; background: var(--sand); border-radius: 3px; overflow: hidden; margin-bottom: 22px; }
.progress-bar {
    height: 100%; width: 25%;
    background: var(--gold-gradient);
    border-radius: 3px;
    transition: width .45s var(--ease);
}

.panel { display: none; animation: panelIn .4s var(--ease); }
.panel.is-active { display: block; }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.panel-title { margin-bottom: 4px; }
.panel-intro { color: var(--muted); margin-bottom: 22px; }

.wizard-nav {
    display: flex; gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.wizard-nav .btn { flex: 1; }
.wizard-nav .btn-ghost { flex: 0 0 auto; }

/* Question mise en avant */
.hero-question {
    background: linear-gradient(140deg, var(--navy-900), var(--navy-700));
    color: var(--ivory);
    border-radius: var(--r-lg);
    padding: 22px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}
.hero-question::after {
    content: ""; position: absolute; right: -50px; bottom: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,.24), transparent 70%);
}
.hero-question > * { position: relative; z-index: 1; }
.hero-question h2 { color: var(--ivory); font-size: 1.35rem; margin-bottom: 8px; }
.hero-question p { color: rgba(255,255,255,.72); margin: 0; font-size: .92rem; }

.preview-line {
    background: var(--gold-100);
    border: 1px solid var(--gold-300);
    border-left: 3px solid var(--gold-500);
    border-radius: var(--r-md);
    padding: 15px 17px;
    font-family: var(--font-title);
    font-size: 1.02rem;
    font-style: italic;
    color: var(--navy-800);
    line-height: 1.5;
}
.preview-line b { font-style: normal; font-weight: 600; color: var(--gold-700); }

/* ---------------- 13. Importation des photos ---------------- */
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.photo-slot {
    grid-column: span 1;
    position: relative;
    background: var(--cream);
    border: 2px dashed var(--line);
    border-radius: var(--r-md);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.photo-slot.is-cover { grid-column: span 2; aspect-ratio: 16 / 10; }
.photo-slot:hover, .photo-slot.is-drag { border-color: var(--gold-500); background: var(--gold-100); }
.photo-slot.is-filled { border-style: solid; border-color: var(--gold-400); background: var(--navy-900); }
.photo-slot.is-error { border-color: var(--danger); background: var(--danger-bg); }

.photo-slot input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 3;
    width: 100%; height: 100%;
}
.photo-slot.is-filled input[type="file"] { z-index: 1; }

.photo-placeholder {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 7px; padding: 12px; text-align: center; pointer-events: none;
}
.photo-slot.is-filled .photo-placeholder { display: none; }
.photo-placeholder .ph-ico {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--ivory); color: var(--gold-600);
    display: grid; place-items: center;
    box-shadow: var(--sh-xs);
}
.photo-placeholder .ph-ico svg { width: 20px; height: 20px; }
.photo-placeholder b { font-size: .84rem; color: var(--navy-800); }
.photo-placeholder small { font-size: .72rem; color: var(--muted); line-height: 1.35; }

.photo-thumb {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: none; z-index: 1;
}
.photo-slot.is-filled .photo-thumb { display: block; }

.photo-num {
    position: absolute; top: 9px; left: 9px; z-index: 4;
    min-width: 25px; height: 25px; padding: 0 7px;
    border-radius: var(--r-pill);
    background: rgba(7,22,48,.72); color: var(--gold-300);
    font-size: .7rem; font-weight: 700; letter-spacing: .06em;
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.photo-slot.is-filled .photo-num { background: var(--gold-gradient); color: var(--navy-900); }
.photo-tools {
    position: absolute; top: 8px; right: 8px; z-index: 5;
    display: none; gap: 6px;
}
.photo-slot.is-filled .photo-tools { display: flex; }
.photo-tool {
    width: 32px; height: 32px; border-radius: 50%;
    border: 0; cursor: pointer;
    background: rgba(255,255,255,.93); color: var(--navy-800);
    display: grid; place-items: center;
    box-shadow: var(--sh-sm);
    transition: all .18s var(--ease);
}
.photo-tool:hover { background: #fff; transform: scale(1.06); }
.photo-tool.is-danger:hover { background: var(--danger); color: #fff; }
.photo-tool svg { width: 16px; height: 16px; }
.photo-size {
    position: absolute; bottom: 8px; left: 9px; z-index: 4;
    display: none;
    padding: 4px 9px; border-radius: var(--r-pill);
    background: rgba(7,22,48,.68); color: #fff;
    font-size: .68rem; letter-spacing: .03em;
}
.photo-slot.is-filled .photo-size { display: block; }

.photo-count {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 18px 0 0;
    padding: 14px 16px;
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font-size: .9rem;
}
.photo-count b { color: var(--navy-900); }
.photo-dots { display: flex; gap: 5px; }
.photo-dots i {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--line);
    transition: background .25s var(--ease), transform .25s var(--ease);
}
.photo-dots i.on { background: var(--gold-500); transform: scale(1.18); }

/* Recadrage de la couverture */
.focus-tool { margin-top: 16px; }
.focus-tool .label { margin-bottom: 10px; }
.range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--gold-300), var(--gold-500));
    outline: none;
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--navy-800); border: 3px solid var(--gold-400);
    cursor: pointer; box-shadow: var(--sh-sm);
}
.range::-moz-range-thumb {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--navy-800); border: 3px solid var(--gold-400);
    cursor: pointer;
}

/* Recapitulatif */
.recap { display: grid; gap: 10px; }
.recap-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 15px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.recap-item svg { width: 18px; height: 18px; color: var(--gold-600); flex: 0 0 auto; margin-top: 2px; }
.recap-item div { min-width: 0; }
.recap-item small {
    display: block; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 2px;
}
.recap-item b { font-weight: 600; font-size: .95rem; word-break: break-word; }

/* ---------------- 14. Modale ---------------- */
.modal {
    position: fixed; inset: 0; z-index: 90;
    display: none;
    align-items: center; justify-content: center;
    padding: 18px;
    background: rgba(4, 12, 26, .62);
    backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; animation: fadeIn .22s var(--ease); }
.modal-box {
    background: var(--ivory);
    border-radius: var(--r-xl);
    padding: 26px 22px;
    width: 100%; max-width: 420px;
    box-shadow: var(--sh-lg);
    animation: popIn .26s var(--ease);
    text-align: center;
}
.modal-ico {
    width: 60px; height: 60px; margin: 0 auto 16px;
    border-radius: 18px;
    display: grid; place-items: center;
    background: var(--danger-bg); color: var(--danger);
}
.modal-ico svg { width: 28px; height: 28px; }
.modal-box h3 { font-size: 1.25rem; }
.modal-box p { color: var(--muted); font-size: .94rem; }
.modal-actions { display: grid; gap: 9px; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- 15. Notification ---------------- */
.toast-wrap {
    position: fixed; z-index: 120;
    left: 16px; right: 16px; bottom: 18px;
    display: grid; gap: 9px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    background: var(--navy-900); color: #fff;
    box-shadow: var(--sh-lg);
    font-size: .92rem;
    animation: toastIn .3s var(--ease);
}
.toast svg { width: 19px; height: 19px; color: var(--gold-400); flex: 0 0 auto; }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(18px); } }

/* ---------------- 16. Partage ---------------- */
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.share-btn {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 15px 10px;
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font-size: .8rem; font-weight: 600; color: var(--navy-800);
    transition: all .18s var(--ease);
}
.share-btn:hover { border-color: var(--gold-400); transform: translateY(-2px); box-shadow: var(--sh-sm); color: var(--navy-900); }
.share-btn svg { width: 22px; height: 22px; color: var(--gold-600); }

/* ---------------- 17. Pied de page ---------------- */
.app-foot {
    padding: 26px 0 36px;
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
}
.app-foot .brand { font-size: .95rem; margin-bottom: 8px; }

/* ---------------- 18. Responsive ---------------- */
@media (min-width: 600px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .stats { grid-template-columns: repeat(4, 1fr); }
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
    .photo-slot.is-cover { grid-column: span 4; aspect-ratio: 21 / 9; }
    .toolbar { grid-template-columns: 1fr auto; align-items: center; }
    .toolbar form { grid-template-columns: 1fr auto; }
    .inv-actions { grid-template-columns: repeat(4, 1fr); }
    .guest-card-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .share-grid { grid-template-columns: repeat(4, 1fr); }
    .toast-wrap { left: auto; right: 22px; width: 360px; }
    h1 { font-size: 2.1rem; }
    .dash-hero { padding: 34px 32px; }
    .dash-hero h1 { font-size: 2.1rem; }
    .card { padding: 24px; }
    .card-lg { padding: 32px; }
    .auth-main { padding: 40px; }
}

@media (min-width: 860px) {
    .user-chip { display: flex; }
    .inv-grid { grid-template-columns: repeat(2, 1fr); }
    .page { padding: 32px 0 110px; }
    .steps { gap: 8px; }
    .step-label { font-size: .74rem; }
}

@media (min-width: 1024px) {
    .auth { grid-template-columns: 1.05fr .95fr; }
    .auth-aside { display: flex; }
    .inv-grid { grid-template-columns: repeat(3, 1fr); }
    .card-lg { padding: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------------- 19. Impression ---------------- */
@media print {
    .appbar, .wizard-nav, .inv-actions, .toolbar, .app-foot, .btn { display: none !important; }
    body { background: #fff; }
}
