/* Repas — composants communs : coquille, navigation, boutons, champs, panneau du bas, cartes, toasts, connexion. */

/* ---------------------------------------------------------------- coquille */
body.appli { padding: 0 0 calc(96px + var(--bas)); min-height: 100vh; background: radial-gradient(120% 60% at 100% -10%, var(--or-pale), transparent 60%), radial-gradient(90% 50% at -10% 0%, var(--vert-pale), transparent 55%), var(--fond); background-attachment: fixed; padding-bottom: calc(68px + var(--bas)); }
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--haut)) 20px 10px; transition: background .25s, box-shadow .25s; }
.entete.defile { background: var(--verre); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); box-shadow: none; }
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; text-decoration: none; }
.marque img { width: 32px; height: 32px; border-radius: 10px; box-shadow: var(--ombre-1); }
.pastille { font-size: .75rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--terre-pale); color: var(--terre); }
.vue { max-width: 560px; margin: 0 auto; padding: 4px 18px 24px; }
.vue.entree { animation: entree .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes entree { from { opacity: 0; transform: translateY(10px); }; }

/* ---------------------------------------------------------------- navigation flottante */
.onglets { position: fixed; z-index: 30; left: 0; bottom: 0; transform: none; width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px max(10px, calc((100% - 460px) / 2)) calc(5px + var(--bas)); border-radius: 22px 22px 0 0; background: var(--verre); backdrop-filter: saturate(1.7) blur(20px); -webkit-backdrop-filter: saturate(1.7) blur(20px); box-shadow: 0 -6px 24px rgba(30, 25, 15, .10), inset 0 1px 0 var(--bord); right: 0; max-width: none; }
.onglets .curseur { position: absolute; top: 5px; bottom: calc(5px + var(--bas)); left: max(10px, calc((100% - 460px) / 2)); width: calc((min(100%, 460px) - 20px) / 4); border-radius: 16px; background: var(--vert); box-shadow: 0 6px 16px color-mix(in srgb, var(--vert) 40%, transparent); transition: transform .42s cubic-bezier(.3, 1.4, .5, 1); }
@media (min-width: 480px) { .onglets .curseur { width: calc(460px / 4); } }
.onglets a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; text-decoration: none; color: var(--doux); font-size: .66rem; font-weight: 700; letter-spacing: .01em; transition: color .3s; }
.onglets a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.onglets a.actif { color: #fff; }
@media (prefers-color-scheme: dark) { .onglets a.actif { color: #0f1a14; } }

/* ---------------------------------------------------------------- bandeau d'action */
.bandeau { position: relative; overflow: hidden; border-radius: var(--r-3); padding: 20px; margin: 0 0 18px; color: #fff; background: linear-gradient(135deg, #2e5d45, #3f7a5b 55%, #6d9b62); box-shadow: var(--ombre-2); }
.bandeau.chaud { background: linear-gradient(135deg, #c85a33, #d9783d 55%, #e3a83b); }
.bandeau::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.bandeau h3 { font-family: var(--titre); font-size: 1.35rem; margin: 0 0 4px; position: relative; }
.bandeau p { margin: 0 0 14px; opacity: .92; position: relative; }
.bandeau .bouton { background: #fff; color: #23452f; position: relative; }
.bandeau.chaud .bouton { color: #a3471f; }

/* ---------------------------------------------------------------- boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 14px; font-weight: 800; font-size: .9rem; background: var(--surface-2); color: var(--texte); transition: transform .15s, filter .2s; text-decoration: none; }
.bouton:active, .icone-btn:active, .choix:active { transform: scale(.96); }
.bouton.plein { background: var(--vert); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--vert) 35%, transparent); }
@media (prefers-color-scheme: dark) { .bouton.plein { color: #0f1a14; } }
.bouton.terre { background: var(--terre); color: #fff; }
.bouton.large { width: 100%; height: 52px; font-size: 1rem; border-radius: 16px; }
.bouton svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bouton.fantome { background: transparent; color: var(--doux); }
.bouton[disabled] { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------- panneau du bas */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 17, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.voile.ouvert { opacity: 1; }
.feuille { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; margin: 0 auto; max-width: 560px; padding: 10px 18px calc(22px + var(--bas)); border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: var(--ombre-3); transform: translateY(105%); transition: transform .42s cubic-bezier(.2, .9, .25, 1); overscroll-behavior: contain; }
.feuille.ouvert { transform: none; }
.poignee { width: 42px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--doux) 35%, transparent); margin: 2px auto 14px; }
.feuille h2 { font-family: var(--titre); font-size: 1.35rem; margin: 0 0 4px; letter-spacing: -.01em; }
.feuille .sous-titre { margin: 0 0 16px; color: var(--doux); font-size: .9rem; }
.choix { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px; margin-bottom: 10px; border-radius: var(--r-2); background: var(--surface-2); transition: transform .15s; animation: monte .4s both cubic-bezier(.2, .8, .2, 1); }
.choix:nth-child(2) { animation-delay: .05s; }
.choix:nth-child(3) { animation-delay: .1s; }
@keyframes monte { from { opacity: 0; transform: translateY(14px); }; }
.choix .vignette { width: 54px; height: 54px; font-size: 1.7rem; border-radius: 16px; }
.choix .nom-plat { font-size: 1rem; }
.separateur { display: flex; align-items: center; gap: 10px; color: var(--tres-doux); font-size: .78rem; font-weight: 700; margin: 16px 0 10px; text-transform: uppercase; letter-spacing: .08em; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--bord); }

/* ---------------------------------------------------------------- champs */
.champ { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
.champ:focus-within { box-shadow: inset 0 0 0 1.5px var(--vert); }
.champ input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1rem; padding: 8px 0; outline: none; }
.champ .bouton { height: 38px; }
textarea.zone { width: 100%; min-height: 84px; resize: vertical; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--surface-2); font-size: .95rem; line-height: 1.45; outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
textarea.zone:focus { box-shadow: inset 0 0 0 1.5px var(--vert); }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; font-weight: 600; font-size: .92rem; }
.interrupteur input { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 15px; position: relative; background: color-mix(in srgb, var(--doux) 30%, transparent); transition: background .25s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.interrupteur input:checked { background: var(--terre); }
.interrupteur input:checked::after { transform: translateX(20px); }

/* ---------------------------------------------------------------- compteur de personnes */
.compteur { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 10px 0 18px; }
.compteur button { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); font-size: 1.6rem; font-weight: 700; }
.compteur output { min-width: 90px; text-align: center; font-family: var(--titre); font-size: 2.8rem; line-height: 1; }
.compteur output small { display: block; font-family: var(--ui); font-size: .78rem; color: var(--doux); font-weight: 700; margin-top: 6px; }

/* ---------------------------------------------------------------- réglages */
.carte { border-radius: var(--r-2); background: var(--surface); box-shadow: var(--ombre-1); padding: 16px; margin-bottom: 14px; }
.carte h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1rem; font-weight: 800; }
.carte h3 .emoji { font-size: 1.3rem; }
.carte > p { margin: 0 0 12px; color: var(--doux); font-size: .85rem; }
.carte label.titre-champ { display: block; font-size: .78rem; font-weight: 800; color: var(--doux); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.curseur-reglage { margin: 14px 0 4px; }
.curseur-reglage .ligne { display: flex; justify-content: space-between; font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.curseur-reglage .ligne b { color: var(--vert); }
input[type=range] { width: 100%; accent-color: var(--vert); }
.liste-simple { margin: 0; padding: 0; list-style: none; }
.liste-simple li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bord); font-size: .92rem; }
.liste-simple li:first-child { border-top: 0; }
.etat-ligne { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; }
.etat-ligne i { width: 10px; height: 10px; border-radius: 5px; background: var(--tres-doux); }
.etat-ligne i.ok { background: var(--vert-2); box-shadow: 0 0 0 4px var(--vert-pale); }

/* ---------------------------------------------------------------- états vides, silhouettes, toast */
.vide-etat { text-align: center; padding: 38px 10px 10px; }
.vide-etat .illu { font-size: 4.2rem; margin-bottom: 8px; animation: flotte 3s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-8px) rotate(-3deg); }; }
.vide-etat h2 { font-family: var(--titre); font-size: 1.6rem; margin: 0 0 6px; }
.vide-etat p { color: var(--doux); margin: 0 0 22px; }
.silhouette { border-radius: var(--r-2); margin-bottom: 10px; height: 88px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: luit 1.3s infinite; }
.silhouette.titre { height: 64px; width: 70%; border-radius: 14px; }
@keyframes luit { to { background-position: -200% 0; }; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(72px + var(--bas)); transform: translate(-50%, 20px); opacity: 0; max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 16px; background: #1d2721; color: #fff; font-weight: 700; font-size: .9rem; box-shadow: var(--ombre-3); transition: opacity .3s, transform .4s cubic-bezier(.3, 1.4, .5, 1); pointer-events: none; text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-color-scheme: dark) { .toast { background: #ecf1ed; color: #101512; } }
.attente-texte { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--doux); font-weight: 700; padding: 14px 0; }
.rond { width: 18px; height: 18px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--vert) 25%, transparent); border-top-color: var(--vert); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); }; }
#confettis { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* ---------------------------------------------------------------- page de connexion */
body.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--haut)) 20px calc(24px + var(--bas)); background: radial-gradient(100% 70% at 100% 0%, var(--or-pale), transparent 60%), radial-gradient(90% 60% at 0% 100%, var(--vert-pale), transparent 60%), var(--fond); }
.boite { width: 100%; max-width: 400px; text-align: center; animation: entree .6s cubic-bezier(.2, .8, .2, 1); }
.boite .logo { width: 88px; height: 88px; border-radius: 28px; box-shadow: var(--ombre-2); margin-bottom: 18px; }
.boite h1 { font-family: var(--titre); font-size: 2.6rem; margin: 0; letter-spacing: -.02em; }
.boite > p { color: var(--doux); margin: 6px 0 26px; }
.boite form { text-align: left; padding: 20px; border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-2); }
.boite label { display: block; font-size: .76rem; font-weight: 800; color: var(--doux); text-transform: uppercase; letter-spacing: .08em; margin: 4px 0 8px; }
.boite input { width: 100%; border: 0; border-radius: 14px; padding: 14px; background: var(--surface-2); font-size: 1.05rem; outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; margin-bottom: 14px; }
.boite input:focus { box-shadow: inset 0 0 0 1.5px var(--vert); }
.boite #code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.35rem; letter-spacing: .14em; text-align: center; text-transform: uppercase; }
.avec-coller { display: flex; gap: 8px; margin-bottom: 14px; }
.avec-coller input { margin-bottom: 0 !important; }
.avec-coller .bouton { height: auto; padding: 0 14px; }
.avec-coller #code { font-size: 1.12rem; letter-spacing: .06em; min-width: 0; padding-left: 10px; padding-right: 10px; }
.boite .message { min-height: 1.3rem; margin-top: 12px; color: var(--rouge); font-weight: 700; font-size: .9rem; text-align: center; }
.boite .message.ok { color: var(--vert); }
.secousse { animation: secoue .4s; }
@keyframes secoue { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); }; }

/* préproduction : impossible de la confondre avec la vraie application */
.pastille.instance { background: #7a2ff0; color: #fff; letter-spacing: .04em; text-transform: uppercase; }
