/* ELOJE Photobooth en ligne : les mêmes couleurs et la même présentation que les réglages de l'iPad */
:root {
  --fond: #faf7f0; --texte: #18273c; --or: #87672f; --champagne: #d5b57a; --doux: #62656a;
  --carte: #ffffff; --vert: #2f9e6b; --rouge: #a3454f; --orange: #d98a00;
  --ombre: 0 10px 30px rgba(24, 39, 60, .08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--texte); background: var(--fond);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); min-height: 100vh; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Barre du haut */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px clamp(16px, 4vw, 40px); border-bottom: 1px solid rgba(213, 181, 122, .45); background: var(--fond);
  position: sticky; top: 0; z-index: 5; }
.marque { text-decoration: none; font-weight: 800; letter-spacing: .18em; font-size: 20px; }
.marque span { color: var(--or); font-size: 12px; letter-spacing: .3em; margin-left: 6px; }
.barre nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.barre nav a, .lien { text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--doux); font-weight: 600;
  background: none; border: 0; cursor: pointer; }
.barre nav a.actif, .barre nav a:hover, .lien:hover { color: var(--texte); background: rgba(213, 181, 122, .22); }

main { padding: clamp(16px, 4vw, 40px); max-width: 1240px; margin: 0 auto; }
h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 22px; margin: 0 0 14px; }
.sous { color: var(--doux); margin: 0 0 24px; }
.ligne-titre { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; font-weight: 700; background: var(--texte); color: #fff; box-shadow: 0 6px 18px rgba(24, 39, 60, .18); }
.bouton:hover { filter: brightness(1.12); }
.bouton.or { background: var(--or); }
.bouton.clair { background: #fff; color: var(--texte); border: 1.5px solid rgba(213, 181, 122, .7); box-shadow: none; }
.bouton.danger { background: #fff; color: var(--rouge); border: 1.5px solid rgba(163, 69, 79, .4); box-shadow: none; }
.bouton:disabled { opacity: .5; cursor: default; }

/* Connexion */
.connexion { max-width: 420px; margin: 8vh auto; background: var(--carte); border-radius: 28px; padding: 36px; box-shadow: var(--ombre); }
.connexion .marque { display: block; text-align: center; margin-bottom: 22px; font-size: 26px; }
.connexion p { color: var(--doux); text-align: center; margin: 0 0 22px; }
label.champ { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; color: var(--doux); }
label.champ input, label.champ select { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid rgba(213, 181, 122, .6); background: #fff; font-size: 16px; color: var(--texte); }
input:focus, select:focus { outline: 2px solid var(--champagne); outline-offset: 1px; }
.connexion .bouton { width: 100%; margin-top: 8px; }
.erreur { color: var(--rouge); font-weight: 600; min-height: 22px; margin: 8px 0 0; text-align: center; }

/* Pilules (En ce moment / À venir / Passés, et onglets de l'événement) */
.pilules { display: inline-flex; background: rgba(213, 181, 122, .18); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 22px; flex-wrap: wrap; }
.pilules button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--doux); }
.pilules button.actif { background: #fff; color: var(--texte); box-shadow: 0 2px 8px rgba(24, 39, 60, .1); }
.pilules .nombre { opacity: .6; font-weight: 600; margin-left: 4px; }

/* Grille des événements */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.carte-ev { position: relative; background: var(--carte); border-radius: 22px; box-shadow: var(--ombre); overflow: hidden; cursor: pointer;
  border: 1px solid rgba(213, 181, 122, .35); transition: transform .15s ease, box-shadow .15s ease; }
.carte-ev:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(24, 39, 60, .12); }
.carte-ev .apercu { height: 150px; background: linear-gradient(135deg, #f3ead7, #e9edf3); display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 800; color: rgba(135, 103, 47, .55); letter-spacing: .05em; }
.carte-ev .corps { padding: 16px 18px 18px; }
.carte-ev h3 { margin: 0 0 4px; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-ev .date { color: var(--doux); font-size: 14px; }
.carte-ev .chiffres { display: flex; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--doux); }
.carte-ev .chiffres b { color: var(--texte); font-size: 15px; }
.badge { position: absolute; top: 12px; left: 12px; background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.badge.live { background: var(--vert); color: #fff; }
.trois-points { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92);
  cursor: pointer; font-size: 18px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.menu { position: absolute; top: 50px; right: 10px; background: #fff; border-radius: 16px; box-shadow: 0 14px 36px rgba(24, 39, 60, .2); padding: 6px; z-index: 3; min-width: 170px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.menu button:hover { background: rgba(213, 181, 122, .2); }
.menu button.danger { color: var(--rouge); }
.vide { text-align: center; color: var(--doux); padding: 60px 20px; background: rgba(255,255,255,.6); border-radius: 22px; border: 1.5px dashed rgba(213, 181, 122, .6); }

/* Page de l'événement */
.retour { display: inline-block; margin-bottom: 10px; color: var(--or); font-weight: 700; text-decoration: none; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tuile { background: var(--carte); border-radius: 24px; padding: 22px; box-shadow: var(--ombre); border: 1px solid rgba(213, 181, 122, .3); }
.tuile .tete { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--or); letter-spacing: .02em; margin-bottom: 10px; }
.tuile .gros { font-size: 40px; font-weight: 800; margin: 4px 0 6px; }
.tuile p { color: var(--doux); margin: 6px 0 0; line-height: 1.45; }
.rail { height: 8px; border-radius: 4px; background: rgba(24, 39, 60, .08); overflow: hidden; margin: 6px 0 10px; }
.rail div { height: 100%; border-radius: 4px; background: var(--vert); }

.preparation { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.menu-parties { position: sticky; top: 90px; background: var(--carte); border-radius: 22px; padding: 10px; box-shadow: var(--ombre); }
.menu-parties button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 14px;
  cursor: pointer; font-weight: 700; color: var(--doux); }
.menu-parties button.actif { background: rgba(213, 181, 122, .25); color: var(--texte); }
.boite { background: var(--carte); border-radius: 24px; padding: 8px 24px; box-shadow: var(--ombre); }
.reglage { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid rgba(213, 181, 122, .3); }
.reglage:last-child { border-bottom: 0; }
.reglage b { display: block; }
.reglage small { display: block; color: var(--doux); margin-top: 3px; line-height: 1.4; }
.reglage input[type=text], .reglage input[type=date], .reglage select { padding: 10px 12px; border-radius: 12px; border: 1.5px solid rgba(213, 181, 122, .6); background: #fff; min-width: 200px; }
.compteur { display: inline-flex; align-items: center; gap: 10px; }
.compteur button { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(213, 181, 122, .7); background: #fff; cursor: pointer; font-size: 20px; font-weight: 600; }
.compteur span { min-width: 34px; text-align: center; font-weight: 800; font-size: 18px; }
.interrupteur { position: relative; width: 54px; height: 32px; flex: none; }
.interrupteur input { opacity: 0; width: 0; height: 0; }
.interrupteur span { position: absolute; inset: 0; background: rgba(24, 39, 60, .15); border-radius: 999px; transition: .2s; cursor: pointer; }
.interrupteur span::after { content: ""; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.interrupteur input:checked + span { background: var(--vert); }
.interrupteur input:checked + span::after { transform: translateX(22px); }
.enregistre { color: var(--vert); font-weight: 700; font-size: 14px; min-height: 20px; }

/* Listes (bornes, comptes) */
.liste { background: var(--carte); border-radius: 24px; box-shadow: var(--ombre); padding: 6px 22px; }
.liste .ligne { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(213, 181, 122, .3); flex-wrap: wrap; }
.liste .ligne:last-child { border-bottom: 0; }
.liste small { color: var(--doux); display: block; margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code { font-size: 44px; font-weight: 800; letter-spacing: .25em; text-align: center; padding: 18px; background: #fdf1d8; border-radius: 18px; border: 1.5px solid var(--orange); margin: 10px 0; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; background: #fdf1d8; padding: 10px 14px; border-radius: 12px; display: inline-block; letter-spacing: .05em; }

/* Fenêtre */
.voile { position: fixed; inset: 0; background: rgba(24, 39, 60, .35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.fenetre { background: var(--fond); border-radius: 26px; padding: 28px; width: min(480px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.fenetre .actions { justify-content: flex-end; margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--texte); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

@media (max-width: 760px) {
  .preparation { grid-template-columns: 1fr; }
  .menu-parties { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .menu-parties button { white-space: nowrap; width: auto; }
  .reglage { flex-direction: column; align-items: flex-start; }
  .reglage input[type=text], .reglage input[type=date], .reglage select { min-width: 0; width: 100%; }
}

/* Préparation : plusieurs cartes à droite, comme sur l'iPad */
#boites { display: grid; gap: 18px; }
.boite { padding: 18px 24px 8px; }
.boite h2 { font-size: 18px; margin: 4px 0 2px; color: var(--or); letter-spacing: .01em; }
.boite .aide { color: var(--doux); margin: 2px 0 6px; line-height: 1.45; font-size: 14px; }
.reglage.large { display: block; }
.segments { display: inline-flex; flex-wrap: wrap; background: rgba(213, 181, 122, .18); border-radius: 14px; padding: 3px; gap: 2px; }
.segments button { border: 0; background: none; padding: 9px 14px; border-radius: 11px; cursor: pointer; font-weight: 700; color: var(--doux); }
.segments button.actif { background: #fff; color: var(--texte); box-shadow: 0 2px 8px rgba(24, 39, 60, .1); }
.cartes-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cartes-choix button { text-align: left; border: 1.5px solid rgba(213, 181, 122, .6); background: #fff; border-radius: 16px; padding: 14px; cursor: pointer; }
.cartes-choix button.actif { border-color: var(--or); box-shadow: 0 0 0 2px rgba(135, 103, 47, .25); }
.cartes-choix small { display: block; color: var(--doux); margin-top: 4px; line-height: 1.35; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles button { border: 1.5px solid rgba(213, 181, 122, .7); background: #fff; border-radius: 999px; padding: 9px 15px; cursor: pointer; font-weight: 700; color: var(--doux); }
.pastilles button.actif { background: var(--vert); border-color: var(--vert); color: #fff; }
.estompe { opacity: .45; }
.accessoires details { border-bottom: 1px solid rgba(213, 181, 122, .3); padding: 10px 0; }
.accessoires details:last-child { border-bottom: 0; }
.accessoires summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.accessoires summary::-webkit-details-marker { display: none; }
.accessoires .choisir { color: var(--or); font-weight: 700; font-size: 14px; }
.case { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.case input { width: 20px; height: 20px; accent-color: var(--vert); }
.case small { color: var(--doux); }
.accessoires .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; padding: 12px 0 4px 30px; }

/* Images : modèles, décors, accueil */
.modeles { display: grid; gap: 8px; }
.modele { display: grid; grid-template-columns: 28px 84px 1fr auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(213, 181, 122, .35); }
.modele.tenue { box-shadow: 0 14px 30px rgba(24, 39, 60, .18); opacity: .95; }
.modele img { width: 84px; height: 126px; object-fit: contain; background: #ece8df; border-radius: 8px; }
.modele .nom small { display: block; color: var(--doux); margin-top: 2px; }
.poignee { cursor: grab; font-size: 22px; color: var(--doux); text-align: center; touch-action: none; user-select: none; }
.petit { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--doux); font-weight: 600; }
.interrupteur.mini { width: 40px; height: 24px; }
.interrupteur.mini span::after { width: 18px; height: 18px; }
.interrupteur.mini input:checked + span::after { transform: translateX(16px); }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.vignette { position: relative; border: 2px solid rgba(213, 181, 122, .5); background: #fff; border-radius: 16px; padding: 8px; cursor: pointer; text-align: center; }
.vignette img, .vignette .sans { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: contain; background: #ece8df; border-radius: 10px; }
.vignette .sans { display: flex; align-items: center; justify-content: center; color: var(--doux); }
.vignette b { display: block; font-size: 13px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vignette.actif { border-color: var(--vert); }
.vignette i { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--vert); color: #fff; font-style: normal; font-weight: 800; line-height: 26px; }
.vignette:not(.actif) img { opacity: .5; }
.vignette.ajouter { display: flex; flex-direction: column; align-items: center; justify-content: center; border-style: dashed; min-height: 180px; color: var(--or); }
.vignette.ajouter span { font-size: 40px; }
.images-accueil { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.image-accueil .cadre-image { aspect-ratio: 4 / 3; background: #ece8df; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--doux); font-size: 14px; }
.image-accueil img { width: 100%; height: 100%; object-fit: contain; }
.image-accueil b { display: block; margin: 8px 0 6px; }
.bouton.petit { padding: 8px 14px; font-size: 14px; }
@media (max-width: 760px) { .modele { grid-template-columns: 24px 48px 1fr auto; } .modele .petit { grid-column: 3; } }
.reglage > .segments, .reglage > .compteur, .reglage > select { flex-shrink: 0; }
.segments { flex-wrap: nowrap; }
@media (max-width: 760px) { .segments { flex-wrap: wrap; } }

/* Photos de l'événement */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo { position: relative; border: 0; padding: 0; background: #ece8df; border-radius: 14px; overflow: hidden; cursor: pointer; aspect-ratio: 2 / 3; box-shadow: var(--ombre); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo:hover img { transform: scale(1.03); }
.photo .lecture { position: absolute; bottom: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; line-height: 34px; font-size: 14px; }
.fenetre.large { width: min(760px, 100%); }
.grande img, .grande video { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 14px; background: #000; }

/* Tuile Remerciement */
.tuile.remerciement b { display: block; margin: 12px 0 4px; }
.tuile.remerciement .lien { background: #fdf1d8; border-radius: 10px; padding: 8px 10px; font-size: 13px; word-break: break-all; }
.tuile.remerciement .actions { margin-top: 8px; }
