/* Site vitrine, éditeur, pages légales */
:root {
  --bg: #fffaf8; --surface: #ffffff; --ink: #2a1f24; --muted: #6d5f65; --line: #eadfe2;
  --accent: #d63c72; --accent-ink: #ffffff; --soft: #ffe8ef; --ok: #23845a; --warn: #b4501f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17131a; --surface: #211b25; --ink: #f3eaf0; --muted: #b6a6b0; --line: #3a3040; --soft: #3a2232;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo img { width: 28px; height: 28px; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: 15px; }
@media (max-width: 640px) { .nav a:not(.btn) { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 24px; background: var(--accent); color: var(--accent-ink); font: 600 16px/1.2 var(--sans); cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--accent); }
.btn:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Accueil */
.hero { padding-block: 56px 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 58px); margin: 0 0 16px; }
.hero .lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.price-note { font-size: 14px; color: var(--muted); margin-top: 12px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 32px; } }

.phone { width: min(300px, 80vw); aspect-ratio: 9 / 18.5; margin: 0 auto; border-radius: 38px; border: 10px solid #1d1a1f; background: #1d1a1f; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); overflow: hidden; position: relative; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 28px; background: #fff; }

.section { padding: 56px 0; }
.section h2 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 12px; text-align: center; }
.section .sub { text-align: center; color: var(--muted); margin: 0 auto 32px; max-width: 40em; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 6px 0 6px; font-size: 21px; }
.card p { margin: 0; color: var(--muted); }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 700; }
.occasions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.occasion-link { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.occasion-link:hover { border-color: var(--accent); }
.occasion-link span { font-size: 24px; }
.features { columns: 2; column-gap: 32px; padding-left: 20px; }
@media (max-width: 640px) { .features { columns: 1; } }
.features li { margin-bottom: 8px; break-inside: avoid; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.price-box { text-align: center; background: var(--surface); border: 2px solid var(--accent); border-radius: 24px; padding: 30px 20px; max-width: 460px; margin: 0 auto; }
.price-box .amount { font-family: var(--serif); font-size: 54px; font-weight: 700; color: var(--accent); line-height: 1; }
.price-box ul { text-align: left; display: inline-block; margin: 18px 0; padding-left: 20px; }

.site-footer { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--muted); }

/* Pages de contenu / légales */
.prose { padding-block: 40px 60px; }
.prose h1 { font-size: clamp(30px, 5vw, 44px); }
.prose h2 { margin-top: 2em; font-size: 26px; }
.prose li { margin-bottom: 6px; }
.todo { background: #fff3cd; color: #5c4400; padding: 0 4px; border-radius: 4px; }
.callout { background: var(--soft); border-radius: 12px; padding: 14px 18px; }

/* Éditeur */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 24px 16px 120px; max-width: 1180px; margin: 0 auto; }
.editor-preview { position: sticky; top: 76px; align-self: start; }
.editor-preview .phone { width: 100%; max-width: 340px; }
.editor-preview p { text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; }
  .editor-preview { display: none; }
  .editor-preview.open { display: flex; position: fixed; inset: 0; z-index: 50; background: rgba(20,15,20,.85); align-items: center; justify-content: center; flex-direction: column; padding: 16px; }
  .editor-preview.open .phone { height: min(82vh, 720px); width: auto; aspect-ratio: 9 / 18.5; }
  .editor-preview.open p { color: #fff; }
}
.close-preview { display: none; }
.editor-preview.open .close-preview { display: inline-flex; margin-top: 12px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 18px 20px; margin: 0 0 16px; min-width: 0; }
legend { font-family: var(--serif); font-weight: 600; font-size: 21px; padding: 0 6px; }
.field { margin-top: 12px; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="date"], input[type="url"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans);
}
textarea { resize: vertical; min-height: 90px; }
textarea.letter-input { min-height: 220px; font-family: var(--serif); font-size: 17px; }
.counter-hint { text-align: right; font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 500 14px var(--sans); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); color: var(--ink); font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }

.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.idea { border: 1px dashed var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }

.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; color: var(--muted); }
.dropzone.drag { border-color: var(--accent); background: var(--soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-list { display: grid; gap: 10px; margin-top: 12px; }
.photo-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.photo-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.icon-btns { display: flex; gap: 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font-size: 15px; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }
.tl-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }
@media (max-width: 520px) { .tl-item { grid-template-columns: 1fr auto; } .tl-item textarea { grid-column: 1 / 2; } }
.add-btn { margin-top: 10px; }

.publish-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.publish-bar .inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.publish-bar .status { font-size: 13px; color: var(--muted); }
.publish-bar .actions { display: flex; gap: 8px; }
.preview-toggle { display: none; }
@media (max-width: 960px) { .preview-toggle { display: inline-flex; } .publish-bar .status { display: none; } }

.notice { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; background: var(--soft); }
.notice.error { background: #fde2e1; color: #7a1d17; }
.notice.ok { background: #dff3e8; color: #14583a; }

dialog { border: 0; border-radius: 20px; padding: 24px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(20,10,15,.55); }
dialog h2 { margin-top: 0; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 12px 0; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.progress { font-size: 14px; color: var(--muted); min-height: 1.4em; }

/* Merci */
.thanks { text-align: center; padding-block: 40px 80px; }
.share-box { display: flex; gap: 8px; max-width: 560px; margin: 16px auto; }
.share-box input { flex: 1; }
.qr { display: inline-block; background: #fff; padding: 14px; border-radius: 16px; margin: 10px auto; }
.qr svg { display: block; width: 200px; height: 200px; }
.print-card { display: none; }
.edit-link { word-break: break-all; font-size: 14px; }

@media print {
  body * { visibility: hidden; }
  .print-card, .print-card * { visibility: visible; }
  .print-card { display: block !important; position: absolute; left: 0; top: 0; width: 105mm; height: 148mm; border: 1px dashed #bbb; padding: 10mm; text-align: center; font-family: var(--serif); color: #222; }
  .print-card .qr svg { width: 55mm; height: 55mm; }
  .print-card h2 { font-size: 20pt; margin: 4mm 0; }
  .print-card p { font-size: 11pt; margin: 2mm 0; }
}

/* Admin */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table td, .admin-table th { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }

.season { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--soft); text-align: center; font-weight: 600; }
.season a { color: inherit; }

/* Section « Comment ça marche » avec vidéo */
.how { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: center; max-width: 900px; margin: 0 auto; }
.how .grid3 { grid-template-columns: 1fr; }
.how-video { margin: 0; text-align: center; }
.how-video figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.video-phone { aspect-ratio: 540 / 1168; width: min(280px, 72vw); }
.video-phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; display: block; background: #fff; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; gap: 28px; } }
.error-text { color: #b3261e; }
