/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    /* Modo Claro (default) */
    --bg-page: #f6f4ef;
    --bg-card: #ffffff;
    --bg-card-alt: #f0ede7;
    --text-main: #111111;
    --text-muted: #555555;
    --border-color: rgba(0, 0, 0, 0.05);
    --header-bg: rgba(246, 244, 239, 0.88);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --accent-terracotta: #bd593f;
    --accent-ocre: #e4be6c;
    --max-width: 1300px;
    --header-h: 80px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- MODO OSCURO: Azul Judicial --- */
[data-theme="dark"] {
    --bg-page:            #0a0d1a;   /* Azul medianoche profundo */
    --bg-card:            #111629;   /* Azul oscuro suave para tarjetas */
    --bg-card-alt:        #161c35;   /* Variante ligeramente más clara */
    --text-main:          #dde3f0;   /* Blanco frío, fácil de leer */
    --text-muted:         #7a88aa;   /* Gris azulado para secundarios */
    --border-color:       rgba(100, 130, 200, 0.1); /* Borde azulado sutil */
    --header-bg:          rgba(10, 13, 26, 0.92);
    --shadow-color:       rgba(0, 0, 40, 0.5);
    --accent-terracotta:  #d4694d;   /* Terracotta más vibrante sobre azul */
    --accent-ocre:        #c9a84c;   /* Dorado legal/institucional */
}

/* Transición suave global al cambiar tema */
*, *::before, *::after {
    transition:
        background-color 0.4s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* (Excluir transiciones en animaciones de scroll/GSAP para que no interfieran) */
.parallax-img, .hero-image {
    transition: none !important;
}
.abstract-shape {
    transition: background-color 0.4s ease !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scroll nativo */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-page);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Wrapper común */
.max-width-wrapper {
    width: 92%; /* Uso de porcentajes para hacerlo verdaderamente responsivo */
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ==========================================================================
   2. NAVBAR
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    background-color: rgba(246, 244, 239, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    height: var(--header-h);
}

.main-header.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-h);
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
}

/* --- LOGOS --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 35px;
    flex-shrink: 0;
    text-decoration: none; /* Quita subrayado del enlace */
}

.puce-logo {
    height: 130px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.puce-logo:hover {
    transform: scale(1.05);
}

/* Línea divisoria elegante entre los dos logos */
.logo-container::after {
    content: '';
    display: none;
}

.logo-divider {
    width: 1.5px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--accent-terracotta), transparent);
    flex-shrink: 0;
    opacity: 0.5;
}

.veredict-logo {
    height: 110px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.veredict-logo:hover {
    transform: scale(1.05);
}

/* --- NAV --- */
.main-nav {
    flex: 1;
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0 auto; /* Centra los títulos */
}

/* --- BOTONES AUTH + HERRAMIENTAS (derecha) --- */
.nav-auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
    margin-right: 15px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.65;
    position: relative;
    padding-bottom: 4px;
    transition: opacity 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-terracotta);
    transition: width 0.3s var(--ease-out-expo);
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-primary {
    background-color: var(--text-main);
    color: #ffffff;
    text-decoration: none;
    padding: 11px 26px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 50px;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--accent-terracotta);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid var(--text-main);
    text-decoration: none;
    padding: 11px 28px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: var(--text-main);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Hamburguesa (solo móvil) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-h);
    overflow: hidden;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 40px;
    width: 100%;
}

.badge-container {
    margin-bottom: 20px;
}

.badge-pill {
    background-color: rgba(189, 89, 63, 0.1);
    color: var(--accent-terracotta);
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 20px;
    display: inline-block;
}

.main-title {
    font-size: clamp(2.2rem, 5vw + 1rem, 3.8rem); /* Tipografía fluida basada en porcentajes del ancho de pantalla */
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 25px;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Zona visual derecha */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
}

.hero-img-parallax-wrap {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-image {
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.12));
    will-change: transform;
}

.abstract-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.35;
    z-index: 1;
    will-change: transform;
}

