/* De ton vivant — faire-part détourné */
:root {
  --paper: #f6f1e7;
  --card: #fffdf8;
  --ink: #1d1a16;
  --muted: #6f675c;
  --line: #ddd2bf;
  --accent: #8a5a22;
  --accent-soft: #f1e3cc;
  --flame: #e8a64a;
  --danger: #a33a2a;
  --ok: #3d6b45;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }

.topbar { display: flex; justify-content: center; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.logo { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 48px; }
.narrow { max-width: 640px; margin: 0 auto 28px; }
.foot { border-top: 1px solid var(--line); text-align: center; padding: 28px 16px 40px; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.foot p { margin: 0 0 6px; }
.foot a { font-family: var(--sans); font-style: normal; font-size: .85rem; color: var(--muted); }

.kicker { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.2rem; margin-bottom: .3em; }
.lead { font-size: 1.12rem; max-width: 640px; margin: 0 auto 1.6em; }

/* Boutons & formulaires */
.btn { display: inline-block; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 999px; padding: 11px 22px; font: 500 1rem var(--sans); cursor: pointer; text-decoration: none; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); background: #000; }
.btn-big { padding: 15px 30px; font-size: 1.06rem; }
.btn-small { padding: 7px 14px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-danger { color: var(--danger); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.form label { display: block; margin-bottom: 16px; font-weight: 500; }
.form input:not([type=checkbox]):not([type=radio]), .form textarea, .form select, input, textarea, select {
  width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 1rem var(--sans); color: var(--ink);
}
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--ink); }
textarea { resize: vertical; font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 500; margin-bottom: 8px; }
.form .check, .form .radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .radio { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.form .check input, .form .radio input { margin-top: 5px; }
.hint { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 22px 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row input { width: auto; flex: 1; min-width: 120px; margin: 0; }
.contrib input { max-width: 90px; }

.flash { max-width: 640px; margin: 0 auto 20px; padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.flash-ok { background: #eef4ec; border-color: #c6dbc4; color: var(--ok); }
.flash-err { background: #f8ebe7; border-color: #e8c3b9; color: var(--danger); }

/* Accueil */
.hero { text-align: center; padding: 30px 0 50px; }
.hero h1 em { color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 40px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.num { font-family: var(--serif); font-size: 2rem; color: var(--accent); display: block; }
.rules ul, .price ul, .legal ul { padding-left: 1.2em; }
.rules li, .price li { margin-bottom: 6px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 40px 0; }
.price .amount { font-family: var(--serif); font-size: 2.2rem; margin: 0 0 .4em; }
.price-premium { border: 2px solid var(--ink); }
.faq { max-width: 700px; margin: 0 auto 40px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Bougie */
.flame, .flame-mini { display: inline-block; position: relative; background: radial-gradient(ellipse at 50% 70%, #fff6d8 0 18%, var(--flame) 45%, rgba(232,166,74,0) 72%); border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; animation: flicker 2.6s infinite ease-in-out; transform-origin: 50% 90%; }
.flame-mini { width: 12px; height: 20px; }
.flame { width: 26px; height: 44px; }
.flame-lg { width: 40px; height: 66px; margin-bottom: 14px; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); opacity: .95; }
  25% { transform: scale(1.04, .97) rotate(1.5deg); opacity: 1; }
  50% { transform: scale(.97, 1.04) rotate(-1.5deg); opacity: .88; }
  75% { transform: scale(1.02) rotate(1deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .flame, .flame-mini { animation: none; } }

/* Page d'un honoré */
.honoree { text-align: center; margin-bottom: 30px; }
.portrait { width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%; overflow: hidden; border: 4px double var(--ink); padding: 4px; background: var(--card); }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; filter: sepia(.15); }
.portrait-empty { display: flex; align-items: center; justify-content: center; }
.status { font-family: var(--serif); font-size: 1.3rem; margin-bottom: .2em; }
.countdown { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); min-height: 1.6em; }
.waiting h2 { margin-top: 4px; }

.prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font: italic 1rem var(--serif); color: var(--ink); cursor: pointer; text-align: left; }
.chip:hover { background: var(--accent-soft); }

.messages { max-width: 720px; margin: 0 auto 30px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 18px; position: relative; }
.msg::before { content: "“"; position: absolute; top: -6px; left: 14px; font: 600 3.4rem/1 var(--serif); color: var(--accent-soft); }
.msg-body { font-family: var(--serif); font-size: 1.28rem; line-height: 1.5; white-space: normal; position: relative; }
.msg-sign { margin: 12px 0 0; color: var(--muted); font-family: var(--serif); font-size: 1.1rem; }
.msg-hidden { opacity: .55; border-style: dashed; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 12px; }
.msg-actions form { margin: 0; }
.inline-edit summary { color: var(--accent); cursor: pointer; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
.inline-edit[open] { flex-basis: 100%; }
.inline-edit form { margin-top: 10px; display: grid; gap: 8px; }
.tag { display: inline-block; font-family: var(--sans); font-size: .76rem; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 9px; margin: 0 0 0 4px; }
p.tag { margin: 0 0 10px; }
.tag-warn { background: #f8e3dc; color: var(--danger); }
.tag-me { background: #e6ede4; color: var(--ok); }

.reveal-actions { text-align: center; margin-bottom: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.vote blockquote { margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--paper); font-family: var(--serif); font-size: 1.15rem; }

.premium-card { border: 2px solid var(--ink); }
.progress { height: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--flame)); }

.admin { max-width: 720px; margin: 40px auto 0; padding-top: 30px; border-top: 2px solid var(--ink); }
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row input { margin: 0; font-size: .9rem; }
.members { list-style: none; padding: 0; margin: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.members form { margin: 0; }
.danger summary { cursor: pointer; color: var(--danger); font-weight: 500; }
.danger form { margin-top: 10px; }
.code-input { text-align: center; font-size: 1.8rem !important; letter-spacing: .3em; margin-bottom: 16px !important; }
.whoami { margin-top: 30px; }
.legal h2 { margin-top: 1.6em; }

.devmails { position: fixed; bottom: 10px; right: 10px; max-width: 420px; max-height: 50vh; overflow: auto; background: #222; color: #eee; padding: 12px; border-radius: 10px; font-size: .8rem; z-index: 50; }
.devmails pre { white-space: pre-wrap; background: #333; padding: 8px; border-radius: 6px; }

/* ===== Cérémonie ===== */
.cer { position: fixed; inset: 0; z-index: 100; background: radial-gradient(ellipse at 50% 85%, #2a1f12 0%, #0f0c09 60%); color: #f3e9d6; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px 90px; overflow: hidden; cursor: pointer; }
.cer-stage { max-width: 900px; width: 100%; text-align: center; transition: opacity .9s ease, transform .9s ease; }
.cer-stage.out { opacity: 0; transform: translateY(14px); }
.cer-kicker { font-family: var(--serif); font-style: italic; color: var(--flame); font-size: clamp(1.1rem, 2.5vw, 1.6rem); margin-bottom: 10px; }
.cer-title { font-family: var(--serif); font-size: clamp(2.6rem, 9vw, 6rem); font-weight: 600; margin: 0 0 14px; }
.cer-msg { font-family: var(--serif); font-size: clamp(1.4rem, 3.6vw, 2.6rem); line-height: 1.4; margin: 0 0 24px; }
.cer-msg.long { font-size: clamp(1.15rem, 2.6vw, 1.8rem); }
.cer-sign { font-family: var(--serif); font-style: italic; color: #c9b896; font-size: clamp(1.1rem, 2.4vw, 1.6rem); }
.cer-photo { width: clamp(120px, 22vw, 200px); height: clamp(120px, 22vw, 200px); border-radius: 50%; object-fit: cover; margin: 0 auto 22px; border: 3px double #c9b896; filter: sepia(.2); }
.cer-candle { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.cer-candle .flame { width: 22px; height: 38px; filter: drop-shadow(0 0 18px rgba(232,166,74,.8)); }
.cer-candle i { display: block; width: 14px; height: 26px; background: linear-gradient(#f3e9d6, #c9b896); border-radius: 3px 3px 0 0; }
.cer-glow { position: absolute; bottom: 30px; left: 50%; width: 600px; height: 400px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 80%, rgba(232,166,74,.18), transparent 65%); pointer-events: none; animation: glow 3s infinite ease-in-out; }
@keyframes glow { 50% { opacity: .7; } }
.cer-bar { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 10px; }
.cer-bar button { background: rgba(255,255,255,.08); color: #f3e9d6; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 7px 14px; font: .85rem var(--sans); cursor: pointer; }
.cer-bar button:hover { background: rgba(255,255,255,.16); }
.cer-count { position: absolute; top: 16px; right: 20px; font-size: .85rem; color: #8f826b; }

/* ===== Impression / PDF ===== */
@media print {
  .topbar, .foot, .reveal-actions, .write, .admin, .premium-card, .msg-actions, .whoami, .vote, .tag, .devmails, .flash, .countdown { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; }
  .msg { break-inside: avoid; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; box-shadow: none; }
  .msg-hidden { display: none; }
  .narrow:has(.write) { display: none; }
}

@media (max-width: 560px) {
  .card { padding: 18px; }
  .msg { padding: 20px 18px; }
  .copy-row { flex-direction: column; }
}
