/* Listes de cadeaux — style aquarelle de la liste de naissance, décliné en thèmes Noël et Anniversaire. */
@font-face { font-family: "Quicksand"; src: url("/fonts/quicksand-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italique-latin.woff2") format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }

:root {
  --cream: #FFF9F2; --cream-2: #FCF2E7; --carte: #FFFDFA;
  --blush: #F3D3CB; --blush-deep: #E3AC9E;
  --sky: #CFE3EC; --butter: #F2E2A6; --sage: #D2E0C6; --lilac: #E1D6EA;
  --text: #5B4A3F; --text-soft: #8F7E70;
  --accent: #D07C6E; --accent-deep: #B95F52; --accent-pale: #FBF1EC;
  --sage-deep: #7E9068; --sage-pale: #EEF3E9; --line: #EAD9CE;
  --b1: var(--sky); --b2: var(--sage); --b3: var(--butter); --b4: var(--lilac);
  color-scheme: light;
}
body[data-theme="noel"] {
  --accent: #B8483E; --accent-deep: #933A31; --accent-pale: #FBEDEA;
  --sage-deep: #3F6B4F; --sage-pale: #E8F0EA; --gold: #C9973A;
  --b1: #F2CFC8; --b2: #CFE0D2; --b3: #F3E2B3; --b4: #D6DEEA;
}
body[data-theme="anniversaire"] {
  --accent: #D46A8C; --accent-deep: #B24E71; --accent-pale: #FCEEF3;
  --sage-deep: #4F8F86; --sage-pale: #E6F2F0;
  --b1: #F9E3A3; --b2: #CFE7F2; --b3: #F6CFDD; --b4: #DCD3F0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Quicksand", system-ui, sans-serif; background: var(--cream); color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }
.hors-ecran { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- décor ---------- */
.grain { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; filter: blur(42px); mix-blend-mode: multiply; opacity: 0.45; animation: drift 18s ease-in-out infinite; transition: background 0.6s; }
.blob.b1 { top: -10%; left: -12%; width: 360px; height: 320px; background: radial-gradient(circle at 35% 35%, var(--b1), transparent 70%); border-radius: 42% 58% 65% 35%/45% 40% 60% 55%; }
.blob.b2 { bottom: -14%; left: -10%; width: 320px; height: 300px; background: radial-gradient(circle at 40% 40%, var(--b2), transparent 70%); border-radius: 55% 45% 40% 60%/50% 55% 45% 50%; animation-delay: -6s; }
.blob.b3 { top: -8%; right: -12%; width: 340px; height: 320px; background: radial-gradient(circle at 60% 30%, var(--b3), transparent 70%); border-radius: 60% 40% 45% 55%/40% 50% 50% 60%; animation-delay: -3s; }
.blob.b4 { bottom: -16%; right: -8%; width: 320px; height: 300px; background: radial-gradient(circle at 50% 50%, var(--b4), transparent 70%); border-radius: 50% 50% 40% 60%/55% 45% 55% 45%; animation-delay: -9s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(14px, -16px) scale(1.05); } }
.deco { position: absolute; z-index: 0; pointer-events: none; animation: flotte 10s ease-in-out infinite; }
.deco svg { width: 100%; height: 100%; display: block; }
.deco.tombe { animation: tombe linear infinite; top: -40px; }
@keyframes flotte { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(var(--r, 0deg)); } }
@keyframes tombe { from { transform: translate(0, -40px) rotate(0deg); } to { transform: translate(var(--dx, 30px), 110vh) rotate(var(--rot, 180deg)); } }

/* ---------- mise en page ---------- */
.wrap { position: relative; z-index: 2; max-width: 920px; margin: 0 auto; padding: 40px 16px 120px; padding-top: max(40px, env(safe-area-inset-top)); }
.backlink { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--accent-deep); text-decoration: none; font-weight: 600; margin-bottom: 14px; }
header.entete { text-align: center; margin-bottom: 26px; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-deep); font-weight: 700; margin: 0 0 10px; }
h1 { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.15; margin: 0 0 10px; }
h1 em { font-style: italic; color: var(--accent-deep); }
.subtitle { max-width: 520px; margin: 0 auto; font-size: 0.98rem; line-height: 1.7; white-space: pre-line; }
.compte-rebours { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 14px; border-radius: 999px;
  background: var(--carte); border: 1px solid var(--line); font-weight: 700; font-size: 0.86rem; color: var(--accent-deep); box-shadow: 0 6px 16px rgba(180, 150, 130, 0.12); }
