:root {
  --fond: #fdf8f3;
  --carte: #ffffff;
  --texte: #2b2320;
  --doux: #75685f;
  --accent: #0b5563;       /* bleu canard foncé : titres et boutons */
  --accent-texte: #ffffff;
  --ruban: #e0a92e;        /* doré des rubans */
  --bord: #e8ddd3;
  --erreur: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--texte);
  /* Petits paquets cadeaux discrets en fond */
  background: var(--fond) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%230b5563' stroke-opacity='.10' stroke-width='2'%3E%3Crect x='14' y='24' width='26' height='22' rx='2'/%3E%3Cpath d='M27 24v22M14 32h26M27 24c-4-7-12-7-10-1M27 24c4-7 12-7 10-1'/%3E%3Crect x='76' y='76' width='26' height='22' rx='2'/%3E%3Cpath d='M89 76v22M76 84h26M89 76c-4-7-12-7-10-1M89 76c4-7 12-7 10-1'/%3E%3C/g%3E%3C/svg%3E");
}

/* Ruban doré en haut de chaque page */
body::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--ruban);
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 1.6rem; margin: 8px 0 4px; color: var(--accent); }
h2 { font-size: 1.2rem; margin: 16px 0 4px; }
.sous-titre { color: var(--doux); margin: 0 0 24px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  padding: 20px;
}

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--bord);
  border-radius: 10px;
  background: #fff;
}

.code { letter-spacing: 0.5em; font-size: 1.3rem; }

[hidden] { display: none !important; }

button, .bouton {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-texte);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: 0.6; }
.bouton-discret { background: none; color: var(--doux); text-decoration: underline; font-weight: normal; }

.message { color: var(--erreur); min-height: 1.5em; margin: 12px 0 0; }
.aide { color: var(--doux); font-size: 0.95rem; text-align: center; margin-top: 20px; }
.aide a { color: var(--accent); }

.entete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.onglets { display: flex; gap: 6px; margin: 20px 0 16px; overflow-x: auto; }
.onglets button {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  background: var(--carte);
  color: var(--texte);
  border: 1px solid var(--bord);
  white-space: nowrap;
}
.onglets button[aria-selected="true"] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }

.ligne {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bord);
}
.ligne:last-child { border-bottom: none; }
.ligne button { width: auto; margin: 0; padding: 8px 12px; font-size: 0.9rem; }

textarea { resize: vertical; }
label.choix { display: flex; gap: 10px; align-items: center; font-weight: normal; margin: 8px 0; }
label.choix input { width: auto; }

/* Listes sur l'accueil */
.carte-liste { display: block; margin-bottom: 12px; color: var(--texte); text-decoration: none; }
.carte-liste strong { display: block; color: var(--accent); font-size: 1.1rem; }
.carte-liste span { color: var(--doux); }
.carte-liste.archivee { border-top-color: var(--bord); opacity: 0.75; }

.bandeau { background: #fff4d6; border-left: 4px solid var(--ruban); border-radius: 8px; padding: 10px 14px; }
.aide-ordre { color: var(--doux); font-size: 0.95rem; }

/* Cadeaux d'une liste */
.cadeau { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding: 14px; }
.cadeau img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cadeau .contenu { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cadeau .contenu strong { display: block; }
.cadeau .contenu p { margin: 4px 0 0; color: var(--doux); font-size: 0.95rem; white-space: pre-line; }
.cadeau .prix { color: var(--accent); font-weight: 600; }
.cadeau .actions { display: flex; gap: 16px; }
.cadeau .actions button { width: auto; margin: 6px 0 0; padding: 4px 0; font-size: 0.9rem; }
.rang {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ruban); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.poignee { flex-shrink: 0; font-size: 1.4rem; color: var(--doux); padding: 0 4px; cursor: grab; touch-action: none; user-select: none; }
.en-deplacement { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); border-color: var(--accent); }
/* Page des invités */
.bandeau + .bandeau { margin-top: -4px; }
.cadeau.pris { opacity: 0.6; }
.cadeau .etat { margin: 6px 0 0; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.boutons-invite button { margin-top: 10px; padding: 10px; }
.boutons-invite .bouton-discret { width: auto; padding: 4px 0; }
.choix-invite label { font-size: 0.95rem; }
.choix-invite label input, .choix-invite label textarea { margin-top: 6px; font-weight: normal; }
.mot { margin-bottom: 12px; }
.mot p { margin: 4px 0 0; white-space: pre-line; }
.apercu { display: block; max-width: 160px; border-radius: 8px; margin-bottom: 8px; }

/* Photo d'un cadeau ouverte en grand */
img.agrandissable { cursor: zoom-in; }
.photo-grande { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.85); overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 12px; }
.photo-grande img { max-width: 100%; height: auto; border-radius: 8px; }

/* Choix du référent à la création d'une liste : deux grandes cartes */
.question-suivi { font-weight: bold; margin: 16px 0 8px; }
.question-suivi span { font-weight: normal; color: #6b5e57; }
.option-suivi { display: flex; gap: 12px; align-items: flex-start; border: 2px solid #e5dcd3; border-radius: 12px; padding: 12px; margin: 8px 0; font-weight: normal; cursor: pointer; }
.option-suivi input { width: auto; margin-top: 4px; }
.option-suivi strong { display: block; }
.option-suivi:has(input:checked) { border-color: #0b5563; background: #eaf3f4; }
