:root {
    --ink: #1f1a17;
    --ink-soft: #5c524b;
    --paper: #fbf7f0;
    --card: #ffffff;
    --line: #e9e1d4;
    --gold: #b8893b;
    --gold-dark: #8f6a2c;
    --green: #1f5c4a;
    --danger: #b3261e;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(60, 40, 20, .08);
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.55; }
a { color: var(--gold-dark); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.inline { display: inline; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--gold-dark); font-weight: 700; margin: 0 0 .4em; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .75em 1.3em; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); background: #000; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-small { padding: .5em 1em; font-size: .85rem; }
.btn-large { padding: .95em 1.7em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #0b3d20; }
.btn-whatsapp:hover { background: #1fbd59; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); cursor: pointer; }
.link-button:hover { color: var(--ink); text-decoration: underline; }
.danger { color: var(--danger); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; color: var(--ink-soft); flex-shrink: 0; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Barre du haut */
.topbar { background: rgba(251,247,240,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav > a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }

/* Messages */
.flashes { margin-top: 20px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; }
.flash-success { background: #eaf6ef; border-color: #b7dcc5; color: #1b5e3a; }
.flash-error { background: #fdecea; border-color: #f3b8b3; color: var(--danger); }
.flash-info { background: #fbf3e2; border-color: #ecd7ab; color: #6e5220; }

/* Accueil */
.hero { padding: 64px 0 48px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
.hero h1 em { color: var(--gold-dark); }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.phone { width: 270px; margin: 0 auto; border-radius: 38px; padding: 12px; background: #221c18; box-shadow: 0 30px 60px rgba(40,25,10,.25); transform: rotate(2deg); }
.phone-screen { border-radius: 28px; min-height: 480px; padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.theme-preview-ivoire { background: radial-gradient(circle at 50% 0%, #fffaf0, #f3e6cc); color: #3b2c1a; }
.pv-small { font-size: .8rem; margin: 0; color: #6d5a41; }
.pv-names { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; line-height: 1; margin: 6px 0; }
.pv-names span { font-size: 1.4rem; color: var(--gold); }
.pv-rule { width: 60px; height: 1px; background: var(--gold); margin: 8px 0; }
.pv-date { font-family: var(--serif); font-size: 1.2rem; margin: 0; }
.pv-count { font-size: .85rem; color: #6d5a41; }
.pv-count b { font-size: 1.2rem; color: #3b2c1a; }
.pv-btn { margin-top: 14px; background: #3b2c1a; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .8rem; }
.section { padding: 64px 0; }
.section-alt { background: #f4ecdf; }
.section-title { text-align: center; font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 36px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--card); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: 14px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--card); padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); }
.feature h3 { font-size: 1.3rem; }
.feature p { margin: 0; color: var(--ink-soft); }
.cta { background: var(--ink); color: #fff; }
.cta-inner { text-align: center; }
.cta h2 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.4rem); max-width: 20em; margin: 0 auto 24px; }
.cta .btn { background: var(--gold); border-color: var(--gold); }

/* Cartes & formulaires */
.page { padding: 32px 16px 64px; }
.card-page { padding: 56px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-title { font-size: 1.45rem; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form .card { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: 400 1rem var(--sans); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
textarea { resize: vertical; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.check-strong { font-weight: 600 !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.or { margin: 20px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-footer { position: sticky; bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.schedule { display: flex; flex-direction: column; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: 90px 1.2fr 1fr 1fr 36px; gap: 8px; }
.theme-picker { display: flex; gap: 14px; flex-wrap: wrap; }
.form label.theme-option { flex-direction: column; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-swatch { width: 64px; height: 64px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line); }
.theme-option input:checked + .theme-swatch { border-color: var(--ink); }
.theme-option input:focus-visible + .theme-swatch { outline: 2px solid var(--gold); outline-offset: 2px; }
.media-current { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-current img { max-height: 140px; width: auto; border-radius: 10px; object-fit: cover; }
.media-current audio { width: 100%; }

/* Couleurs des thèmes (pastilles et vignettes) */
.theme-bg-ivoire { background: linear-gradient(135deg, #fbf3e2, #d9b877); }
.theme-bg-kente { background: linear-gradient(135deg, #f2a900 0%, #f2a900 33%, #0b7a3e 33%, #0b7a3e 66%, #b3261e 66%); }
.theme-bg-nuit { background: linear-gradient(135deg, #0f1733, #c9a45c); }
.theme-bg-rose { background: linear-gradient(135deg, #fbe9ea, #d88f9a); }
.theme-bg-emeraude { background: linear-gradient(135deg, #0d4d3c, #e6cf93); }

/* Tableau de bord */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.event-card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s; }
.event-card:hover { transform: translateY(-3px); }
.event-card-cover { height: 150px; background-size: cover; background-position: center; position: relative; }
.event-card-cover .badge { position: absolute; top: 12px; left: 12px; }
.event-card-body { padding: 16px 18px 20px; }
.event-card-body h3 { font-size: 1.45rem; margin-bottom: 4px; }
.event-card-body p { margin: 0 0 4px; }
.event-card-stats { font-size: .9rem; margin-top: 10px !important; }
.empty { text-align: center; padding: 48px 24px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-live { background: #d8f0e2; color: #1b5e3a; }
.badge-draft { background: #fff; color: #6e5220; border: 1px solid #ecd7ab; }
.badge-no { background: #f5e1df; color: var(--danger); }

/* Détail d'un événement */
.share { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.share-link { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-num { display: block; font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1; }
.stat-label { color: var(--ink-soft); font-size: .85rem; }
.stat-yes .stat-num { color: #1b7a48; }
.stat-no .stat-num { color: var(--danger); }
.stat-total { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat-total .stat-label { color: #d6cabb; }
.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .85rem; }
.chip-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.msg { max-width: 280px; }
.danger-zone { margin-top: 32px; text-align: right; }

.footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 860px) {
    .hero-inner, .steps, .features { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .phone { transform: none; width: 240px; }
    .phone-screen { min-height: 400px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .grid-2 { grid-template-columns: 1fr; }
    .schedule-row { grid-template-columns: 80px 1fr 36px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
    .schedule-row .sch-place, .schedule-row .sch-address { grid-column: 1 / 3; }
    .nav { gap: 12px; font-size: .9rem; }
    .form-footer { position: static; }
}

/* Diaporama (administration) */
.small { font-size: .85rem; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gallery-item { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-item:has(input:checked) img { opacity: .3; }
.gallery-tools { display: flex; align-items: center; gap: 4px; padding: 6px; }
.gallery-tools .icon-btn { width: 30px; height: 30px; }
.form label.gallery-del { font-size: .8rem; margin-left: auto; gap: 4px; }
.gallery-warn { position: absolute; top: 6px; left: 6px; background: #fbf3e2; color: #6e5220; border: 1px solid #ecd7ab; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 2px 8px; }

/* Apparence : nouveaux thèmes, police, couleur */
.theme-bg-bordeaux { background: linear-gradient(135deg, #5e0f1b, #c9a24f); }
.theme-bg-bogolan { background: repeating-linear-gradient(45deg, #3b2a1c 0 6px, #e7d7bf 6px 10px); }
.theme-bg-lavande { background: linear-gradient(135deg, #ebe4f5, #7a5ea8); }
.theme-bg-ocean { background: linear-gradient(135deg, #dfedf4, #103a54); }
.theme-bg-soleil { background: radial-gradient(circle at 30% 30%, #1d6b4a 0 8px, transparent 9px), radial-gradient(circle at 70% 70%, #d9661a 0 10px, transparent 11px), #f4b41a; }
.theme-bg-epure { background: #fff; box-shadow: inset 0 0 0 1px #d9d9d4; }
.theme-bg-noir { background: linear-gradient(135deg, #0a0a0a 40%, #d4af5f); }
.form-col { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.color-input { width: 64px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; }
.color-input:disabled { opacity: .35; }
.font-preview { font-size: 2rem; line-height: 1.2; color: var(--ink); padding: 6px 0; font-family: 'Great Vibes', cursive; }
.stat-gift { background: #fbf3e2; border-color: #ecd7ab; }
.gift-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; text-decoration: none; color: inherit; }
.gift-summary p { margin: 0; }
.gift-summary-num { font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.gift-summary-num small { font-family: var(--sans); font-size: .9rem; font-weight: 400; }
.stat-money { font-size: 1.7rem; }
.progress { height: 10px; border-radius: 999px; background: #efe6d6; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--gold); }