.progress { max-width: 420px; margin: 20px auto 0; }
.progress-bar, .pot-bar { height: 10px; background: var(--cream-2); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(180, 150, 130, 0.2); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--blush-deep)); border-radius: 999px; transition: width 0.6s ease; }
.progress-label { font-size: 0.82rem; color: var(--text-soft); margin-top: 8px; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 0.88rem; border: none; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; text-decoration: none; transition: transform 0.15s ease, background 0.2s; min-height: 42px; }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-sage { background: var(--sage-deep); color: #fff; }
.btn-outline { background: #fff; color: var(--accent-deep); border: 1.5px solid var(--accent-deep); }
.btn-outline:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-soft); text-decoration: underline; }
.btn-danger { background: #fff; color: #A43C32; border: 1.5px solid #E2B2AB; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.lien-discret { background: none; border: none; color: var(--text-soft); font-size: 0.8rem; text-decoration: underline; cursor: pointer; padding: 6px; }

/* ---------- accueil ---------- */
.listes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.carte-liste { position: relative; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text);
  background: var(--carte); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px 20px; overflow: hidden;
  box-shadow: 0 12px 26px rgba(180, 150, 130, 0.13); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.carte-liste:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(180, 150, 130, 0.2); }
.carte-liste::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--bande, var(--accent)); }
.carte-liste.t-noel { --bande: linear-gradient(90deg, #B8483E, #3F6B4F, #C9973A); background: radial-gradient(circle at 90% 0%, rgba(201, 151, 58, 0.14), transparent 50%), var(--carte); }
.carte-liste.t-anniversaire { --bande: linear-gradient(90deg, #D46A8C, #F2C14E, #4F8F86, #8C7BD1); background: radial-gradient(circle at 90% 0%, rgba(246, 207, 221, 0.4), transparent 50%), var(--carte); }
.carte-liste .gros-emoji { font-size: 2.3rem; line-height: 1; }
.carte-liste h2 { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 1.35rem; margin: 2px 0 0; }
.carte-liste .meta { font-size: 0.86rem; color: var(--text-soft); }
.carte-liste .pied { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; font-weight: 700; color: var(--accent-deep); }
.etiquette { align-self: flex-start; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #F1E7DF; color: var(--text-soft); }
.etiquette.on { background: var(--sage-pale); color: var(--sage-deep); }
.nouvelle-liste { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; border: 2px dashed var(--blush-deep);
  border-radius: 22px; background: rgba(255, 253, 250, 0.6); color: var(--accent-deep); font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.nouvelle-liste span { font-size: 2rem; }

/* ---------- barre organisateur ---------- */
.publish-banner { max-width: 680px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 16px; font-size: 0.9rem; font-weight: 600; }
.publish-banner.on { background: var(--sage-pale); color: #44543F; border: 1px solid #CBDBBD; }
.publish-banner.off { background: var(--accent-pale); color: var(--accent-deep); border: 1px dashed var(--blush-deep); }
.outils-orga { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 8px; }
.outils-orga .btn { font-size: 0.82rem; padding: 8px 14px; min-height: 38px; }
.info-surprise { max-width: 680px; margin: 0 auto 10px; text-align: center; font-size: 0.84rem; color: var(--text-soft); }

/* ---------- filtres et cartes cadeaux ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0 24px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 8px 15px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.choix-reserves { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: -10px 0 20px; font-size: 0.82rem; color: var(--text-soft); font-weight: 600; }
.chip.petit { padding: 5px 12px; font-size: 0.78rem; }
.info-caches { text-align: center; font-size: 0.84rem; color: var(--text-soft); margin: 22px 0 0; }
.info-caches .cancel-link { font-size: 0.84rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.item-card { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 18px; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--b2) 30%, transparent), transparent 45%),
              radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--b3) 25%, transparent), transparent 45%), var(--carte);
  box-shadow: 0 10px 24px rgba(180, 150, 130, 0.11); }
.item-card.reserved { opacity: 0.72; }
.item-card.a-moi { opacity: 1; border-color: var(--sage-deep); box-shadow: 0 0 0 2px var(--sage-pale), 0 10px 24px rgba(180, 150, 130, 0.11); }
.item-card.coeur { border-color: var(--gold, #E0B65A); }
.item-img { width: 100%; height: 160px; object-fit: contain; border-radius: 14px; background: #fff; }
.item-emoji { font-size: 2rem; line-height: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.item-cat, .pot-badge, .coeur-badge { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.item-cat { background: color-mix(in srgb, var(--b1) 70%, #fff); }
.pot-badge { background: #EDE4F1; color: #6A5482; }
.coeur-badge { background: #FBEFD2; color: #8A6417; }
.item-name { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.item-note { font-size: 0.88rem; color: var(--text-soft); line-height: 1.5; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.item-price { font-size: 0.88rem; font-weight: 700; color: var(--accent-deep); }
.item-link { font-size: 0.84rem; color: var(--accent-deep); font-weight: 600; text-decoration: none; }
.item-footer { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.reserve-btn { border: none; border-radius: 14px; padding: 12px; font-weight: 700; font-size: 0.9rem; cursor: pointer; background: var(--accent); color: #fff; min-height: 44px; }
.reserve-btn.sage { background: var(--sage-deep); }
.reserved-tag { text-align: center; font-size: 0.86rem; color: var(--sage-deep); font-weight: 700; background: var(--sage-pale); border-radius: 14px; padding: 11px; }
.cancel-link { font-size: 0.78rem; color: var(--text-soft); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 4px; align-self: center; }
.admin-reservation { font-size: 0.82rem; background: var(--accent-pale); border-radius: 12px; padding: 9px 11px; line-height: 1.5; overflow-wrap: anywhere; }
.admin-reservation b { color: var(--accent-deep); }
.admin-controls { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 1; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; }
.pot-info { font-size: 0.86rem; color: var(--text-soft); }
.pot-info b { color: var(--accent-deep); font-size: 0.96rem; }
.pot-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage-deep), #A9C193); border-radius: 999px; transition: width 0.5s ease; }
.empty-state, .coming-soon { text-align: center; padding: 60px 20px; color: var(--text-soft); max-width: 520px; margin: 0 auto; line-height: 1.7; }
.empty-state .big, .coming-soon .big { font-size: 3rem; margin-bottom: 12px; }
.coming-soon h2 { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 1.6rem; color: var(--text); margin: 0 0 10px; }

/* ---------- bouton +, fenêtres, toast ---------- */
.fab { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); right: 22px; z-index: 40; width: 62px; height: 62px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 1.8rem; box-shadow: 0 10px 24px rgba(150, 70, 60, 0.4); cursor: pointer; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(91, 74, 63, 0.38); z-index: 60; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--carte); border-radius: 22px; padding: 26px 22px; max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22); -webkit-overflow-scrolling: touch; }
.modal h3 { font-family: "Fraunces", Georgia, serif; font-weight: 500; margin: 0 0 14px; font-size: 1.45rem; }
.modal h3 + .modal-sub { margin-top: -8px; }
.modal .modal-sub { font-size: 0.92rem; color: var(--text-soft); margin: 0 0 18px; line-height: 1.55; }
.modal.centre { text-align: center; }
.confirm-emoji { font-size: 2.8rem; text-align: center; margin-bottom: 6px; }
.field { margin-bottom: 14px; text-align: left; }
.field > label, .field > .label { display: block; font-size: 0.76rem; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 16px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 64px; }
.aide { font-size: 0.78rem; color: var(--text-soft); margin-top: 6px; line-height: 1.45; }
.ligne { display: flex; gap: 10px; }
.ligne > * { flex: 1; min-width: 0; }
.ligne > .btn, .ligne > .etroit { flex: 0 0 auto; }
.ligne > .etroit { width: 92px; }
.ligne + .ligne { margin-top: 8px; }
.case { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin: 4px 0 12px; line-height: 1.4; }
.case input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }
.case small { display: block; font-weight: 500; color: var(--text-soft); }
.bloc-import { background: var(--accent-pale); border: 1px dashed var(--blush-deep); border-radius: 14px; padding: 12px; }
.bloc-import .ligne .btn { flex: 0 0 auto; }
.bloc-pot { background: #F5F0F7; border: 1px dashed #C3AED6; border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.apercu-photo { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.apercu-photo img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.choix-type { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choix-type label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  font-size: 0.82rem; font-weight: 700; background: #fff; text-align: center; }
.choix-type label span { font-size: 1.6rem; }
.choix-type input { position: absolute; opacity: 0; pointer-events: none; }
.choix-type input:checked + label { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-deep); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.modal-actions.colonne { flex-direction: column; }
.zone-danger { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 0.88rem; opacity: 0; transition: all 0.3s ease; z-index: 90; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.site-footer { position: relative; z-index: 2; text-align: center; margin: -80px 0 0; padding-bottom: 40px; font-size: 0.82rem; color: var(--text-soft);
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.heart-red { color: #E0474C; }
.chargement { text-align: center; padding: 80px 0; color: var(--text-soft); }

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .item-card { padding: 14px 12px; border-radius: 18px; }
  .item-img { height: 120px; }
  .item-name { font-size: 1rem; }
  .admin-controls { position: static; justify-content: flex-end; }
  .choix-type label { font-size: 0.76rem; }
}
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, .deco { animation: none !important; transition: none !important; } .deco.tombe { display: none; } }
