/* =====================================================
   legal.css - Paginas legales + cookie consent banner
   ===================================================== */

/* ============== Layout de pagina legal ============== */
.legal-shell {
    max-width: 860px;
    margin: 2rem auto 4rem;
    padding: 0 1.25rem;
    color: #1f2937;
    font-size: .95rem;
    line-height: 1.65;
}
.legal-shell h1 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
}
.legal-shell .legal-update {
    color: #64748b;
    font-size: .82rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.legal-shell h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2.25rem;
    margin-bottom: .75rem;
}
.legal-shell h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}
.legal-shell p { margin-bottom: 1rem; }
.legal-shell ul,
.legal-shell ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.legal-shell li { margin-bottom: .35rem; }
.legal-shell a { color: #2563eb; text-decoration: underline; }
.legal-shell a:hover { color: #1d4ed8; }
/* Excepcion: si el link es un boton, dejar que herede los estilos de Bootstrap */
.legal-shell a.btn,
.legal-shell a.btn:hover { color: #fff; text-decoration: none; }
.legal-shell a.btn-outline-secondary,
.legal-shell a.btn-outline-secondary:hover { color: #6c757d; }
.legal-shell strong { color: #0f172a; }
.legal-shell .legal-callout {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border-left: 4px solid #6366f1;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: .9rem;
}
.legal-shell .legal-toc {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}
.legal-shell .legal-toc h3 {
    margin-top: 0;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 700;
}
.legal-shell .legal-toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
@media (max-width: 575.98px) { .legal-shell .legal-toc ul { columns: 1; } }
.legal-shell .legal-toc li { margin-bottom: .25rem; }
.legal-shell .legal-toc a { font-size: .88rem; }
.legal-shell address {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    font-style: normal;
    margin: 1rem 0;
    line-height: 1.6;
}

/* ============== Cookie banner (sticky bottom) ============== */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1080;
    padding: 1rem 1.25rem;
    background: rgba(15,23,42,.97);
    backdrop-filter: blur(10px);
    color: #f1f5f9;
    box-shadow: 0 -10px 30px rgba(0,0,0,.30);
    transform: translateY(110%);
    transition: transform .45s cubic-bezier(.22,.68,0,1.2);
    display: none;
}
.cookie-banner.is-visible {
    display: block;
    transform: translateY(0);
}
.cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}
.cookie-banner__text {
    flex: 1 1 320px;
    min-width: 0;
    font-size: .87rem;
    line-height: 1.5;
}
.cookie-banner__text strong { color: #fff; }
.cookie-banner__text a { color: #93c5fd; text-decoration: underline; }
.cookie-banner__text a:hover { color: #bfdbfe; }
.cookie-banner__actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.cookie-banner__btn {
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: 0;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.cookie-banner__btn--accept {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 14px rgba(124,58,237,.40);
}
.cookie-banner__btn--accept:hover { transform: translateY(-1px); filter: brightness(1.05); }
.cookie-banner__btn--reject {
    background: rgba(255,255,255,.08);
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,.20);
}
.cookie-banner__btn--reject:hover { background: rgba(255,255,255,.15); }
.cookie-banner__btn--config {
    background: transparent;
    color: #cbd5e1;
    text-decoration: underline;
    padding: .55rem .5rem;
}
.cookie-banner__btn--config:hover { color: #fff; }

@media (max-width: 575.98px) {
    .cookie-banner { padding: .85rem 1rem; }
    .cookie-banner__actions { width: 100%; justify-content: stretch; }
    .cookie-banner__btn { flex: 1; }
    .cookie-banner__btn--config { flex: 0; width: 100%; text-align: center; }
}

/* ============== Modal de configuracion de cookies ============== */
.cookie-prefs__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.cookie-prefs__row:last-child { border-bottom: 0; }
.cookie-prefs__info { flex: 1; }
.cookie-prefs__info strong { display: block; color: #0f172a; margin-bottom: .25rem; }
.cookie-prefs__info p { margin: 0; font-size: .82rem; color: #64748b; line-height: 1.4; }
.cookie-prefs__switch {
    flex-shrink: 0;
    position: relative;
    width: 44px; height: 24px;
}
.cookie-prefs__switch input { opacity: 0; width: 0; height: 0; }
.cookie-prefs__switch span {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease;
}
.cookie-prefs__switch span::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,.20);
}
.cookie-prefs__switch input:checked + span { background: #2563eb; }
.cookie-prefs__switch input:checked + span::before { transform: translateX(20px); }
.cookie-prefs__switch input:disabled + span { background: #94a3b8; opacity: .65; cursor: not-allowed; }

/* ============== Footer legal ============== */
/* z-index: garantiza que se vea por encima del mesh gradient del dashboard.
   background opaco: cubre cualquier capa de fondo animado por debajo. */
body > footer {
    position: relative;
    z-index: 5;
    background: #fff;
}
.legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    justify-content: center;
    margin-top: .5rem;
    font-size: .8rem;
}
.legal-footer-links a {
    color: #6b7280;
    text-decoration: none;
}
.legal-footer-links a:hover { color: #2563eb; text-decoration: underline; }
.legal-footer-links span { color: #d1d5db; }

/* Cuando el banner de cookies esta visible, dejamos espacio inferior en el body
   para que no tape el footer ni el contenido inferior. JS aplica/quita la clase. */
body.has-cookie-banner { padding-bottom: 140px; }
@media (max-width: 575.98px) {
    body.has-cookie-banner { padding-bottom: 200px; }
}
