/* =====================================================================
   Page Téléchargement — Documentation réglementaire
   Style scopé (évite de toucher au bundle Tailwind compilé).
   Couleurs du thème : --primary-color #e1000f / --accent-color #000091
   ===================================================================== */

/* ---- Fond : grille en fondu diagonal (repris de .login-page-bg) ---- */
.telechargement-page-bg {
    position: relative;
    background-color: #ffffff;
    background-image:
        linear-gradient(195deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.65) 60%, #ffffff 85%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'><path d='M 64 0 L 0 0 0 64' fill='none' stroke='%230f172a' stroke-opacity='0.11' stroke-width='1' stroke-dasharray='5 5'/></svg>");
    background-repeat: no-repeat, repeat;
    background-size: 100% 100%, 64px 64px;
    background-position: center top, center top;
    background-attachment: fixed, fixed;
}

/* ---- Décalage sous le header fixe (logo h-70px → h-100px, offset top-4/6/10) ---- */
.doc-main {
    padding-top: 130px;
}
@media (min-width: 768px) {
    .doc-main {
        padding-top: 150px;
    }
}
@media (min-width: 1280px) {
    .doc-main {
        padding-top: 180px;
    }
}

/* ---- En-tête de page ---- */
.doc-header__title {
    color: #0f172a;
}
.doc-header__title .accent {
    color: var(--primary-color, #e1000f);
}
.doc-header__desc {
    max-width: 760px;
    color: rgba(15, 23, 42, 0.7);
    line-height: 1.7;
}
.doc-separator {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.04));
}

/* ---- Barre de recherche + compteur ---- */
.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.doc-search {
    position: relative;
    flex: 1 1 320px;
    max-width: 520px;
}
.doc-search__icon {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    color: rgba(15, 23, 42, 0.4);
    pointer-events: none;
}
.doc-search__input {
    width: 100%;
    padding: 12px 18px 12px 46px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 9999px;
    background: #fff;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.doc-search__input:focus {
    outline: none;
    border-color: var(--accent-color, #000091);
    box-shadow: 0 0 0 3px rgba(0, 0, 145, 0.1);
}
.doc-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    background: rgba(0, 0, 145, 0.06);
    color: var(--accent-color, #000091);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.doc-count i {
    font-size: 13px;
}

/* ---- Chips de filtre par catégorie ---- */
.doc-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: #fff;
    color: rgba(15, 23, 42, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.doc-chip:hover {
    border-color: var(--primary-color, #e1000f);
    color: var(--primary-color, #e1000f);
}
.doc-chip.is-active {
    background: var(--primary-color, #e1000f);
    border-color: var(--primary-color, #e1000f);
    color: #fff;
}
.doc-chip__count {
    font-size: 12px;
    opacity: 0.75;
}

/* ---- Section catégorie ---- */
.doc-category {
    margin-top: 8px;
}
.doc-category__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.doc-category__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 0, 145, 0.07);
    color: var(--accent-color, #000091);
    font-size: 18px;
    flex-shrink: 0;
}
.doc-category__title {
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #0f172a;
    white-space: nowrap;
}
.doc-category__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0));
}

/* ---- Liste + carte document (3 colonnes) ---- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.doc-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.08);
}

/* Colonne 1 : icône type de fichier */
.doc-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 26px;
    flex-shrink: 0;
}

/* Colonne 2 : titre + badges + description */
.doc-card__body {
    min-width: 0;
}
.doc-card__title {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.35;
}
.doc-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}
.doc-badge--ext {
    background: var(--primary-color, #e1000f);
    color: #fff;
}
.doc-badge--size {
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.65);
}
.doc-card__desc {
    font-size: 13px;
    color: rgba(15, 23, 42, 0.6);
    line-height: 1.5;
    margin: 0;
}