.shape-one {
    background-color: var(--accent-terracotta);
    width: 360px;
    height: 360px;
    top: 8%;
    left: 8%;
}

.shape-two {
    background-color: var(--accent-ocre);
    width: 260px;
    height: 260px;
    bottom: 8%;
    right: 8%;
}

/* ==========================================================================
   4. SECCIÓN: SOBRE EL SITIO
   ========================================================================== */
.info-section {
    padding: 110px 0;
    background-color: var(--bg-card);
    border-top: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.info-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

/* Contenedor con overflow:hidden para el parallax */
.img-parallax-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.12);
    aspect-ratio: 4/3;
}

.section-img {
    width: 100%;
    height: 110%;         /* Sobredimensionada para el efecto parallax */
    object-fit: cover;
    object-position: center;
    display: block;
    will-change: transform;
    transition: transform 0.1s linear;
}

.info-text h2 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
    line-height: 1.2;
}

.info-text .badge-pill {
    margin-bottom: 16px;
}

.info-text p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.info-text .btn-secondary {
    margin-top: 10px;
}

/* ==========================================================================
   5. SECCIÓN: COGEP
   ========================================================================== */
.cogep-section {
    padding: 110px 0;
    background-color: var(--bg-page);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

/* --- NUEVO LOGO COGEP DIMENSIONADO --- */
.cogep-logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    padding: 0;
}

.cogep-logo-large {
    position: relative;
    width: 130px; /* Tamaño mediano y proporcionado */
    height: auto;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.08));
    transition: transform 0.4s var(--ease-out-expo);
    display: block;
    margin: 0 auto;
}

.cogep-logo-wrapper:hover .cogep-logo-large {
    transform: scale(1.05) translateY(-3px);
}

/* Brillo detrás del logo para darle vida */
.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: radial-gradient(circle, var(--accent-ocre) 0%, transparent 70%);
    opacity: 0.15;
    z-index: 1;
    filter: blur(20px);
    border-radius: 50%;
    animation: pulseGlow 4s infinite alternate;
}

[data-theme="dark"] .logo-glow {
    opacity: 0.25;
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.1; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.2; }
}

.section-header h2 {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--accent-terracotta);
    font-weight: 600;
    margin-top: 8px;
}

.cogep-intro-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 16px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.cogep-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-bottom: 70px;
}

.cogep-card {
    background-color: var(--bg-card);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s;
    animation-delay: var(--delay, 0s);
    flex: 0 1 calc((100% - 56px) / 3);
    min-width: 260px;
}

.cogep-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.cogep-card .card-icon {
    font-size: 2rem;
    margin-bottom: 18px;
    display: block;
}

.cogep-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.cogep-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Banner con imagen del abogado */
.cogep-banner {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    height: 360px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.15);
}

.cogep-banner-img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.cogep-banner-img {
    width: 100%;
    height: 120%;          /* Sobredimensionada para parallax */
    object-fit: cover;
    object-position: center 30%;
    display: block;
    will-change: transform;
}

.cogep-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(17, 17, 17, 0.8) 30%,
        rgba(17, 17, 17, 0.2) 100%
    );
}

.cogep-banner-text {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 60px;
    max-width: 650px;
}

.cogep-banner-text blockquote {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.45;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent-terracotta);
    padding-left: 20px;
}

.cogep-banner-text cite {
    font-size: 0.95rem;
    color: var(--accent-ocre);
    font-style: normal;
    font-weight: 500;
    padding-left: 24px;
}

/* ==========================================================================
   6. SECCIÓN: ACCESO / REGISTRO
   ========================================================================== */
.access-section {
    background: linear-gradient(135deg, var(--accent-terracotta) 0%, #8a2e1a 100%);
    padding: 110px 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: center;
}

.access-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.access-content > p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 40px;
}

.access-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.access-actions .btn-primary {
    background-color: #fff;
    color: var(--accent-terracotta);
}

.access-actions .btn-primary:hover {
    background-color: var(--bg-page);
    transform: translateY(-3px);
}

