:root {
  --creme: #F3F1E6;
  --foret: #286E44;
  --encre: #1F2926;
  --rouge: #C10328;
  --sable: #E6E3D7;
  --or: #F5C036;
  --foret-profond: #1F2926;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --ombre-or: 0 3px 12px rgba(245, 192, 54, 0.28);
  --bordure-or: 1px solid rgba(245, 192, 54, 0.28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--encre);
  background:
    linear-gradient(
      to bottom,
      var(--creme) 0%,
      var(--creme) 45%,
      var(--sable) 72%,
      rgba(40, 110, 68, 0.28) 100%
    );
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

/* Halos + neige (décor) */
.sls-halos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 320px at 18% 12%, rgba(245, 192, 54, 0.35), transparent 70%),
    radial-gradient(circle 380px at 85% 88%, rgba(193, 3, 40, 0.16), transparent 70%);
}
.sls-neige {
  position: fixed;
  inset: -100% 0 0 0;
  height: 200%;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat;
  animation: sls-neige-tombe linear infinite;
}
.sls-neige--loin {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1.6px, transparent 2.2px),
    radial-gradient(circle, rgba(245, 192, 54, 0.65) 1.4px, transparent 2px);
  background-size: 58px 58px, 88px 88px;
  background-position: 0 0, 28px 40px;
  opacity: 0.85;
  animation-duration: 18s;
}
.sls-neige--pres {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 1) 2.8px, transparent 3.4px),
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1.8px, transparent 2.4px);
  background-size: 110px 110px, 72px 72px;
  background-position: 20px 10px, 55px 48px;
  opacity: 0.8;
  animation-duration: 11s;
}
@keyframes sls-neige-tombe {
  from { transform: translateY(0); }
  to   { transform: translateY(50%); }
}
@media (prefers-reduced-motion: reduce) {
  .sls-neige { animation: none; inset: 0; height: 100%; }
  .sls-guirlande { animation: none; opacity: 0.75; }
}