/* Colonne 3 : bouton télécharger */
.doc-card__action {
    flex-shrink: 0;
}
.doc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    border-radius: 9999px;
    border: 1.5px solid var(--primary-color, #e1000f);
    background: #fff;
    color: var(--primary-color, #e1000f);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.doc-download-btn:hover {
    background: var(--primary-color, #e1000f);
    color: #fff;
    transform: translateY(-1px);
}
.doc-download-btn i {
    font-size: 14px;
}

/* ---- État « aucun résultat » ---- */
.doc-empty {
    text-align: center;
    padding: 56px 20px;
    color: rgba(15, 23, 42, 0.55);
}
.doc-empty i {
    display: block;
    font-size: 40px;
    color: rgba(15, 23, 42, 0.25);
    margin: 0 auto 14px;
}
.doc-empty p {
    margin: 0;
    font-size: 16px;
}

/* Masquage utilitaire piloté par le JS de filtre */
.doc-hidden {
    display: none !important;
}

/* ---- Bouton « Recevoir par e-mail » (variante accent bleu) ---- */
.doc-email-btn {
    border-color: var(--accent-color, #000091);
    color: var(--accent-color, #000091);
    cursor: pointer;
}
.doc-email-btn:hover {
    background: var(--accent-color, #000091);
    color: #fff;
}

/* =====================================================================
   Modale « Recevoir par e-mail »
   ===================================================================== */
.doc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.doc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.doc-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
}
.doc-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}
.doc-modal-close:hover {
    background: rgba(225, 0, 15, 0.12);
    color: var(--primary-color, #e1000f);
}
.doc-modal-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    max-height: 90vh;
}

/* Colonne gauche : formulaire */
.doc-modal-left {
    padding: 32px 30px;
    overflow-y: auto;
}
.doc-modal-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #0f172a;
    margin: 0 0 8px;
}
.doc-modal-sub {
    font-size: 14px;
    color: rgba(15, 23, 42, 0.65);
    line-height: 1.55;
    margin: 0 0 22px;
}
.doc-modal-field {
    margin-bottom: 16px;
}
.doc-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}
.doc-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.doc-modal-input:focus {
    outline: none;
    border-color: var(--accent-color, #000091);
    box-shadow: 0 0 0 3px rgba(0, 0, 145, 0.1);
}
.doc-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12.5px;
    color: rgba(15, 23, 42, 0.7);
    line-height: 1.5;
    margin-bottom: 20px;
    cursor: pointer;
}
.doc-consent input {
    margin-top: 2px;
    flex-shrink: 0;
}
.doc-consent a {
    color: var(--accent-color, #000091);
    text-decoration: underline;
}
.doc-modal-submit {
    width: 100%;
    justify-content: center;
    border-color: var(--primary-color, #e1000f);
    background: var(--primary-color, #e1000f);
    color: #fff;
}
.doc-modal-submit:hover {
    opacity: 0.92;
    background: var(--primary-color, #e1000f);
    color: #fff;
}
.doc-modal-submit.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}
.doc-modal-feedback {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.5;
}
.doc-modal-feedback--ok {
    background: #e7f6ec;
    color: #176c3a;
}
.doc-modal-feedback--err {
    background: #fdecec;
    color: #b3261e;
}
.doc-modal-legal {
    margin: 14px 0 0;
    font-size: 11px;
    color: rgba(15, 23, 42, 0.45);
    line-height: 1.5;
}

/* Honeypot : invisible aux humains, présent pour les bots */
.doc-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Colonne droite : checklist */
.doc-modal-right {
    background: rgba(0, 0, 145, 0.035);
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    padding: 32px 22px;
    overflow-y: auto;
}
.doc-modal-right-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--accent-color, #000091);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}
.doc-modal-right-sub {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.6);
    margin: 0 0 16px;
    line-height: 1.5;
}
.doc-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.doc-modal-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-modal-check:hover {
    border-color: var(--accent-color, #000091);
}
.doc-modal-check input {
    margin-top: 3px;
    flex-shrink: 0;
}
.doc-modal-check-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.doc-modal-check-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}
.doc-modal-check-cat {
    font-size: 11px;
    color: rgba(15, 23, 42, 0.5);
    margin-top: 2px;
}

@media (max-width: 720px) {
    .doc-modal-grid {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .doc-modal-right {
        border-left: 0;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
    }
    .doc-modal-left,
    .doc-modal-right {
        overflow-y: visible;
    }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .doc-card {
        grid-template-columns: auto 1fr;
        gap: 14px 16px;
    }
    .doc-card__action {
        grid-column: 1 / -1;
    }
    .doc-download-btn {
        width: 100%;
        justify-content: center;
    }
    .doc-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .doc-search {
        flex: 0 0 auto;
        max-width: none;
    }
    .doc-count {
        align-self: flex-start;
    }
}