.access-actions .btn-secondary {
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}

.access-actions .btn-secondary:hover {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
    border-color: #fff;
    transform: translateY(-3px);
}

/* ==========================================================================
   7. ANIMACIONES DE SCROLL — REVEAL ON SCROLL
   ========================================================================== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition:
        opacity 0.9s var(--ease-out-expo),
        transform 0.9s var(--ease-out-expo);
}

.reveal-up {
    transform: translateY(60px);
}

.reveal-left {
    transform: translateX(-60px);
}

.reveal-right {
    transform: translateX(60px);
}

.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
    opacity: 1;
    transform: translate(0);
}

/* Stagger delay en cards COGEP */
.cogep-card.is-visible {
    transition-delay: var(--delay, 0s);
}

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 80px 24px 60px;
        text-align: center;
    }
    .hero-subtitle { margin: 0 auto 35px; }
    .hero-actions { justify-content: center; }
    .hero-visual { height: 340px; }
    .info-wrapper {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .cogep-card { flex: 0 1 calc((100% - 28px) / 2); }
    .cogep-banner-text blockquote { font-size: 1.2rem; }
    .cogep-banner-text { padding: 36px; }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: var(--header-h);
        right: -100%;
        flex-direction: column;
        background: var(--bg-card);
        width: 280px;
        height: calc(100vh - var(--header-h));
        padding: 40px 30px;
        gap: 20px;
        align-items: flex-start;
        box-shadow: -10px 0 40px rgba(0,0,0,0.1);
        transition: right 0.4s var(--ease-out-expo);
    }
    .main-nav.open { right: 0; }
    .main-nav ul { flex-direction: column; gap: 24px; width: 100%; }
    .nav-auth-buttons {
        flex-direction: column;
        margin-left: 0;
        width: 100%;
        gap: 15px;
        margin-top: 10px;
    }
    .nav-auth-buttons .nav-btn {
        width: 100%;
        text-align: center;
    }
    .nav-link { font-size: 1.1rem; }
    .nav-toggle { display: flex; }
    
    /* Escalar logos para iPad / Tablets pequeñas */
    .puce-logo { height: 80px; }
    .veredict-logo { height: 65px; }
    .logo-container { gap: 15px; }
    .logo-divider { height: 35px; }

    .header-wrapper { padding: 0 24px; }
    .max-width-wrapper { padding: 0 24px; }
    .info-section, .cogep-section, .access-section { padding: 70px 0; }
    .cogep-banner { height: auto; min-height: 300px; }
    .cogep-banner-text { max-width: 100%; padding: 32px 24px; }
    .cogep-banner-text blockquote { font-size: 1.05rem; }
    .cogep-card { flex: 0 1 100%; }
    .access-content h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
    .hero-visual { height: 260px; }
    
    /* Escalar logos para celulares (iPhone, etc.) */
    .puce-logo { height: 50px; }
    .veredict-logo { height: 40px; }
    .logo-container { gap: 10px; }
    .logo-divider { height: 25px; }
}

/* ==========================================================================
   9. RESPETA PREFERENCIA DE MOVIMIENTO REDUCIDO
   ========================================================================== */
/* ==========================================================================
   11. PAGE LOADER ⏳
   ========================================================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-page);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease; /* Para respetar el tema si cambia */
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.loader-logo {
    width: 280px; /* Tamaño generoso */
    height: auto;
    margin-bottom: 50px;
    object-fit: contain;
}

.loader-scales {
    width: 100px; /* Tamaño grande para que no se vea pequeño */
    height: 100px;
    margin-bottom: 40px;
    color: var(--accent-terracotta);
}

.loader-scales-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Animación de oscilación de la balanza */
.loader-arm {
    transform-origin: 32px 20px;
    transform: rotate(-15deg); /* Coincide con el 0% de la animación para evitar el salto brusco inicial */
    animation: loaderOscillate 2.2s infinite ease-in-out;
}

@keyframes loaderOscillate {
    0% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    100% { transform: rotate(-15deg); }
}

