/* Thème Noël clair : crème, rouge, vert sapin, touches dorées. Pas de mode sombre. */
:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --card: #ffffff;
  --text: #22302a;
  --muted: #6d756f;
  --border: #ece3d3;
  --red: #b8312f;
  --red-hover: #962523;
  --green: #2f6b4f;
  --green-dark: #1f4d38;
  --green-soft: #eaf4ee;
  --gold: #c9a24a;
  --gold-soft: #f6ecd2;
  --taken-bg: #faf8f4;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 6px 18px rgba(60, 45, 20, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, sans-serif;
  background-color: var(--bg);
  /* Flocons discrets */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='none' stroke='%23b9cbd6' stroke-width='1.2' stroke-linecap='round' opacity='.55'%3E%3Cg transform='translate(30 40)'%3E%3Cpath d='M0-7V7M-6-3.5L6 3.5M-6 3.5L6-3.5'/%3E%3C/g%3E%3Cg transform='translate(130 95) scale(.7)'%3E%3Cpath d='M0-7V7M-6-3.5L6 3.5M-6 3.5L6-3.5'/%3E%3C/g%3E%3Cg transform='translate(70 150) scale(.5)'%3E%3Cpath d='M0-7V7M-6-3.5L6 3.5M-6 3.5L6-3.5'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%23d8c48f' opacity='.5'%3E%3Ccircle cx='155' cy='25' r='1.4'/%3E%3Ccircle cx='15' cy='110' r='1.1'/%3E%3Ccircle cx='110' cy='165' r='1.2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at top, #fffdf8 0%, var(--bg) 60%);
  background-attachment: scroll, fixed;
}

/* Guirlande lumineuse en haut de page */
.garland {
  height: 44px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='44'%3E%3Cpath d='M0 4Q40 30 80 4Q120 30 160 4Q200 30 240 4' fill='none' stroke='%232f5d46' stroke-width='1.6'/%3E%3Cg%3E%3Crect x='37' y='15' width='6' height='5' rx='1' fill='%23a08a55'/%3E%3Cellipse cx='40' cy='27' rx='5' ry='7.5' fill='%23c0392b'/%3E%3Cellipse cx='38.3' cy='24.5' rx='1.4' ry='2.6' fill='%23fff' opacity='.55'/%3E%3C/g%3E%3Cg%3E%3Crect x='117' y='15' width='6' height='5' rx='1' fill='%23a08a55'/%3E%3Cellipse cx='120' cy='27' rx='5' ry='7.5' fill='%23d9ad3c'/%3E%3Cellipse cx='118.3' cy='24.5' rx='1.4' ry='2.6' fill='%23fff' opacity='.6'/%3E%3C/g%3E%3Cg%3E%3Crect x='197' y='15' width='6' height='5' rx='1' fill='%23a08a55'/%3E%3Cellipse cx='200' cy='27' rx='5' ry='7.5' fill='%232f7a55'/%3E%3Cellipse cx='198.3' cy='24.5' rx='1.4' ry='2.6' fill='%23fff' opacity='.5'/%3E%3C/g%3E%3C/svg%3E") repeat-x center top;
  filter: drop-shadow(0 2px 4px rgba(201, 162, 74, .25));
}

.page { max-width: 720px; margin: 0 auto; padding: 18px 16px 64px; }

/* En-tête */
.hero { text-align: center; margin-bottom: 26px; }
.eyebrow {
  margin: 0;
  color: var(--red);
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.1;
}
h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  color: var(--green-dark);
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 2px 0 0;
}
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 0;
  color: var(--gold);
  font-size: .95rem;
}
.ornament span { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { transform: scaleX(-1); }

/* Cartes */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.intro {
  position: relative;
  border-top: 3px solid var(--red);
  background: linear-gradient(180deg, #fffaf3, var(--card) 60%);
}
.intro p { margin: 0; }

.footer { text-align: center; margin: 28px 0 8px; }
.link-btn {
  background: none;
  border: 0;
  padding: 6px 8px;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--red); }

.login label { display: block; font-weight: 600; margin-bottom: 8px; }
.row { display: flex; gap: 8px; }
input[type=password], input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--text);
  font: inherit;
}
input:focus-visible, .btn:focus-visible, .link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Boutons */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { border-color: #dccfb6; }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 6px rgba(184, 49, 47, .25);
}
.btn.primary:hover { background: var(--red-hover); transform: translateY(-1px); }
.btn.small { padding: 4px 12px; font-size: .85rem; font-weight: 500; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* Liste des cadeaux */
.items { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  grid-template-areas: "thumb main action";
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px 12px 12px;
  box-shadow: var(--shadow);
}
.item.no-thumb { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main action"; padding-left: 16px; }

.thumb {
  grid-area: thumb;
  width: 96px;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; display: block; }

.item-main { grid-area: main; min-width: 0; }
.item-title {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.item-meta { margin: 3px 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.price {
  font-weight: 600;
  color: var(--green-dark);
}
.price:not(:empty) + .note:not(:empty)::before { content: " · "; }
.link {
  display: inline-block;
  margin-top: 4px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 49, 47, .3);
}
.link:hover { border-bottom-color: var(--red); }
.links { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.links .link { margin-top: 0; }
.badge.soon { color: #7a5a12; background: var(--gold-soft); font-weight: 600; }

.item-action { grid-area: action; text-align: right; }
.badge {
  display: inline-block;
  font-size: .85rem;
  color: var(--muted);
  background: #f4efe6;
  border-radius: 999px;
  padding: 4px 12px;
}
.badge.mine {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.reserve-form { display: flex; gap: 6px; }
.reserve-form input { width: 140px; flex: none; padding: 7px 10px; }

/* États */
.item.taken { background: var(--taken-bg); box-shadow: none; }
.item.taken .item-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(109, 117, 111, .5); }
.item.taken .thumb img { filter: grayscale(.85); opacity: .55; }
.item.mine { border-color: var(--green); background: var(--green-soft); box-shadow: var(--shadow); }
.item.mine .item-title { text-decoration: none; color: var(--text); }
.item.mine .thumb img { filter: none; opacity: 1; }

.error { color: var(--red); min-height: 1.2em; margin: 8px 0 0; font-size: .9rem; }

@media (max-width: 560px) {
  .page { padding-top: 12px; }
  .card { padding: 16px; }
  .item {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas: "thumb main" "thumb action";
    gap: 8px 12px;
    align-items: start;
    padding: 12px;
  }
  .item.no-thumb { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "action"; }
  .thumb { width: 76px; border-radius: 10px; }
  .thumb img { padding: 4px; }
  .item-title { font-size: 1.02rem; }
  .item-action { text-align: left; }
  .reserve-form input { flex: 1; width: auto; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
