/* ============================================================
 * NOVA EVENT — thème
 * Dégradé violet, cartes arrondies, navigation basse sur mobile.
 * Mobile-first, compatible RTL (propriétés logiques : inline-start / inline-end).
 * ============================================================ */

/* Police embarquée (aucun appel externe). L'arabe utilise la police du système. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                 U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
                 U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --nv-deep: #24137a;          /* indigo profond : haut du dégradé */
  --nv-primary: #5b2be0;       /* violet : liens, boutons */
  --nv-primary-2: #7c3aed;     /* violet clair : bas du dégradé */
  --nv-ink: #1c1740;           /* texte principal */
  --nv-muted: #6b6889;         /* texte secondaire */
  --nv-bg: #f5f4fb;            /* fond de page */
  --nv-line: #e7e4f5;
  --nv-ok: #16a34a;
  --nv-warn-bg: #fff1cc; --nv-warn-ink: #8a5a00;
  --nv-gradient: linear-gradient(160deg, var(--nv-deep) 0%, var(--nv-primary) 58%, var(--nv-primary-2) 100%);
  --nv-shadow: 0 6px 24px rgba(36, 19, 122, .08);
  --nv-radius: 18px;
  --nav-h: 66px;               /* hauteur de la barre de navigation basse */

  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
  --bs-body-color: var(--nv-ink);
  --bs-body-bg: var(--nv-bg);
  --bs-secondary-color: var(--nv-muted);
  --bs-primary: #5b2be0; --bs-primary-rgb: 91, 43, 224;
  --bs-link-color: #5b2be0; --bs-link-color-rgb: 91, 43, 224;
  --bs-link-hover-color: #4520b8; --bs-link-hover-color-rgb: 69, 32, 184;
  --bs-border-color: var(--nv-line);
  --bs-border-radius: 12px; --bs-border-radius-sm: 10px; --bs-border-radius-lg: 16px;
}
body { background: var(--nv-bg); color: var(--nv-ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.01em; }
.text-secondary { color: var(--nv-muted) !important; }
.text-primary { color: var(--nv-primary) !important; }
a { text-underline-offset: 2px; }

/* ---------- Icônes (SVG en ligne, voir icon() dans app/layout.php) ---------- */
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; fill: none; stroke: currentColor;
       stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .ico-flip { transform: scaleX(-1); }   /* flèches : inversées en arabe */

/* ---------- Barre du haut ---------- */
.app-nav { background: var(--nv-gradient); background-attachment: fixed; }
.app-nav .navbar-brand { font-weight: 800; letter-spacing: .01em; display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; fill: #fff; }
.app-nav .nav-link { color: rgba(255, 255, 255, .85); font-weight: 500; }
.app-nav .nav-link:hover, .app-nav .nav-link.active { color: #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
          font-weight: 700; font-size: .85rem; background: #ebe6ff; color: var(--nv-primary); text-decoration: none; }
.app-nav .avatar { background: rgba(255, 255, 255, .2); color: #fff; border: 0; }

/* ---------- Bandeau de page (dégradé prolongé sous la barre, coins arrondis) ---------- */
.app-hero { background: var(--nv-gradient); background-attachment: fixed; color: #fff; padding: .5rem 0 3.25rem;
            border-end-start-radius: 28px; border-end-end-radius: 28px; }
.app-hero h1 { font-size: 1.35rem; margin: 0; color: #fff; }
.app-hero .sub { opacity: .88; font-size: .92rem; }
.app-hero .back { color: #fff; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
                  margin-inline-start: -.5rem; flex: none; }
.app-hero .back:hover, .app-hero .back:focus-visible { background: rgba(255, 255, 255, .16); }
.app-hero .form-control { border: 0; border-radius: 14px; min-height: 48px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.app-hero.flat { padding-bottom: 1.35rem; }                /* sans chevauchement */
.hero-pull { margin-top: -2.5rem; position: relative; }   /* le contenu chevauche le bandeau */

/* Accueil public */
.hero { background: var(--nv-gradient); border-radius: 24px !important; box-shadow: var(--nv-shadow); }

/* ---------- Cartes ---------- */
.card { border: 0; border-radius: var(--nv-radius); box-shadow: var(--nv-shadow); }
.card-footer { border-top: 1px solid var(--nv-line); border-radius: 0 0 var(--nv-radius) var(--nv-radius) !important; }
.card-img-top { border-radius: var(--nv-radius) var(--nv-radius) 0 0; }
.event-card { transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.event-card:hover, .event-card:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(36, 19, 122, .16); }
.event-description { white-space: normal; overflow-wrap: anywhere; }
.list-group { border-radius: var(--nv-radius); box-shadow: var(--nv-shadow); }
.list-group-item { border-color: var(--nv-line); }
.table { --bs-table-bg: transparent; }
.table-responsive { background: #fff; border-radius: var(--nv-radius); box-shadow: var(--nv-shadow); padding: .25rem .75rem; }
.alert { border: 0; border-radius: 14px; }

/* ---------- Boutons, champs, pastilles ---------- */
.btn { border-radius: 14px; font-weight: 600; }
.btn-sm { border-radius: 11px; }
.btn-primary { background: linear-gradient(135deg, #5b2be0, #7c3aed); border: 0; box-shadow: 0 6px 16px rgba(91, 43, 224, .28);
               --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: linear-gradient(135deg, #4a22bd, #6a2fd6); }
.btn-outline-primary { --bs-btn-color: var(--nv-primary); --bs-btn-border-color: var(--nv-primary);
                       --bs-btn-hover-bg: var(--nv-primary); --bs-btn-hover-border-color: var(--nv-primary);
                       --bs-btn-active-bg: var(--nv-primary); --bs-btn-active-border-color: var(--nv-primary);
                       border-width: 1.5px; background: #fff; }
.btn-outline-primary:hover { background: var(--nv-primary); }
.btn-outline-secondary { background: #fff; --bs-btn-border-color: var(--nv-line); --bs-btn-color: var(--nv-ink);
                         --bs-btn-hover-bg: #efecfb; --bs-btn-hover-color: var(--nv-ink); --bs-btn-hover-border-color: var(--nv-line); }
.btn-light { --bs-btn-color: var(--nv-primary); }
.form-control, .form-select { border-color: var(--nv-line); border-radius: 12px; }
.form-control:focus, .form-select:focus, .btn:focus-visible { border-color: var(--nv-primary); box-shadow: 0 0 0 .2rem rgba(91, 43, 224, .22); }
.form-check-input:checked { background-color: var(--nv-primary); border-color: var(--nv-primary); }
.badge { border-radius: 999px; font-weight: 600; padding: .4em .8em; }
.badge.text-bg-success { background: var(--nv-ok) !important; }
.badge.text-bg-warning { background: var(--nv-warn-bg) !important; color: var(--nv-warn-ink) !important; }
.badge.text-bg-light { background: #efecfb !important; color: var(--nv-primary) !important; }
.badge.text-bg-secondary { background: #ecebf3 !important; color: #55527a !important; }

/* Filtres en pastilles (participants) et onglets (scan) */
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem; background: #fff; border-radius: 16px; box-shadow: var(--nv-shadow);
         scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 1 1 0; min-width: 0; text-align: center; padding: .6rem .3rem; border-radius: 12px; font-weight: 600; font-size: .82rem; white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis;
        color: var(--nv-ink); text-decoration: none; border: 0; background: transparent; display: inline-flex; flex-direction: column;
        align-items: center; gap: .25rem; }
.chip.row-chip { flex-direction: row; justify-content: center; }
.chip[aria-current="true"], .chip[aria-selected="true"] { background: linear-gradient(135deg, #5b2be0, #7c3aed); color: #fff;
        box-shadow: 0 4px 12px rgba(91, 43, 224, .3); }

/* ---------- Tableau de bord ---------- */
.kpi-card { background: #fff; border-radius: var(--nv-radius); box-shadow: var(--nv-shadow); padding: .9rem 1rem; height: 100%; position: relative; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .5rem; }
.kpi-ico .ico { width: 22px; height: 22px; }
.tone-violet { background: #ede7ff; color: #5b2be0; } .tone-pink { background: #fbe7f5; color: #c0268f; }
.tone-amber { background: #fff1cc; color: #a16207; }  .tone-blue { background: #e3ecff; color: #2f55d4; }
.tone-green { background: #dcfce7; color: #15803d; }
.kpi-value { font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.kpi-label { color: var(--nv-muted); font-size: .88rem; }
.kpi { font-size: 1.5rem; font-weight: 800; color: var(--nv-ink); }
/* Anneau de progression : --p = pourcentage */
.ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
        background: conic-gradient(var(--nv-ok) calc(var(--p) * 1%), #e8e6f2 0); }
.ring > span { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center;
               font-size: .72rem; font-weight: 800; }
.kpi-card .ring { position: absolute; inset-block-start: .9rem; inset-inline-end: 1rem; }
.event-row { display: flex; gap: .9rem; }
.event-thumb-sm { width: 104px; height: 104px; border-radius: 14px; object-fit: cover; flex: none; background: var(--nv-gradient); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--nv-line); margin-top: .9rem; padding-top: .8rem; }
.mini-stats > div + div { border-inline-start: 1px solid var(--nv-line); padding-inline-start: .75rem; }
.mini-stats strong { display: block; font-size: 1rem; }
.mini-stats span { color: var(--nv-muted); font-size: .8rem; }
.meta-line { color: var(--nv-muted); font-size: .9rem; display: flex; align-items: center; gap: .4rem; }

/* ---------- Participants ---------- */
.person { display: flex; align-items: center; gap: .85rem; background: #fff; border-radius: 16px; box-shadow: var(--nv-shadow);
          padding: .8rem .9rem; margin-bottom: .6rem; }
.person .grow { flex: 1; min-width: 0; }
.person .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .state { text-align: end; flex: none; }
.pill { display: inline-block; border-radius: 999px; padding: .28rem .75rem; font-size: .8rem; font-weight: 700; }
.pill-in { background: var(--nv-ok); color: #fff; } .pill-out { background: var(--nv-warn-bg); color: var(--nv-warn-ink); }
.pill-off { background: #fde2e2; color: #b42318; }

/* ---------- Billets ---------- */
.ticket-card { border: 2px dashed #cfc6f2; box-shadow: none; }
.qr { width: 220px; height: 220px; }
.qr img, .qr canvas { width: 100%; height: 100%; }

/* ---------- Contrôle des entrées ---------- */
.scan-box { background: #14112b; aspect-ratio: 4 / 4.2; position: relative; border-radius: 22px; overflow: hidden; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 22% 18%; pointer-events: none; }
.scan-frame i { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; border-radius: 4px; }
.scan-frame i:nth-child(1) { inset-block-start: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.scan-frame i:nth-child(2) { inset-block-start: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: #22e06b; box-shadow: 0 0 14px 2px rgba(34, 224, 107, .8);
             animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 6%; } 50% { top: 94%; } }
.scan-start { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 17, 43, .55); }
.scan-result { background: #fff; border-radius: 20px; box-shadow: var(--nv-shadow); padding: 1rem 1.1rem; min-height: 5.5rem;
               border-inline-start: 6px solid #d9d5ee; }
.scan-result .state-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
                          background: #ecebf3; color: #55527a; }
.scan-ok   { background: #ecfdf3; border-inline-start-color: var(--nv-ok); } .scan-ok .state-ico { background: var(--nv-ok); color: #fff; }
.scan-ok #resultTitle { color: #15803d; }
.scan-warn { background: #fff8e1; border-inline-start-color: #f59e0b; } .scan-warn .state-ico { background: #f59e0b; color: #fff; }
.scan-ko   { background: #fef0f0; border-inline-start-color: #dc2626; } .scan-ko .state-ico { background: #dc2626; color: #fff; }
.scan-ko #resultTitle { color: #b42318; }
.tile { background: #fff; border-radius: 16px; box-shadow: var(--nv-shadow); padding: .8rem .9rem; display: flex; align-items: center; gap: .75rem; height: 100%; }
.tile .big { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.tile .lbl { color: var(--nv-muted); font-size: .82rem; }
.history-item { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--nv-line); }
.history-item:last-child { border-bottom: 0; }

/* Images de couverture : format 16/9 imposé, donc pas de saut de mise en page au chargement */
.event-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #e3def7; border-radius: 20px !important; }
.event-thumb { aspect-ratio: 16 / 9; object-fit: cover; background: #e3def7; }

/* ---------- Navigation basse (mobile) ---------- */
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--nv-line);
              display: flex; justify-content: space-around; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
              box-shadow: 0 -6px 20px rgba(36, 19, 122, .06); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem .2rem;
              font-size: .72rem; font-weight: 600; color: var(--nv-muted); text-decoration: none; background: none; border: 0; min-height: 48px; }
.bottom-nav .ico { width: 24px; height: 24px; }
.bottom-nav [aria-current="page"] { color: var(--nv-primary); }
.offcanvas { border-radius: 24px 24px 0 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .85rem .25rem; color: var(--nv-ink);
              text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--nv-line); font-weight: 600; text-align: start; }

@media (max-width: 767.98px) {
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .btn { padding-block: .6rem; }
  .form-control, .form-select { min-height: 46px; }
  footer.site-footer { display: none; }
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .app-hero h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .event-card { transition: none; }
  .scan-line { animation: none; top: 50%; }
}
