/* Egatag app : accueil, editeur, ecran DJ, galerie, administration. */

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --line: #dfe3ea;
  --text: #141821;
  --muted: #5b6477;
  --accent: #5a6cf0;
  --accent-fonce: #4352d6;
  --danger: #c62f3c;
  --ok: #157a4a;
  --rayon: 14px;
  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12; --surface: #141821; --surface-2: #1b2130; --line: #2a3242;
    --text: #eef1f6; --muted: #98a2b6; --accent: #7c8bff; --accent-fonce: #6372f0; --danger: #ff6b76; --ok: #4ad295;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--police); line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--accent); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 16px; }
.intro { color: var(--muted); font-size: 17px; max-width: 640px; }
.note, small { color: var(--muted); font-size: 13px; }

/* ---------- Barre ---------- */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.logo-app { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.logo-app svg { width: 22px; height: 22px; color: var(--accent); }
.compte { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
.compte a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.compte form { margin: 0; }
.lien-bouton { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }

.contenu { width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
body.large .contenu { max-width: 1180px; }
.pied-app { padding: 20px 16px 32px; text-align: center; font-size: 13px; color: var(--muted); }
.pied-app a { color: var(--muted); }

/* ---------- Boutons, champs ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.bouton.primaire { border-color: transparent; background: linear-gradient(180deg, var(--accent), var(--accent-fonce)); color: #fff; }
.bouton.danger { border-color: transparent; background: var(--danger); color: #fff; }
.bouton.petit { min-height: 36px; padding: 0 12px; font-size: 14px; }
.bouton:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.champ { display: grid; gap: 5px; margin-bottom: 14px; }
label { font-size: 14px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px;
}
textarea { resize: vertical; min-height: 84px; }
.case { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0; }
.deux { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.trois { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .deux, .trois { grid-template-columns: 1fr; } }
.fichier { position: absolute; width: 1px; height: 1px; opacity: 0; }

.alerte, .erreurs { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.erreurs { margin: 12px 0 0; padding-left: 32px; }
.succes { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); font-weight: 600; }
.etiquette { display: inline-block; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- Accueil ---------- */
.accueil { padding-top: 24px; }
.accueil h1 { font-size: clamp(30px, 6vw, 46px); max-width: 640px; }
.google { margin: 18px 0 8px; min-height: 52px; font-size: 16px; }
.google svg { width: 20px; height: 20px; stroke: none; }
.google .g1, .google .g2, .google .g3, .google .g4 { fill: #fff; }
.dev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.dev input { flex: 1; min-width: 200px; }
.dev label { width: 100%; color: var(--muted); }
.atouts { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.atouts li { padding: 16px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--line); }
.atouts strong { display: block; margin-bottom: 4px; }
.atouts span { color: var(--muted); font-size: 14px; }

/* ---------- Choix du tag ---------- */
.grille-choix { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 18px; }
.choix-famille {
  display: grid; gap: 6px; padding: 18px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-left: 4px solid var(--teinte, var(--accent)); border-radius: var(--rayon);
  background: var(--surface); color: var(--text); font: inherit;
}
.choix-famille strong { font-size: 17px; }
.choix-famille span { color: var(--muted); font-size: 14px; }
.choix-famille:hover { border-color: var(--teinte, var(--accent)); }
.famille-contact { --teinte: #6b7cff; }
.famille-redirection { --teinte: #18ab9e; }
.famille-zikup { --teinte: #9442e6; }
.famille-album { --teinte: #e35472; }
.famille-festival { --teinte: #e07615; }
.famille-jam { --teinte: #d99a1c; }

/* ---------- Editeur ---------- */
.editeur { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .editeur { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } }
.tete-editeur { margin-bottom: 16px; }
.tete-editeur h1 { margin-top: 8px; }
.url-tag { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.url-tag a { font-weight: 600; }
.panneau { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--rayon); background: var(--surface); }
.panneau h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.modeles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.modele { position: relative; display: grid; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; font-size: 13px; }
.modele input { position: absolute; opacity: 0; }
.modele:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.modele:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mini { display: block; height: 76px; border-radius: 8px; background: var(--surface-2); position: relative; overflow: hidden; }
.mini::before, .mini::after { content: ""; position: absolute; }
.modele-pro .mini { border: 2px solid #00a165; background: #fff; }
.modele-pro .mini::before { right: 6px; top: -10px; width: 12px; height: 100px; background: #00a165; transform: skewX(-20deg); }
.modele-pro .mini::after { left: 10px; top: 14px; width: 46px; height: 6px; border-radius: 3px; background: #333; box-shadow: 0 12px 0 -1px #999, 0 26px 0 -1px #00a165; }
.modele-minimal .mini { background: #10131b; }
.modele-minimal .mini::before { left: 50%; top: 12px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; border: 2px solid #6b7cff; }
.modele-minimal .mini::after { left: 22%; right: 22%; top: 48px; height: 10px; border-radius: 5px; background: #6b7cff; }
.modele-creatif .mini { background: radial-gradient(80% 60% at 50% 0%, #f3b3d4, #fff 70%); }
.modele-creatif .mini::before { left: 50%; top: 8px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: #d62976; }
.modele-creatif .mini::after { left: 18%; right: 18%; top: 46px; height: 9px; border-radius: 5px; background: #0a66c2; box-shadow: 0 13px 0 #d62976; }
.modele-evenement .mini { background: linear-gradient(#c08a3e 0 34%, #fff 34%); }
.modele-evenement .mini::before { left: 50%; top: 14px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: #ead9c0; border: 3px solid #fff; }
.modele-evenement .mini::after { left: 26%; right: 26%; top: 56px; height: 9px; border-radius: 5px; background: #222; }

.couleur { display: flex; gap: 8px; }
.couleur input[type="color"] { width: 52px; min-width: 52px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }

.repetable { margin: 0 0 14px; padding: 0; border: 0; }
.repetable legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.lignes { display: grid; gap: 8px; }
.ligne { display: grid; grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.4fr) 36px; gap: 8px; align-items: center; }
.ligne:has(> input:only-of-type) { grid-template-columns: minmax(0, 1fr) 36px; }
.retire { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 18px; cursor: pointer; }
.ajout { margin-top: 8px; }
@media (max-width: 560px) { .ligne { grid-template-columns: minmax(0, 1fr) 36px; } .ligne > :first-child:not(:only-of-type) { grid-column: 1 / -1; } }

.image .vignette-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vignette { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }

.barre-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.barre-actions .bouton { flex: 1; }

.colonne-apercu { display: grid; gap: 14px; }
@media (min-width: 980px) { .colonne-apercu { position: sticky; top: 16px; } }
.telephone { width: 100%; max-width: 390px; margin: 0 auto; padding: 10px; border-radius: 36px; background: #111; box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6); }
.telephone iframe { display: block; width: 100%; height: min(72vh, 720px); border: 0; border-radius: 28px; background: #fff; }
.qr { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--rayon); background: var(--surface); }
.qr img { flex: none; width: 110px; height: 110px; border-radius: 8px; background: #fff; }
.qr p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.danger { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: var(--rayon); background: var(--surface); }
.danger summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.danger p { color: var(--muted); font-size: 14px; }

/* ---------- Ecran DJ ---------- */
.liste-dj { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.liste-dj li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.liste-dj li.fait { opacity: 0.55; }
.liste-dj .compte { min-width: 40px; text-align: center; font-weight: 800; color: var(--accent); }
.liste-dj .info { flex: 1; min-width: 0; display: grid; }
.liste-dj .info strong { overflow-wrap: anywhere; font-size: 17px; }

/* ---------- Galerie ---------- */
.grille-photos { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grille-photos li { display: grid; gap: 6px; }
.grille-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.grille-photos .heic { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); text-align: center; text-decoration: none; }
.grille-photos form { margin: 0; text-align: center; }

/* ---------- Admin ---------- */
.admin table { width: 100%; border-collapse: collapse; margin: 8px 0 28px; font-size: 14px; background: var(--surface); }
.admin th, .admin td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin tr.inactif { opacity: 0.5; }
.admin form { margin: 0; }
.formulaire-admin { max-width: 520px; }
.texte p { max-width: 680px; }
