/* ==========================================================================
   Feuille de styles dédiée : Page de Vérification des Actes Officiels (MCCAT)
   ========================================================================== */

:root {
    --verif-primary: #419E4B;
    --verif-primary-dark: #2e7d32;
    --verif-header-dark: #1a2942;
    --verif-secondary: #2c3e50;
    --verif-accent-red: #EF2B2B;
    --verif-accent-yellow: #FCD116;
    --verif-slate-dark: #1a2942;
    --verif-slate-muted: #64748b;
    --verif-bg-subtle: #f8fafc;
    --verif-border-color: #e2e8f0;
}

.verification-page-container {
    width: 100%;
    max-width: 98%;
    margin: 1rem auto 3rem auto;
    padding: 0 0.5rem;
}

/* Classes utilitaires pour éliminer les styles inlines (conforme CSP) */
.modal-emblem-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.modal-type-subtitle {
    font-size: 0.85rem;
}

.empty-search-icon {
    opacity: 0.4;
}

.col-action-verif {
    width: 100px;
    text-align: center;
}

.camera-select-field {
    max-width: 250px;
}

/* Groupe de filtres Tous / Structures / Professionnels */
.filter-type-group .btn-outline-success {
    color: #1b5e20;
    border-color: #2e7d32;
    background: #ffffff;
    font-size: 0.85rem;
    padding: 0.4rem 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-type-group .btn-check:checked + .btn-outline-success {
    background-color: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.25);
}

.filter-type-group .btn-outline-success:hover {
    background-color: #f0fdf4;
    color: #1b5e20;
}

/* Titre épuré centré */
.page-clean-title {
    color: #1b5e20;
    font-size: 1.85rem;
    font-weight: 700;
    text-align: center;
    margin: 1.5rem 0 1.25rem 0;
    letter-spacing: -0.01em;
}

/* Boîte de recherche style ATI / moderne */
.search-ati-box {
    background: #ffffff;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.ati-search-input {
    border: 1.5px solid #2e7d32 !important;
    border-radius: 4px !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.95rem !important;
    color: #1e293b !important;
    box-shadow: none !important;
    width: 100%;
}

.ati-search-input:focus {
    border-color: #1b5e20 !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18) !important;
}

.btn-ati-search {
    background: #2e7d32;
    color: #ffffff;
    border: 1.5px solid #2e7d32;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1.75rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-ati-search:hover {
    background: #1b5e20;
    border-color: #1b5e20;
    color: #ffffff;
}

.btn-ati-outline {
    background: #ffffff;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-ati-outline:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Tableau ATI conforme à la capture d'écran */
.table-verif-ati-wrapper {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.table-verif-ati {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    font-size: 0.86rem;
}

.table-verif-ati thead th {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    white-space: nowrap;
    vertical-align: middle;
}

.table-verif-ati thead th:last-child {
    border-right: none !important;
}

.table-verif-ati tbody td {
    padding: 0.75rem 0.85rem;
    vertical-align: middle;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    color: #1f2937;
    font-size: 0.84rem;
}

.table-verif-ati tbody td:last-child {
    border-right: none;
}

.table-verif-ati tbody tr:hover {
    background-color: #f8fafc;
}

.table-verif-ati .cell-denomination {
    font-weight: 700;
    text-transform: uppercase;
    color: #0f172a;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.table-verif-ati .cell-mono {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    color: #374151;
}

.table-verif-ati .statut-text {
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-verif-ati .statut-valide {
    color: #16a34a;
}

.table-verif-ati .statut-expire {
    color: #dc2626;
}

.table-verif-ati .statut-revoque {
    color: #991b1b;
}

.table-verif-ati .statut-en-cours {
    color: #d97706;
}

.table-verif-ati .date-expire-red {
    color: #dc2626;
    font-weight: 700;
}

/* Anciens styles conservés pour rétrocompatibilité */

.btn-search-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-search-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-qr-scan {
    background: var(--verif-header-dark);
    border: 1px solid var(--verif-secondary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-qr-scan:hover {
    background: #24344d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 41, 66, 0.3);
    color: #ffffff;
}

/* Panneau de recherche avancée */
.advanced-filter-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    margin-top: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.advanced-filter-panel label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.advanced-filter-panel .form-control,
.advanced-filter-panel .form-select {
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
}

.advanced-filter-panel .form-control:focus,
.advanced-filter-panel .form-select:focus {
    border-color: var(--verif-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Onglets interactifs */
.custom-verif-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.custom-verif-tab-item {
    padding: 0.5rem 1.15rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-verif-tab-item:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.custom-verif-tab-item.active {
    color: #ffffff;
    background: var(--verif-header-dark);
    box-shadow: 0 2px 8px rgba(26, 41, 66, 0.25);
    border-bottom: 3px solid var(--verif-primary);
}

.custom-verif-tab-item .badge-count {
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.custom-verif-tab-item.active .badge-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Tableau institutionnel */
/* Tableau institutionnel moderne et réactif */
.table-verif-wrapper {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--verif-border-color);
    overflow: hidden;
}

.table-verif {
    margin-bottom: 0;
    font-size: 0.88rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-verif thead th {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    font-weight: 700;
    text-align: left;
    padding: 0.95rem 0.85rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-bottom: 3px solid var(--verif-primary);
    white-space: nowrap;
    vertical-align: middle;
}

.table-verif tbody td {
    padding: 0.9rem 0.85rem;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table-verif tbody tr {
    transition: all 0.18s ease;
}

.table-verif tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-verif tbody tr:hover {
    background-color: #f0fdf4 !important;
    box-shadow: inset 3px 0 0 var(--verif-primary);
}

/* Badges spécifiques pour les types & formes juridiques */
.badge-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.type-badge-sarl {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.type-badge-sa {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.type-badge-association {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.type-badge-culturelle {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.type-badge-ei {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.type-badge-public {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.type-badge-guide {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.type-badge-presse {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.type-badge-cinema {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.type-badge-structure {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.type-badge-pro {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Référence officielle certifiée */
.ref-pill-certifiee {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

/* Badges de statut */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.valid {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 2px rgba(6, 95, 70, 0.08);
}

.status-pill.expired {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.status-pill.revoked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-pill.pending {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Boutons d'action dans le tableau */
.btn-action-view {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
    transition: all 0.22s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-action-view:hover {
    background: var(--verif-primary);
    color: #ffffff;
    border-color: var(--verif-primary);
    box-shadow: 0 3px 10px rgba(65, 158, 75, 0.35);
    transform: translateY(-1px);
}

/* Modal Scanner QR Code */
.qr-scanner-frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 1 / 1;
}

#qr-reader {
    width: 100% !important;
    border: none !important;
}

#qr-reader__scan_region {
    background: transparent !important;
}

#qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 16px;
}

.qr-laser-line {
    display: none;
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #10b981;
    box-shadow: 0 0 12px 3px rgba(16, 185, 129, 0.85);
    animation: laserScan 2s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 10;
}

.qr-laser-line.active {
    display: block;
}

@keyframes laserScan {
    0% {
        top: 15%;
    }
    100% {
        top: 85%;
    }
}

.qr-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qr-drop-zone:hover,
.qr-drop-zone.dragover {
    border-color: var(--verif-primary);
    background: #ecfdf5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 991px) {
    .verification-header-banner .brand-block {
        flex-direction: column;
        text-align: center;
    }
    .search-input-group-modern {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    .search-input-group-modern .btn-search-primary {
        width: 100%;
        text-align: center;
    }
}
