/* ===== Eventia — design system (complète Tailwind CDN) ===== */
:root {
  --red: #E11D2E; --red-dark: #C10F1D; --red-soft: #FEF2F2;
  --gold: #FBBF24; --ink: #111827; --paper: #F6F7F9;
  --radius: .5rem; --ease: cubic-bezier(.22,.8,.3,1);
}
body { background: #F6F7F9; }
html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
/* pas de défilement horizontal, défilement vertical libre : overflow-x « clip » ne crée pas de conteneur de défilement */
html { overflow-x: hidden; overscroll-behavior-x: none; }
body { max-width: 100%; overflow-x: clip; }
img, video, canvas, svg { max-width: 100%; }
body { font-feature-settings: "cv02","cv03","cv04","cv11"; }
[x-cloak] { display: none !important; }

/* Dégradés de marque */
.bg-brand-gradient { background-image: linear-gradient(135deg, #E11D2E 0%, #C10F1D 100%); }
.bg-hero { background: radial-gradient(900px 500px at 100% 0%, rgba(225,29,46,.55), transparent 60%), linear-gradient(160deg, #1a0a0c 0%, #2b0d10 55%, #7F1D1D 100%); }
.text-gradient { color: #E11D2E; }
.ring-brand { box-shadow: 0 0 0 3px rgba(225,29,46,.2); }

/* Cartes & surfaces */
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(17,24,39,.06); border: 1px solid #ECEEF1; }
.dark .card { background: #111a2e; border-color: rgba(255,255,255,.06); box-shadow: 0 8px 24px -12px rgba(0,0,0,.5); }
.card-hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -14px rgba(225,29,46,.35); }
.glass { background: rgba(255,255,255,.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.12); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; border-radius: .45rem; padding: .62rem 1.05rem; font-size: .9rem; line-height: 1.25rem; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-primary { background: #E11D2E; color: #fff; box-shadow: 0 6px 16px -8px rgba(225,29,46,.7); }
.btn-primary:hover { background: #C10F1D; }
.btn-accent { background: #E11D2E; color: #fff; box-shadow: 0 6px 16px -8px rgba(225,29,46,.7); }
.btn-accent:hover { background: #C10F1D; }
.btn-dark { background: #111827; color: #fff; }
.btn-gold { background: #FBBF24; color: #3b2300; }
.btn-ghost { background: #F3F4F6; color: #111827; }
.btn-ghost:hover { background: #E5E7EB; }
.dark .btn-ghost { background: rgba(255,255,255,.06); color: #E2E8F0; }
.btn-outline { border: 1.5px solid #E11D2E; color: #E11D2E; background: #fff; }
.dark .btn-outline { color: #FCA5A5; border-color: rgba(252,165,165,.5); background: transparent; }
.btn-danger { background: #DC2626; color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: .4rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; }

/* Formulaires */
.input, .select, .textarea { width: 100%; border-radius: .4rem; border: 1px solid #D9DCE1; background: #fff; padding: .62rem .8rem; font-size: .92rem; transition: border-color .2s, box-shadow .2s; color: #111827; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #E11D2E; box-shadow: 0 0 0 3px rgba(225,29,46,.12); }
.dark .input, .dark .select, .dark .textarea { background: #0b1324; border-color: #1f2a44; color: #E2E8F0; }
.label { display: block; font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: .3rem; }
.dark .label { color: #94A3B8; }
.help { font-size: .75rem; color: #64748B; margin-top: .3rem; }
.checkbox { width: 1.1rem; height: 1.1rem; accent-color: #E11D2E; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; letter-spacing: .01em; }
.badge-violet { background: #FEE2E2; color: #C10F1D; } .badge-orange { background: #FFEDD5; color: #C2410C; }
.badge-gold { background: #FEF3C7; color: #92400E; } .badge-green { background: #DCFCE7; color: #166534; }
.badge-red { background: #FEE2E2; color: #B91C1C; } .badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-gray { background: #F1F5F9; color: #475569; }
.dark .badge-gray { background: #1e293b; color: #cbd5e1; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(225,29,46,.5); } 100% { box-shadow: 0 0 0 16px rgba(225,29,46,0); } }
@keyframes scanline { 0% { top: 8%; } 50% { top: 88%; } 100% { top: 8%; } }
.animate-fade-in-up { animation: fadeInUp .55s var(--ease) both; }
.animate-fade-in { animation: fadeIn .4s ease both; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pop { animation: pop .35s var(--ease) both; }
.animate-pulse-ring { animation: pulseRing 1.6s infinite; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.stagger > * { animation: fadeInUp .5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; } .stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; } .stagger > *:nth-child(n+7) { animation-delay: .3s; }

/* Skeletons */
.skeleton { position: relative; overflow: hidden; background: #E2E8F0; border-radius: .4rem; }
.dark .skeleton { background: #1e293b; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.4s infinite; }

/* Carrousel */
.snap-x-mandatory { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.snap-x-mandatory::-webkit-scrollbar { display: none; }
.snap-start { scroll-snap-align: start; }
.no-scrollbar { scrollbar-width: none; } .no-scrollbar::-webkit-scrollbar { display: none; }

/* Navigation mobile */
.bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a.active { color: #E11D2E; }
.dark .bottom-nav a.active { color: #FCA5A5; }
.nav-fab { width: 3rem; height: 3rem; margin-top: -1.1rem; border-radius: 999px; background: #E11D2E; color: #fff; display: grid; place-items: center; font-size: 1.4rem; box-shadow: 0 8px 18px -6px rgba(225,29,46,.8); border: 4px solid #fff; transition: transform .2s var(--ease); }
.nav-fab:active { transform: scale(.92); }
.chip { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; border: 1px solid #E5E7EB; background: #fff; border-radius: .4rem; padding: .45rem .8rem; font-size: .85rem; font-weight: 500; color: #111827; transition: all .2s; }
.chip:hover { border-color: #E11D2E; color: #E11D2E; }
.chip.active { background: #E11D2E; border-color: #E11D2E; color: #fff; }
.tab-pill { padding: .5rem .95rem; border-radius: .4rem; font-size: .88rem; font-weight: 600; color: #6B7280; }
.tab-pill.active { background: #E11D2E; color: #fff; box-shadow: 0 6px 14px -8px rgba(225,29,46,.8); }
.icon-box { width: 2rem; height: 2rem; border-radius: .4rem; display: grid; place-items: center; background: #FEF2F2; color: #E11D2E; font-size: 1rem; }
.bottom-nav a.active .dot { opacity: 1; transform: scale(1); }
.bottom-nav .dot { opacity: 0; transform: scale(.4); transition: all .25s var(--ease); }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: .45rem; font-size: .88rem; font-weight: 500; color: #475569; transition: background .2s, color .2s; }
.side-link:hover { background: #F1F5F9; color: #0F172A; }
.side-link.active { background: #FEF2F2; color: #E11D2E; font-weight: 600; }
.dark .side-link { color: #94A3B8; } .dark .side-link:hover { background: #1e293b; color: #fff; }
.dark .side-link.active { color: #FCA5A5; background: rgba(225,29,46,.15); }

/* Tableaux */
.table { width: 100%; font-size: .85rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748B; font-weight: 700; padding: .6rem .75rem; border-bottom: 1px solid #E2E8F0; white-space: nowrap; }
.table td { padding: .65rem .75rem; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.table tr:hover td { background: #FFF8F8; }
.dark .table th { border-color: #1f2a44; } .dark .table td { border-color: #16213a; } .dark .table tr:hover td { background: #0f1930; }

/* Billet */
.ticket { position: relative; border-radius: .4rem; overflow: hidden; }
.ticket .perforation { position: relative; height: 0; border-top: 2px dashed rgba(148,163,184,.5); margin: 0 1rem; }
.ticket .perforation::before, .ticket .perforation::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 999px; background: #F6F7F9; }
.dark .ticket .perforation::before, .dark .ticket .perforation::after { background: #0F172A; }
.ticket .perforation::before { left: -27px; } .ticket .perforation::after { right: -27px; }

/* Toasts */
.toast-enter { animation: slideDown .3s var(--ease) both; }

/* Scanner */
.scanner-frame { position: absolute; inset: 15% 12%; border-radius: .45rem; box-shadow: 0 0 0 100vmax rgba(2,6,23,.55); }
.scanner-frame::before, .scanner-frame::after { content: ""; position: absolute; width: 40px; height: 40px; border: 4px solid #fff; }
.scanner-frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 1.2rem; }
.scanner-frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 1.2rem; }
.scanner-line { position: absolute; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, transparent, #E11D2E, transparent); box-shadow: 0 0 12px #E11D2E; animation: scanline 2.6s ease-in-out infinite; }
.result-valid { background: radial-gradient(circle at 50% 35%, #22C55E, #15803D); }
.result-duplicate { background: radial-gradient(circle at 50% 35%, #F59E0B, #B45309); }
.result-expired { background: radial-gradient(circle at 50% 35%, #F97316, #9A3412); }
.result-invalid { background: radial-gradient(circle at 50% 35%, #EF4444, #991B1B); }

/* Éditeur de cadre */
.zone-handle { position: absolute; width: 16px; height: 16px; background: #fff; border: 3px solid #E11D2E; border-radius: 999px; touch-action: none; }
.prose-event p { margin: .6rem 0; line-height: 1.7; }
.prose-event h2, .prose-event h3 { font-weight: 700; margin: 1rem 0 .4rem; }
.prose-event ul { list-style: disc; padding-left: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Contenu riche (éditeur de texte) */
.rich h2 { font-size: 1.35rem; font-weight: 800; margin: 1.1rem 0 .4rem; }
.rich h3 { font-size: 1.15rem; font-weight: 700; margin: 1rem 0 .3rem; }
.rich a { color: #E11D2E; text-decoration: underline; }
.rich ul { list-style: disc; padding-left: 1.3rem; } .rich ol { list-style: decimal; padding-left: 1.3rem; }
.rich blockquote { border-left: 4px solid #E11D2E; padding-left: .9rem; color: #4B5563; font-style: italic; }
.rich .ql-align-center { text-align: center; } .rich .ql-align-right { text-align: right; } .rich .ql-align-justify { text-align: justify; }
.rich .ql-size-small { font-size: .85em; } .rich .ql-size-large { font-size: 1.4em; } .rich .ql-size-huge { font-size: 2em; }
.ql-toolbar.ql-snow { border-radius: .4rem .4rem 0 0; border-color: #D9DCE1; background: #F9FAFB; }
.ql-container.ql-snow { border-radius: 0 0 .4rem .4rem; border-color: #D9DCE1; min-height: 220px; font-size: 15px; font-family: inherit; }

/* ===== Mobile très compact (pas de zoom : viewport bloqué + garde JS dans app.js) ===== */
@media (max-width: 639px) {
  html { font-size: 13.5px; }
  .p-8 { padding: 1.1rem; } .p-6 { padding: .95rem; } .p-5 { padding: .85rem; } .p-4 { padding: .7rem; } .p-3 { padding: .55rem; }
  .px-6 { padding-left: .95rem; padding-right: .95rem; } .px-5 { padding-left: .85rem; padding-right: .85rem; }
  .py-16 { padding-top: 1.75rem; padding-bottom: 1.75rem; } .py-12 { padding-top: 1.4rem; padding-bottom: 1.4rem; }
  .py-10 { padding-top: 1.2rem; padding-bottom: 1.2rem; } .py-8 { padding-top: 1rem; padding-bottom: 1rem; } .py-6 { padding-top: .8rem; padding-bottom: .8rem; }
  .gap-8 { gap: 1rem; } .gap-6 { gap: .8rem; } .gap-5 { gap: .7rem; } .gap-4 { gap: .6rem; }
  .mb-10 { margin-bottom: 1.4rem; } .mb-8 { margin-bottom: 1.1rem; } .mb-6 { margin-bottom: .85rem; } .mt-10 { margin-top: 1.4rem; } .mt-8 { margin-top: 1.1rem; } .mt-6 { margin-top: .85rem; }
  .space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.1rem; }
  .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: .85rem; }
  .space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: .75rem; }
  .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: .6rem; }
  .text-5xl { font-size: 1.9rem; line-height: 2.2rem; } .text-4xl { font-size: 1.65rem; line-height: 2rem; }
  .text-3xl { font-size: 1.4rem; line-height: 1.8rem; } .text-2xl { font-size: 1.22rem; line-height: 1.6rem; } .text-xl { font-size: 1.08rem; line-height: 1.45rem; }
  .rounded-3xl { border-radius: .4rem; } .rounded-2xl { border-radius: .5rem; }
  .btn { padding: .5rem .8rem; font-size: .86rem; gap: .35rem; border-radius: .4rem; }
  .btn-sm { padding: .32rem .6rem; font-size: .78rem; }
  .btn-lg { padding: .62rem 1rem; font-size: .92rem; }
  .input, .select, .textarea { padding: .5rem .65rem; font-size: .92rem; border-radius: .4rem; }
  .label { font-size: .78rem; margin-bottom: .2rem; }
  .chip { padding: .35rem .65rem; font-size: .8rem; }
  .tab-pill { padding: .4rem .75rem; font-size: .82rem; }
  .card { border-radius: .5rem; }
  .table th, .table td { padding: .45rem .55rem; }
  .icon-box { width: 1.75rem; height: 1.75rem; }
  .nav-fab { width: 2.7rem; height: 2.7rem; }
  .ql-container.ql-snow { min-height: 160px; font-size: 14px; }
}
@media (min-width: 640px) and (max-width: 1023px) { html { font-size: 15px; } }

/* ===== Tiroir de navigation (opaque, mobile + ordinateur) ===== */
.drawer-panel { background: #fff; box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45); }
@media (min-width: 768px) { .drawer-panel { border: 1px solid #E5E7EB; } }
.drawer-head { background: linear-gradient(135deg, #E11D2E 0%, #B5121F 100%); }
.drawer-title { padding: .55rem .7rem .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9CA3AF; }
.drawer-sep { margin: .4rem .6rem; border-top: 1px solid #F1F2F4; }
.drawer-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: .45rem; font-size: .93rem; font-weight: 500; color: #1F2937; transition: background .15s; }
.drawer-link:hover { background: #F7F7F8; }
.drawer-link.is-active { background: #FEF2F2; color: #B5121F; font-weight: 600; }
.drawer-ico { width: 2.1rem; height: 2.1rem; flex-shrink: 0; display: grid; place-items: center; border-radius: .4rem; background: #F3F4F6; color: #4B5563; }
.drawer-link.is-active .drawer-ico { background: #E11D2E; color: #fff; }

/* ===== Fenêtre de filtres ===== */
.filter-sheet { background: #fff; box-shadow: 0 -12px 40px -10px rgba(15, 23, 42, .35); }
@media (min-width: 768px) { .filter-sheet { box-shadow: 0 30px 70px -15px rgba(15, 23, 42, .5); } }
.filter-legend { font-size: .78rem; font-weight: 700; color: #111827; margin-bottom: .45rem; text-transform: uppercase; letter-spacing: .05em; }
.fchip { position: relative; cursor: pointer; -webkit-user-select: none; user-select: none; }
.fchip input { position: absolute; opacity: 0; pointer-events: none; }
.fchip > span { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #E5E7EB; background: #fff; border-radius: .4rem; padding: .42rem .7rem; font-size: .84rem; font-weight: 500; color: #374151; transition: all .15s; max-width: 100%; }
.fchip:hover > span { border-color: #D1D5DB; }
.fchip input:checked + span { background: #E11D2E; border-color: #E11D2E; color: #fff; font-weight: 600; box-shadow: 0 4px 12px -4px rgba(225, 29, 46, .6); }
.fchip input:focus-visible + span { outline: 2px solid #E11D2E; outline-offset: 2px; }
.fchip-card > span { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 3.9rem; padding: .5rem .3rem; text-align: center; gap: .25rem; font-size: .76rem; line-height: 1.1; }
.fchip-card > span > span { max-width: 100%; }