/* ——— Cérémonie du tirage ——— */
.sls-tirage-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle 280px at 50% 38%, rgba(245,192,54,.28), transparent 70%),
    rgba(31, 41, 38, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s ease;
}
.sls-tirage-overlay.is-on { opacity: 1; }
.sls-tirage-stage {
  position: relative;
  width: min(420px, 100%);
  text-align: center;
  color: var(--creme);
  font-family: var(--font-display);
}
.sls-tirage-sapin {
  width: 88px; height: 88px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--foret);
  color: var(--creme);
  display: grid; place-items: center;
  outline: 2px solid rgba(245,192,54,.55);
  outline-offset: 8px;
  box-shadow: 0 0 0 0 rgba(245,192,54,.45);
  animation: sls-sapin-pulse 1.4s ease-in-out infinite;
}
.sls-tirage-sapin svg { width: 42px; height: 42px; }
@keyframes sls-sapin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,192,54,.35); transform: scale(1); }
  50% { box-shadow: 0 0 0 14px rgba(245,192,54,0); transform: scale(1.04); }
}
.sls-tirage-orbit {
  position: absolute;
  left: 50%; top: 44px;
  width: 0; height: 0;
  pointer-events: none;
}
.sls-tirage-pill {
  position: absolute;
  left: 0; top: 0;
  width: 42px; height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: rgba(243,241,230,.95);
  color: var(--foret);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  display: grid; place-items: center;
  border: 1.5px solid rgba(245,192,54,.55);
  animation: sls-orbit 2.2s linear infinite;
  animation-delay: calc(var(--i) * -0.28s);
}
@keyframes sls-orbit {
  from { transform: rotate(calc(var(--i) * 40deg)) translateY(-78px) rotate(calc(var(--i) * -40deg)); }
  to   { transform: rotate(calc(var(--i) * 40deg + 360deg)) translateY(-78px) rotate(calc(var(--i) * -40deg - 360deg)); }
}
.sls-tirage-title {
  margin: 28px 0 8px;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 500;
  line-height: 1.15;
}
.sls-tirage-sub {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(243,241,230,.78);
}
.sls-tirage-confetti {
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  overflow: hidden;
}
.sls-tirage-confetti i {
  position: absolute;
  top: -8%;
  width: 8px; height: 11px;
  border-radius: 2px;
  opacity: 0;
  animation: sls-confetti-fall 1.5s ease-out forwards;
  animation-delay: calc(var(--d) * 1s);
}
@keyframes sls-confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(240deg); opacity: 0; }
}
.sls-tirage-flash {
  position: absolute; inset: 0;
  background: rgba(245,192,54,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.sls-tirage-flash.is-on { opacity: 1; }
.sls-tirage-overlay.is-done .sls-tirage-pill {
  animation: none;
  transform: rotate(calc(var(--i) * 40deg)) translateY(-78px) rotate(calc(var(--i) * -40deg));
  transition: transform .6s ease;
}
.sls-tirage-overlay.is-done .sls-tirage-sapin { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .sls-tirage-sapin, .sls-tirage-pill, .sls-tirage-confetti i { animation: none !important; }
  .sls-tirage-overlay { transition: none; }
}
.sls-guirlande {
  height: 34px;
  margin: 0 0 12px;
  background-image: radial-gradient(
    circle,
    var(--or) 2.4px,
    rgba(245, 192, 54, 0.15) 4px,
    transparent 6px
  );
  background-size: 48px 30px;
  background-repeat: repeat-x;
  background-position: center top;
  animation: sls-lueur 2.6s ease-in-out infinite;
}
@keyframes sls-lueur {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sls-guirlande { animation: none; opacity: 0.75; }
}

.auth-card, .app-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(243, 241, 230, 0.78);
  border: var(--bordure-or);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--ombre-or);
}
.app-wrap { max-width: 640px; }
.eyebrow {
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(40,110,68,.7); font-weight: 600; margin: 0;
}
h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.9rem;
  margin: 8px 0 6px;
}
.sub { color: rgba(31,41,38,.6); margin: 0 0 20px; }
label {
  display: block; font-size: 13px; font-weight: 600;
  color: rgba(31,41,38,.55); margin-bottom: 12px;
}
input {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--sable); background: #fff;
  font-size: 16px; color: var(--encre);
}
button, .btn {
  display: inline-flex; width: 100%; justify-content: center;
  margin-top: 8px; padding: 13px 18px;
  background: var(--foret); color: var(--creme);
  border: none; border-radius: 12px; font-weight: 600;
  font-size: 15px; cursor: pointer; text-decoration: none;
  box-shadow: var(--ombre-or);
}
.err {
  color: var(--rouge); font-size: 14px; margin: 0 0 10px;
}
.switch { text-align: center; margin: 16px 0 0; font-size: 14px; color: rgba(31,41,38,.55); }
.switch a { color: var(--foret); font-weight: 600; text-decoration: none; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.card {
  border: 1px solid var(--sable);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 10px 0;
  background: #fff;
}
.card h3 { margin: 0 0 4px; font-family: Georgia, serif; font-weight: 500; }
.muted { color: rgba(31,41,38,.55); font-size: 14px; margin: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ghost {
  background: transparent; color: var(--foret); border: 1.5px solid rgba(40,110,68,.35);
  width: auto; padding: 8px 14px; font-size: 13px;
}
.ok {
  color: var(--foret); font-size: 14px; font-weight: 600; margin: 0 0 10px;
}
.btn-secondary {
  display: inline-flex; width: 100%; justify-content: center;
  margin-top: 8px; padding: 13px 18px;
  background: transparent; color: var(--foret);
  border: 1.5px solid rgba(40,110,68,.35); border-radius: 12px;
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
}
.invite-panel h3 { margin: 0 0 12px; font-family: Georgia, serif; font-weight: 500; }
.code-row { display: flex; gap: 8px; align-items: center; }
.invite-code {
  flex: 1; font-family: ui-monospace, Menlo, monospace;
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.18em;
  padding: 10px 12px; background: rgba(40,110,68,.08); border-radius: 12px;
  text-align: center;
}
.link-input {
  flex: 1; margin: 0; font-size: 13px !important; padding: 10px 12px !important;
}
.qr-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin: 18px 0 8px;
}
.qr-wrap canvas {
  border-radius: 12px; background: #fff;
  box-shadow: 0 4px 16px rgba(31,41,38,.08);
}
textarea {
  display: block; width: 100%; margin: 10px 0 8px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--sable); background: #fff;
  font-size: 15px; color: var(--encre); font-family: inherit;
  resize: vertical; min-height: 80px;
}
.member-list {
  list-style: none; margin: 0; padding: 0;
}
.member-list li {
  padding: 8px 0; border-bottom: 1px solid var(--sable);
  font-size: 14px; color: rgba(31,41,38,.75);
}
.member-list li:last-child { border-bottom: none; }
.card a.card-link {
  color: inherit; text-decoration: none; display: block;
}
.card a.card-link:hover h3 { color: var(--foret); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.app-wide { max-width: 720px; }
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--sable);
}
.tab {
  width: auto; margin: 0; padding: 8px 12px;
  background: transparent; color: rgba(31,41,38,.55);
  border: 1px solid transparent; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab.active {
  background: rgba(40,110,68,.12); color: var(--foret);
  border-color: rgba(40,110,68,.25);
}
.tab .badge {
  display: inline-block; min-width: 18px; padding: 1px 6px;
  margin-left: 4px; border-radius: 999px;
  background: var(--rouge); color: #fff; font-size: 11px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-title {
  font-family: Georgia, serif; font-weight: 500;
  font-size: 1.15rem; margin: 8px 0 12px;
}
.notif.unread {
  border-color: rgba(40,110,68,.45);
  background: rgba(40,110,68,.06);
  cursor: pointer;
}
.wish-form { display: grid; gap: 8px; margin-bottom: 12px; }
.wish-form button { margin-top: 0; }
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: rgba(31,41,38,.55); margin: 0;
}
.field-label input, .field-label .photo-row { margin-top: 6px; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.photo-row input[type="file"] { flex: 1; min-width: 140px; font-size: 13px; }
.photo-preview {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--sable);
}
.amazon-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 4px 0 8px;
}
.amazon-actions .btn-secondary { width: auto; margin: 0; }
.amazon-actions-hint { font-size: 12px; margin: 0; flex: 1; min-width: 160px; }
.amazon-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.amazon-chip {
  appearance: none; margin: 0; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(40,110,68,.35);
  background: #fff; color: var(--encre, #1f2926);
  font: inherit; font-size: 13px; font-weight: 600;
  text-align: left; max-width: 100%;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.amazon-chip:hover, .amazon-chip:focus-visible {
  background: rgba(40,110,68,.1);
  border-color: rgba(40,110,68,.55);
  outline: none;
}
.amazon-chip:active { transform: scale(0.98); }
.amazon-chip.is-selected {
  background: rgba(40,110,68,.16);
  border-color: var(--foret, #286e44);
}
.amazon-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.amazon-product {
  appearance: none; margin: 0; padding: 4px; cursor: pointer;
  border-radius: 12px; border: 2px solid transparent;
  background: #fff; text-align: center;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  transition: border-color .15s ease, transform .1s ease;
}
.amazon-product:hover, .amazon-product:focus-visible {
  border-color: rgba(40,110,68,.4);
  outline: none;
}
.amazon-product.is-selected {
  border-color: var(--foret, #286e44);
}
.amazon-product:active { transform: scale(0.98); }
.amazon-product img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  border-radius: 8px; background: #f7f5f1;
}
.amazon-product span {
  font-size: 10px; line-height: 1.25; color: rgba(31,41,38,.65);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; width: 100%;
}
.amazon-products-hint {
  margin: 10px 0 0; font-size: 12px; color: rgba(31,41,38,.5);
}
.wish-list {
  list-style: none; margin: 0; padding: 0;
}
.wish-list li {
  padding: 8px 0; border-bottom: 1px solid var(--sable);
  font-size: 14px;
}
.wish-item {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.wish-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 10px;
  background: var(--sable);
}
.wish-body { flex: 1; min-width: 140px; }
.wish-list li:last-child { border-bottom: none; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; max-height: 360px; overflow: auto; }
.msg {
  padding: 10px 12px; border-radius: 12px;
  background: rgba(31,41,38,.05); font-size: 14px;
}
.msg.mine { background: rgba(40,110,68,.12); align-self: flex-end; max-width: 90%; }
.msg p { margin: 4px 0 0; }
.msg-from { font-size: 11px; font-weight: 700; color: rgba(31,41,38,.45); text-transform: uppercase; letter-spacing: .06em; }
select {
  flex: 1; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--sable); background: #fff; font-size: 14px;
}
