/* HaloBox — charte : crème #F3E9DB, noyer #2E201A, terracotta #C56A3D, chêne #D8A35B.
   Polices : Zilla Slab (titres), Outfit (texte). */
:root {
  --bg: #F3E9DB;
  --surface: #FFFDF8;
  --surface-muted: #EFE3D0;
  --text: #2E201A;
  --muted: #6E5B4E;
  --border: #DCC9AE;
  --accent: #C56A3D;
  --accent-soft: #F0D9C8;
  --gold: #D8A35B;
  --ok: #4E7A3A;
  --shadow: 0 2px 10px rgba(46, 32, 26, .10);
  --bar-h: 64px;
}
html[data-theme="dark"] {
  --bg: #241A14;
  --surface: #32241B;
  --surface-muted: #3B2A1F;
  --text: #F3E9DB;
  --muted: #C9B6A2;
  --border: #574233;
  --accent: #D98A5F;
  --accent-soft: #4A3222;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #241A14; --surface: #32241B; --surface-muted: #3B2A1F;
    --text: #F3E9DB; --muted: #C9B6A2; --border: #574233;
    --accent: #D98A5F; --accent-soft: #4A3222;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; padding-top: var(--bar-h);
  background: var(--bg); color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif; font-size: 17px; line-height: 1.5;
}
h1, h2, h3 { font-family: 'Zilla Slab', Georgia, serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
a { color: var(--accent); }
img { max-width: 100%; }

/* ---- barre fixe ---- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h); z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.bar-inner {
  max-width: 1080px; margin: 0 auto; height: 100%; padding: 0 14px;
  display: flex; align-items: center; gap: 14px; flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); min-width: 0; }
.brand .logo { color: var(--text); display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand-text strong { font-family: 'Zilla Slab', serif; font-size: 1.15rem; }
.brand-text small { color: var(--muted); font-size: .68rem; }
#mainnav { display: flex; gap: 4px; margin-left: 8px; }
#mainnav a {
  color: var(--text); text-decoration: none; padding: 7px 10px; border-radius: 8px; font-weight: 500; white-space: nowrap;
}
#mainnav a:hover, #mainnav a.active { background: var(--surface-muted); }
#mainnav .count {
  background: var(--accent); color: #FFF7EC; border-radius: 999px;
  font-size: .72rem; padding: 1px 7px; margin-left: 4px; vertical-align: 2px;
}
.bar-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg button {
  border: 0; background: var(--surface); color: var(--muted); padding: 5px 10px;
  font: inherit; font-size: .82rem; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #FFF7EC; font-weight: 600; }

/* ---- boutons, cartes, formulaires ---- */
.btn {
  display: inline-block; background: var(--accent); color: #FFF7EC; border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2E201A; }
.btn.small, .btn-small { padding: 6px 12px; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: default; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow);
}
main { max-width: 1080px; margin: 0 auto; padding: 22px 14px 40px; }
section { margin: 0 0 34px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.product-card { display: flex; flex-direction: column; gap: 8px; }
.product-card .swatch {
  height: 110px; border-radius: 10px; display: flex; align-items: flex-end; padding: 10px;
  color: #FFF7EC; font-family: 'Zilla Slab', serif; font-size: 1.6rem; text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.product-card .kind { color: var(--muted); font-size: .85rem; }
.product-card p { margin: 0; }
.product-card .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; background: var(--accent-soft); color: var(--text);
}
.badge.ok { background: #DCEBD2; color: #33511F; }
html[data-theme="dark"] .badge.ok, html[data-theme="auto"] .badge.ok { color: #33511F; }
.badge.lock { background: var(--surface-muted); color: var(--muted); }
.lock-note { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
form .field { margin-bottom: 13px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 9px; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--accent); background: var(--accent-soft); }
.pw-toggle svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.pw-toggle .ic-eye-off { display: none; }
.pw-toggle.on .ic-eye { display: none; }
.pw-toggle.on .ic-eye-off { display: block; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
/* Le bloc « Ajouter un achat » est la cible du défilement après un clic
   « Je l'ai déjà acheté » : la marge évite qu'il se cache sous la barre fixe. */
#add-purchase { scroll-margin-top: calc(var(--bar-h) + 14px); }
.msg { border-radius: 10px; padding: 11px 14px; margin: 12px 0; }
.msg.ok { background: #DCEBD2; color: #33511F; }
.msg.warn { background: #F7E3C2; color: #6B4A12; }
.msg.err { background: #F6D5CB; color: #7A2715; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---- accueil ---- */
.buyer-box { border: 2px solid var(--accent); }
.hero { display: grid; gap: 20px; }
@media (min-width: 760px) { .hero { grid-template-columns: 1fr 1fr; align-items: center; } }
.hero img { border-radius: 14px; box-shadow: var(--shadow); width: 100%; height: auto; display: block; }
.overline { color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.hero .actions, .actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.review { font-style: italic; }
.review .who { font-style: normal; font-weight: 600; margin-top: 8px; }
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 9px; }
details.faq summary { font-weight: 600; cursor: pointer; font-family: 'Zilla Slab', serif; }
details.faq p { margin: 8px 0 2px; }

/* ---- histoire ---- */
.board { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.day-tile {
  border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--surface);
  text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 5px;
}
.day-tile img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; width: 100%; filter: saturate(.25) brightness(1.06); opacity: .75; }
.day-tile.placed img { filter: none; opacity: 1; }
.day-tile.closed { opacity: .55; cursor: default; }
.day-tile .dnum { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.day-tile .dtitle { font-family: 'Zilla Slab', serif; font-size: .95rem; line-height: 1.2; }
.day-view img { border-radius: 14px; box-shadow: var(--shadow); }

/* ---- générateur ---- */
.banner-preview {
  background: var(--gold); color: #2E201A; border-radius: 12px; padding: 22px 14px;
  text-align: center; font-family: 'Zilla Slab', serif; font-weight: 700; font-size: clamp(1.2rem, 4.5vw, 2rem);
  border: 3px dashed rgba(46,32,26,.35);
}
.disc-preview {
  width: 150px; height: 150px; border-radius: 50%; background: var(--accent); color: #FFF7EC;
  display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto;
  font-family: 'Zilla Slab', serif;
}
.disc-preview .n { font-size: 3rem; line-height: 1; }
.candles { font-size: 1.7rem; letter-spacing: .2em; text-align: center; }

/* ---- tableaux Atelier ---- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: 'Zilla Slab', serif; }
.stats-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { background: var(--surface-muted); border-radius: 12px; padding: 12px 16px; min-width: 130px; }
.stat .n { font-family: 'Zilla Slab', serif; font-size: 1.6rem; display: block; }

/* ---- pied de page ---- */
#site-footer {
  border-top: 1px solid var(--border); padding: 20px 14px 30px; text-align: center; color: var(--muted);
}
#site-footer a { color: var(--accent); }

.legal h2 { margin-top: 26px; }
.welcome-code {
  font-family: 'Zilla Slab', serif; font-size: 1.7rem; letter-spacing: .08em;
  background: var(--surface-muted); border: 2px dashed var(--accent); border-radius: 10px;
  padding: 10px 16px; display: inline-block; margin: 6px 0;
}
@media (max-width: 720px) {
  :root { --bar-h: 106px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1.02rem; }
  .brand .logo svg { width: 29px; height: 29px; }
  .bar-inner { flex-wrap: wrap; gap: 5px 7px; padding: 6px 8px; align-content: center; }
  .bar-controls { gap: 6px; }
  .seg button { padding: 4px 7px; font-size: .78rem; }
  #nav-contact { padding: 5px 10px; font-size: .82rem; }
  #mainnav { order: 3; width: 100%; margin-left: 0; }
  #mainnav a { padding: 6px 7px; font-size: .92rem; }
}
