/* =========================================================
   KotiPass — evenements : affiches, page de vente, billets, scanner
   (s'appuie sur les variables de kotipass.css)
   ========================================================= */

/* ---------- Affiche generee (tant qu'il n'y a pas d'image) ---------- */
.affiche { --c1: #01215e; --c2: #ff6c04; --c3: #0084fd; position: relative; overflow: hidden; border-radius: var(--rayon-l); color: #fff; isolation: isolate; background: linear-gradient(145deg, var(--c1) 10%, color-mix(in srgb, var(--c1) 60%, var(--c3)) 55%, var(--c2) 130%); min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; }
.affiche::before, .affiche::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; }
.affiche::before { width: 70%; aspect-ratio: 1; right: -18%; top: -28%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--c2) 80%, #fff) 0%, var(--c2) 42%, transparent 70%); opacity: .9; animation: flotte 9s ease-in-out infinite alternate; }
.affiche::after { width: 60%; aspect-ratio: 1; left: -22%; bottom: -32%; background: radial-gradient(circle, var(--c3) 0%, transparent 68%); opacity: .75; animation: flotte 11s ease-in-out infinite alternate-reverse; }
.affiche-grain { position: absolute; inset: 0; z-index: -1; opacity: .16; background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .3) 0 1px, transparent 1px 14px); -webkit-mask-image: linear-gradient(180deg, transparent, #000 65%); mask-image: linear-gradient(180deg, transparent, #000 65%); }
.affiche-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.affiche-date { background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .24); border-radius: 16px; padding: 9px 12px; text-align: center; line-height: 1; min-width: 66px; }
.affiche-date b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.affiche-date small { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; opacity: .9; }
.affiche-org { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; max-width: 62%; text-align: right; }
.affiche-titre { font-size: clamp(1.4rem, 4.2vw, 2rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 26px 0 8px; text-shadow: 0 2px 24px rgba(0, 0, 0, .25); }
.affiche-lieu { display: flex; align-items: center; gap: 6px; font-size: .92rem; opacity: .92; }
.affiche-lieu .icone { width: 16px; height: 16px; }
.affiche-palette-0 { --c1: #01215e; --c2: #ff6c04; --c3: #0084fd; }
.affiche-palette-1 { --c1: #070b6b; --c2: #0084fd; --c3: #6a3cff; }
.affiche-palette-2 { --c1: #3a0d63; --c2: #ff3d7f; --c3: #ff8a2a; }
.affiche-palette-3 { --c1: #04342a; --c2: #10a35a; --c3: #fea705; }
.affiche-palette-4 { --c1: #1b1b2f; --c2: #fea705; --c3: #ff6c04; }
@keyframes flotte { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 8%) scale(1.08); } }

/* ---------- Page de vente ---------- */
.vente-hero { position: relative; padding: 24px 0 32px; background: #00102e; overflow: hidden; }
.vente-fond { position: absolute; inset: -60px; filter: blur(70px) saturate(1.4); opacity: .55; }
.vente-fond .affiche { height: 100%; border-radius: 0; }
.vente-grille { position: relative; display: grid; gap: 22px; }
.vente-hero .affiche { min-height: 320px; box-shadow: 0 40px 90px rgba(0, 0, 0, .45); }
.vente-hero .affiche-titre { font-size: clamp(2rem, 7vw, 3.1rem); }
.vente-infos { color: #c3cde3; }
.vente-infos h1 { color: #fff; font-size: clamp(1.7rem, 5vw, 2.6rem); margin-bottom: 14px; }
.vente-faits { display: grid; gap: 10px; margin: 0 0 16px; }
.vente-faits div { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 12px 14px; }
.vente-faits .icone { color: #ffb35c; }
.vente-faits strong { color: #fff; display: block; }
.compte-a-rebours { display: flex; gap: 8px; }
.compte-a-rebours div { flex: 1; text-align: center; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px 4px; border: 1px solid rgba(255, 255, 255, .1); }
.compte-a-rebours b { display: block; font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.compte-a-rebours small { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.jauge-ventes { margin-top: 16px; font-size: .88rem; }
.jauge-ventes .progres { background: rgba(255, 255, 255, .12); margin-top: 6px; }
.vente-corps { padding: 24px 0 48px; }

.billets-choix { display: grid; gap: 14px; margin-bottom: 18px; }
.billet-option { position: relative; display: flex; align-items: stretch; background: var(--blanc); border: 2px solid var(--bord); border-radius: 18px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.billet-option:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
.billet-option:has(input:checked) { border-color: var(--orange); box-shadow: 0 10px 30px rgba(255, 108, 4, .18); }
.billet-option input { position: absolute; opacity: 0; pointer-events: none; }
.billet-corps { flex: 1; padding: 16px 18px; min-width: 0; }
.billet-corps strong { display: block; font-size: 1.1rem; color: var(--nuit); }
.billet-corps small { color: var(--doux); }
.billet-prix { display: grid; place-items: center; padding: 0 18px; border-left: 2px dashed var(--bord); font-weight: 800; font-size: 1.15rem; color: var(--nuit); white-space: nowrap; position: relative; }
/* Encoches du ticket : demi-cercles qui "mordent" la bordure, en haut et en bas du pointille. */
.billet-prix::before, .billet-prix::after { content: ""; position: absolute; left: -12px; width: 18px; height: 18px; border-radius: 50%; background: var(--blanc); border: 2px solid var(--bord); transition: border-color .15s; }
.billet-prix::before { top: -11px; clip-path: inset(50% -2px -2px -2px); }
.billet-prix::after { bottom: -11px; clip-path: inset(-2px -2px 50% -2px); }
.billet-option:has(input:checked) .billet-prix::before, .billet-option:has(input:checked) .billet-prix::after { border-color: var(--orange); }
.billet-option:has(input:checked) .billet-prix { color: var(--orange-fonce); }
.billet-option.epuise { opacity: .5; cursor: not-allowed; }
.billet-option .reste { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 700; color: #b45309; background: var(--or-clair); border-radius: 999px; padding: 2px 8px; }
.champ > span.quantite, .quantite { display: inline-flex; margin: 0; font-weight: 400; align-items: center; border: 1.5px solid var(--bord); border-radius: 12px; overflow: hidden; background: var(--blanc); }
.quantite button { width: 46px; height: 46px; border: 0; background: var(--fond); font-size: 1.3rem; font-weight: 700; color: var(--nuit); cursor: pointer; }
.quantite input { width: 56px; text-align: center; border: 0 !important; border-radius: 0 !important; font-weight: 800; font-size: 1.1rem; box-shadow: none !important; min-height: 46px; padding: 0 !important; }
.barre-paiement { position: sticky; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--bord); padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); margin: 18px -22px -22px; display: flex; align-items: center; gap: 12px; border-radius: 0 0 var(--rayon-l) var(--rayon-l); }
.barre-paiement .total { flex: 1; line-height: 1.2; min-width: 0; }
.barre-paiement .total small { color: var(--doux); display: block; font-size: .8rem; }
.barre-paiement .total strong { font-size: 1.35rem; color: var(--nuit); letter-spacing: -.02em; }

/* ---------- Billet (page "Mes tickets") ---------- */
.mes-billets { padding: 28px 0 48px; background: radial-gradient(800px 420px at 50% -10%, rgba(1, 132, 253, .18), transparent 70%); }
.mes-billets-titre { text-align: center; max-width: 560px; margin: 0 auto 22px; }
.billets { display: grid; gap: 26px; justify-content: center; grid-template-columns: minmax(0, 360px); }
.billet { position: relative; background: var(--blanc); border-radius: 26px; box-shadow: 0 24px 60px rgba(1, 33, 94, .16); overflow: hidden; animation: apparait .5s ease both; }
.billet:nth-child(2) { animation-delay: .08s; }
.billet:nth-child(3) { animation-delay: .16s; }
.billet .affiche { border-radius: 0; min-height: 190px; padding: 20px; }
.billet .affiche-titre { margin-top: 18px; font-size: 1.5rem; }
.billet-perfo { position: relative; height: 0; border-top: 2px dashed #d6dcea; margin: 0 22px; }
.billet-perfo::before, .billet-perfo::after { content: ""; position: absolute; top: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--fond); }
.billet-perfo::before { left: -37px; }
.billet-perfo::after { right: -37px; }
.billet-qr { padding: 22px 22px 4px; text-align: center; position: relative; }
.billet-qr svg { width: 100%; max-width: 230px; height: auto; display: block; margin: 0 auto; }
.billet-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; letter-spacing: .08em; color: var(--doux); font-size: .9rem; margin-top: 8px; }
.billet-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 22px 20px; }
.billet-pied strong { display: block; color: var(--nuit); font-size: 1.1rem; }
.billet-pied small { color: var(--doux); }
.billet-numero { font-weight: 800; color: var(--orange-fonce); background: #fff1e6; border-radius: 10px; padding: 6px 10px; font-size: .9rem; white-space: nowrap; }
.billet.utilise .billet-qr svg { opacity: .2; filter: grayscale(1); }
.billet-tampon { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-14deg); border: 4px solid var(--rouge); color: var(--rouge); font-weight: 800; font-size: 1.4rem; padding: 6px 16px; border-radius: 12px; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .85); white-space: nowrap; }
.billets-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 26px; }
@keyframes apparait { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Espace : evenements ---------- */
.carte-evenement { display: block; text-decoration: none; color: inherit; border-radius: var(--rayon-l); overflow: hidden; background: var(--blanc); border: 1px solid var(--bord); transition: transform .15s, box-shadow .15s; }
.carte-evenement:hover { transform: translateY(-3px); box-shadow: var(--ombre); }
.carte-evenement .affiche { border-radius: 0; min-height: 170px; }
.carte-evenement-pied { padding: 14px 16px 16px; }
.jauges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.jauge { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.jauge-cercle { --p: 0; --couleur: var(--orange); width: 62px; height: 62px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(closest-side, var(--blanc) 76%, transparent 78% 100%), conic-gradient(var(--couleur) calc(var(--p) * 1%), #e9edf4 0); font-weight: 800; font-size: .9rem; color: var(--nuit); }
.jauge span { display: block; color: var(--doux); font-size: .8rem; font-weight: 600; }
.jauge strong { display: block; font-size: 1.15rem; color: var(--nuit); letter-spacing: -.02em; }
.tarif-ligne { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-top: 1px solid var(--bord); align-items: center; }
.tarif-ligne:first-child { border-top: 0; }
.tarif-ligne .progres { grid-column: 1 / -1; height: 6px; }
.tarif-ligne form { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tarif-ligne form input[name=quantite] { width: 100px; min-height: 38px; padding: 6px 10px; }
.tarif-ligne form .case { margin: 0; }

/* ---------- Formulaire evenement (facon seminaire) ---------- */
.form-section { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--bord); font-size: 1rem; }
.form-section .icone { color: var(--orange); }
form > .form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.champ-image { cursor: pointer; }
.depot { display: grid; place-items: center; height: 170px; border: 2px dashed #c9d1df; border-radius: 16px; background: var(--fond); overflow: hidden; transition: border-color .15s; }
.depot:hover { border-color: var(--bleu); }
.depot img { width: 100%; height: 100%; object-fit: cover; }
.depot-paysage { height: 120px; }
.depot-vide { display: grid; justify-items: center; gap: 6px; color: var(--doux); }
.depot-vide .icone { width: 28px; height: 28px; color: var(--bleu); }
.affiche-photo { background-size: cover; background-position: center; }
.affiche-photo::before, .affiche-photo::after { display: none; }
.affiche-photo .affiche-voile { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 10, 40, .15) 0%, rgba(0, 10, 40, .1) 40%, rgba(0, 10, 40, .82) 100%); }
.ligne-tarif { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; background: var(--fond); border-radius: 14px; padding: 12px 12px 0; margin-bottom: 10px; }
.ligne-tarif .champ { margin-bottom: 12px; }
.retirer-tarif { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--rouge-clair); color: var(--rouge); font-size: 1.1rem; font-weight: 700; cursor: pointer; line-height: 1; }
@media (min-width: 720px) { .ligne-tarif { grid-template-columns: 2fr 1.4fr 1fr 1fr; padding-right: 44px; } .retirer-tarif { top: 34px; } }
.inscrit-photo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }

/* ---------- Scanner ---------- */
.page-scanner { background: #00081c; color: #fff; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.scanner-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; }
.scanner-entete a { color: #c3cde3; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.scanner-entete h1 { color: #fff; font-size: 1rem; margin: 0; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compteur-entrees { background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.compteur-entrees small { color: #aab6d1; font-weight: 600; }
.scanner-zone { position: relative; flex: 1; margin: 0 16px; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #12224a, #050d24); min-height: 380px; }
#lecteur { position: absolute; inset: 0; }
#lecteur video { width: 100% !important; height: 100% !important; object-fit: cover; }
#lecteur img, #lecteur__dashboard, #lecteur__header_message, #qr-shaded-region { display: none !important; }
.viseur { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.viseur-cadre { width: min(68vw, 280px); aspect-ratio: 1; position: relative; border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(0, 8, 28, .5); }
.viseur-cadre i { position: absolute; width: 46px; height: 46px; border: 5px solid #ffb35c; }
.viseur-cadre i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 22px 0 0 0; }
.viseur-cadre i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 22px 0 0; }
.viseur-cadre i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 22px; }
.viseur-cadre i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 22px 0; }
.viseur-laser { position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; border-radius: 3px; background: linear-gradient(90deg, transparent, #ff6c04, #fea705, #ff6c04, transparent); box-shadow: 0 0 18px 2px rgba(255, 108, 4, .8); animation: laser 2.2s ease-in-out infinite alternate; }
@keyframes laser { to { top: 88%; } }
.scanner-message { position: absolute; left: 16px; right: 16px; bottom: 18px; text-align: center; color: #c3cde3; font-weight: 600; font-size: .95rem; }
.scanner-bas { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.scanner-bas form { display: flex; gap: 8px; }
.scanner-bas input { background: rgba(255, 255, 255, .08) !important; border-color: rgba(255, 255, 255, .16) !important; color: #fff !important; }
.scanner-bas input::placeholder { color: #8291b3; }
.scanner-historique { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; max-height: 132px; overflow: auto; }
.scanner-historique li { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 8px 12px; }
.scanner-historique .ok { color: #5fe3a1; }
.scanner-historique .deja_utilise { color: #ffb35c; }
.scanner-historique .invalide, .scanner-historique .annule, .scanner-historique .autre_evenement { color: #ff7b7b; }

.verdict { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.verdict.visible { opacity: 1; pointer-events: auto; }
.verdict.ok { background: radial-gradient(circle at 50% 40%, #19c26f, #0a7a43); }
.verdict.deja_utilise { background: radial-gradient(circle at 50% 40%, #ffaa2b, #c25a00); }
.verdict.invalide, .verdict.annule, .verdict.autre_evenement { background: radial-gradient(circle at 50% 40%, #ff4d4d, #9b1111); }
.verdict-icone { width: 132px; height: 132px; margin: 0 auto 18px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.verdict.visible .verdict-icone { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.verdict-icone svg { width: 74px; height: 74px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.verdict h2 { color: #fff; font-size: clamp(2rem, 9vw, 3rem); margin: 0 0 6px; letter-spacing: -.02em; }
.verdict p { font-size: 1.25rem; margin: 0; color: rgba(255, 255, 255, .92); font-weight: 600; }
.verdict small { display: block; margin-top: 18px; color: rgba(255, 255, 255, .75); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .affiche::before, .affiche::after, .viseur-laser, .billet { animation: none; }
}
@media (min-width: 720px) {
  .jauges { grid-template-columns: repeat(4, 1fr); }
  .billets { grid-template-columns: repeat(auto-fit, minmax(300px, 360px)); }
}
@media (min-width: 960px) {
  .vente-hero { padding: 56px 0 64px; }
  .vente-grille { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
  .vente-hero .affiche { min-height: 440px; }
  .barre-paiement { position: static; margin: 18px 0 0; padding: 0; border: 0; background: none; }
}
