/* 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%; }
}