.loader-progress {
    width: 250px;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.loader-progress-bar {
    position: absolute;
    top: 0;
    left: -30%; /* Coincide con el 0% de la animación */
    height: 100%;
    width: 30%;
    background-color: var(--accent-ocre);
    border-radius: 3px;
    animation: loaderProgress 2.2s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes loaderProgress {
    0% { left: -30%; width: 30%; }
    50% { left: 100%; width: 30%; }
    100% { left: -30%; width: 30%; }
}

.loader-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Clase para esconder el loader cuando termine */
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal-up, .reveal-left, .reveal-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .parallax-img { transform: none !important; }
}

/* ==========================================================================
   10. TOGGLE BALANZA DE LA JUSTICIA ⚖️
   ========================================================================== */
.theme-toggle {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    outline: none;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: rgba(189, 89, 63, 0.1);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 3px;
}

.scales-svg {
    width: 44px;
    height: 44px;
    overflow: visible;
}

/* Colores de la balanza según tema */
.scales-svg .scales-top,
.scales-svg .scales-pole,
.scales-svg .scales-base,
.scales-svg .scales-foot,
.scales-svg .scales-bar {
    fill: var(--text-main);
    transition: fill 0.3s;
}

.scales-svg .scales-string-l,
.scales-svg .scales-string-r {
    stroke: var(--text-muted);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s;
}

.scales-svg .scales-pan-l,
.scales-svg .scales-pan-r {
    fill: var(--text-main);
    transition: fill 0.3s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Iconos sol/luna dentro de los platos */
.scales-svg .scales-icon-l,
.scales-svg .scales-icon-r {
    font-family: sans-serif;
    fill: var(--accent-terracotta);
    opacity: 0.85;
    transition: fill 0.3s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
    transform-origin: center;
}

/* --- MODO CLARO: plato sol (izq) abaja, luna (der) sube --- */
.theme-toggle .scales-bar {
    transform-origin: center;
    transform-box: fill-box;
    animation: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Barra inclinada en modo claro (sol pesa más) */
:root .theme-toggle .scales-bar,
[data-theme="light"] .theme-toggle .scales-bar {
    transform-origin: 32px 14.25px;
    transform: rotate(-10deg);
}

/* Platos modo claro */
:root .scales-svg .scales-pan-l,
[data-theme="light"] .scales-svg .scales-pan-l {
    transform: translateY(5px);
}
:root .scales-svg .scales-icon-l,
[data-theme="light"] .scales-svg .scales-icon-l {
    transform: translateY(5px);
}
:root .scales-svg .scales-pan-r,
[data-theme="light"] .scales-svg .scales-pan-r {
    transform: translateY(-5px);
}
:root .scales-svg .scales-icon-r,
[data-theme="light"] .scales-svg .scales-icon-r {
    transform: translateY(-5px);
    opacity: 0.35;
}

/* Barra inclinada en modo oscuro (luna pesa más) */
[data-theme="dark"] .theme-toggle .scales-bar {
    transform-origin: 32px 14.25px;
    transform: rotate(10deg);
}

/* Platos modo oscuro */
[data-theme="dark"] .scales-svg .scales-pan-r {
    transform: translateY(5px);
}
[data-theme="dark"] .scales-svg .scales-icon-r {
    transform: translateY(5px);
    opacity: 0.9;
}
[data-theme="dark"] .scales-svg .scales-pan-l {
    transform: translateY(-5px);
}
[data-theme="dark"] .scales-svg .scales-icon-l {
    transform: translateY(-5px);
    opacity: 0.35;
}

/* Tooltip del toggle */
.toggle-tooltip {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--bg-card);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, bottom 0.25s ease;
}

.theme-toggle:hover .toggle-tooltip {
    opacity: 1;
    bottom: -36px;
}

/* === ADAPATCIONES DARK MODE para secciones === */
[data-theme="dark"] .main-header {
    background-color: var(--header-bg);
    border-bottom-color: var(--border-color);
}



[data-theme="dark"] .abstract-shape.shape-one {
    background-color: #7a2d1a;
    opacity: 0.5;
}

[data-theme="dark"] .abstract-shape.shape-two {
    background-color: #6b5200;
    opacity: 0.4;
}

[data-theme="dark"] .badge-pill {
    background-color: rgba(217, 111, 82, 0.2);
}

[data-theme="dark"] .btn-secondary {
    border-color: var(--text-main);
    color: var(--text-main);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: var(--text-main);
    color: var(--bg-page);
}

[data-theme="dark"] .btn-primary {
    background-color: var(--accent-terracotta);
    color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
    background-color: #b85a40;
}

[data-theme="dark"] .access-actions .btn-primary {
    color: #ffffff;
}

[data-theme="dark"] .cogep-card {
    border-color: var(--border-color);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

[data-theme="dark"] .cogep-card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

[data-theme="dark"] .img-parallax-container {
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

[data-theme="dark"] .cogep-banner-overlay {
    background: linear-gradient(
        to right,
        rgba(10, 10, 15, 0.9) 30%,
        rgba(10, 10, 15, 0.3) 100%
    );
}

[data-theme="dark"] .access-section {
    background: linear-gradient(135deg, #7a2d1a 0%, #3a1208 100%);
}

[data-theme="dark"] .nav-toggle span {
    background: var(--text-main);
}

/* Cambiar logos del navbar a su versión blanca en modo oscuro */
[data-theme="dark"] .puce-logo {
    content: url('../Images/logoPUCE-blanco.png');
}

[data-theme="dark"] .veredict-logo {
    content: url('../Images/veredict-logo-white.png');
}

/* ==========================================================================
   8. FOOTER & TRANSITIONS
   ========================================================================== */

/* Ola divisoria creativa entre la sección anterior y el footer */
.footer-wave-divider {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: translateY(1px); /* Previene líneas blancas en algunos navegadores */
    margin-top: -1px; /* Para conectar perfectamente con la sección de arriba */
}

.footer-wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.footer-wave-divider .shape-fill {
    fill: #1a1a1a; /* Mismo color base del footer */
}

/* Ajustes para modo oscuro en el divisor */
[data-theme="dark"] .footer-wave-divider .shape-fill {
    fill: #05070d;
}

.main-footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding-top: 40px;
    margin-top: 0; /* Quitamos el espacio indeseado */
}

.footer-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding-bottom: 50px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

/* Logos en Footer */
.footer-logos {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.footer-logo-puce {
    height: 100px; /* Más grande, como solicitado */
    width: auto;
    object-fit: contain;
}

.footer-logo-divider {
    width: 1.5px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.4), transparent);
}

.footer-logo-veredict {
    height: 75px; /* Más grande, proporcionado con el PUCE */
    width: auto;
    object-fit: contain;
}

.footer-tagline {
    font-size: 0.9rem;
    color: #a0a0a0;
    line-height: 1.6;
    max-width: 300px;
}

/* Títulos y listas */
.footer-heading {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #ffffff;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-terracotta);
}

.footer-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #b0b0b0;
}

.footer-list a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-list a:hover {
    color: var(--accent-ocre);
}

.footer-list svg {
    color: var(--accent-terracotta);
    flex-shrink: 0;
}

/* Redes sociales */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.05);
    color: #ffffff;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--accent-terracotta);
    transform: translateY(-3px);
}

/* Footer Bottom (Copyright y legal) */
.footer-bottom {
    background-color: #111111;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #777777;
}

.footer-legal-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-legal-links a {
    color: #777777;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal-links a:hover {
    color: #ffffff;
}

.legal-sep {
    color: #444;
}

/* Modo oscuro ajustes */
[data-theme="dark"] .main-footer {
    background-color: #05070d; /* Un azul mucho más oscuro para integrar con el body */
}
[data-theme="dark"] .footer-bottom {
    background-color: #030408;
    border-top-color: rgba(100, 130, 200, 0.05);
}

/* Responsividad extra para footer */
@media (max-width: 768px) {
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
}