/* ============================================================
   Modal — Aviso de Privacidad
   Agregar al final de diagnostico.css (o en un <style> en el <head>)
   ============================================================ */

/* ── OVERLAY ─────────────────────────────────────────────── */
.privacy-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.privacy-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── MODAL ───────────────────────────────────────────────── */
.privacy-modal {
    background: var(--white);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 700px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
.privacy-modal-overlay.open .privacy-modal {
    transform: translateY(0) scale(1);
}

/* ── HEADER STICKY ───────────────────────────────────────── */
.privacy-modal__header {
    background: var(--black);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(177, 201, 3, 0.2);
    position: relative;
}
.privacy-modal__header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--lime);
    border-radius: 0 2px 2px 0;
}
.privacy-modal__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.privacy-modal__title .pm-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(177, 201, 3, 0.12);
    border: 1px solid rgba(177, 201, 3, 0.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.privacy-modal__title .pm-icon svg {
    width: 18px; height: 18px;
    color: var(--lime);
}
.privacy-modal__title h3 {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}
.privacy-modal__title span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    display: block;
    margin-top: 0.1rem;
    font-family: var(--font-body);
    font-weight: 400;
}

.privacy-modal__close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    color: rgba(255, 255, 255, 0.6);
}
.privacy-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
}
.privacy-modal__close svg {
    width: 16px; height: 16px;
}

/* ── PROGRESS DE LECTURA ─────────────────────────────────── */
.privacy-modal__read-progress {
    height: 3px;
    background: rgba(177, 201, 3, 0.15);
    flex-shrink: 0;
}
.privacy-modal__read-bar {
    height: 100%;
    background: var(--lime);
    width: 0%;
    transition: width 0.1s linear;
}

/* ── BODY SCROLLABLE ─────────────────────────────────────── */
.privacy-modal__body {
    overflow-y: auto;
    flex: 1;
    padding: 2rem 1.75rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar personalizada */
.privacy-modal__body::-webkit-scrollbar { width: 6px; }
.privacy-modal__body::-webkit-scrollbar-track { background: var(--gray-100); }
.privacy-modal__body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 9999px; }
.privacy-modal__body::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Fecha de actualización */
.pm-update-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(177, 201, 3, 0.07);
    border: 1px solid rgba(177, 201, 3, 0.2);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.pm-update-badge svg {
    width: 16px; height: 16px;
    color: var(--lime-dark);
    flex-shrink: 0;
}
.pm-update-badge strong { color: var(--gray-700); }

/* Secciones del aviso */
.pm-section {
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
}
.pm-section__header {
    background: var(--gray-50);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}
.pm-section__num {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--lime);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head);
    font-size: 0.72rem; font-weight: 800;
    color: var(--black);
    flex-shrink: 0;
}
.pm-section__title {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--black);
}
.pm-section__body {
    padding: 1.1rem 1.25rem;
}
.pm-section__body p {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.75;
    margin-bottom: 0.6rem;
}
.pm-section__body p:last-child { margin-bottom: 0; }
.pm-section__body ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.pm-section__body ul li {
    font-size: 0.875rem;
    color: var(--gray-700);
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.65;
}
.pm-section__body ul li::before {
    content: '';
    position: absolute; left: 0; top: 0.6em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--lime-dark);
}
.pm-highlight {
    background: rgba(177, 201, 3, 0.07);
    border-left: 3px solid var(--lime);
    border-radius: 0 0.4rem 0.4rem 0;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--gray-700);
    line-height: 1.7;
}
.pm-highlight a {
    color: var(--lime-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Fundamento legal */
.pm-fundamento {
    background: var(--black);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(177, 201, 3, 0.15);
}
.pm-fundamento h4 {
    font-family: var(--font-head);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
}
.pm-fundamento p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.75;
}
.pm-fundamento strong { color: rgba(255, 255, 255, 0.7); }

/* Contacto */
.pm-contact {
    background: var(--black);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(177, 201, 3, 0.15);
}
.pm-contact h4 {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--lime);
    margin-bottom: 0.5rem;
}
.pm-contact p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
    margin-bottom: 0.25rem;
}
.pm-contact a {
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pm-contact a:hover { color: var(--lime); }

/* ── FOOTER STICKY ───────────────────────────────────────── */
.privacy-modal__footer {
    padding: 1.25rem 1.75rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}
.pm-footer-note {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.5;
    max-width: 280px;
}
.pm-footer-note strong {
    color: var(--gray-700);
    font-family: var(--font-head);
}
.pm-btn-accept {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--lime);
    color: var(--black);
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.8rem 1.75rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.pm-btn-accept:hover {
    background: var(--lime-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(177, 201, 3, 0.3);
}
.pm-btn-accept svg {
    width: 16px; height: 16px;
}
.pm-btn-close-only {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--gray-500);
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.8rem 1.25rem;
    border-radius: 9999px;
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.pm-btn-close-only:hover {
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .privacy-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .privacy-modal {
        max-height: 92vh;
        border-radius: 1.25rem 1.25rem 0 0;
        transform: translateY(100%);
    }
    .privacy-modal-overlay.open .privacy-modal {
        transform: translateY(0);
    }
    .privacy-modal__body {
        padding: 1.25rem 1.1rem;
    }
    .privacy-modal__header {
        padding: 1rem 1.25rem;
    }
    .privacy-modal__footer {
        flex-direction: column-reverse;
        padding: 1rem 1.25rem;
        gap: 0.65rem;
    }
    .pm-btn-accept,
    .pm-btn-close-only {
        width: 100%;
        justify-content: center;
    }
    .pm-footer-note {
        max-width: 100%;
        text-align: center;
    }
}



.consent-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--lime);
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 1px solid rgba(177, 201, 3, 0.35);
    padding-bottom: 1px;
    transition: color 0.2s;
    line-height: inherit;
}
.consent-link-btn:hover { color: var(--lime-light); }

