/* Optimización de login.css - Versión mejorada con dark mode y sticky footer */

/* ========== VARIABLES CSS ========== */
:root {
    /* Colores Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #0047BA;
    --text-secondary: #666666;
    --text-body: #333333;
    --border-primary: #DFEBFF;
    --border-secondary: #5D9BFF;
    --button-primary: #5D9BFF;
    --button-hover: #0047BA;
    --card-bg: #ffffff;
    --shadow: 0px 4px 8px 3px rgba(152, 152, 154, 0.30);
    --input-bg: #ffffff;
    --link-color: #0056b3;
    --footer-border: #f0f0f0;
    
    /* Colores de los círculos */
    --circle-blue: #32509B;
    --circle-green: #8CB63C;
    --circle-red: #C4104C;
    --circle-gray: #969697;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0b0e14;
    --bg-secondary: #0f131b;
    --text-primary: #8fb9ff;
    --text-secondary: #a8b3c5;
    --text-body: #e6eaf2;
    --border-primary: #273043;
    --border-secondary: #4a7dcc;
    --button-primary: #5D9BFF;
    --button-hover: #8fb9ff;
    --card-bg: #141823;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.60);
    --input-bg: #1a1f2e;
    --link-color: #8fb9ff;
    --footer-border: #273043;
    
    /* Colores de los círculos más sutiles en dark */
    --circle-blue: #1a3a6e;
    --circle-green: #2a5500;
    --circle-red: #6e0021;
    --circle-gray: #333333;
}

/* ========== ESTILOS BASE ========== */
html {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-body);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: var(--bg-primary);
    pointer-events: none;
    transition: background-color 0.3s ease;
}

/* Círculos con transición suave */
.circle {
    position: absolute;
    border-radius: 50%;
    /* opacity: 0.4; */
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] .circle {
    /* opacity: 0.2; */
}

.blue { 
    background: var(--circle-blue); 
    width: 120px; 
    height: 120px; 
    top: 10%; 
    left: -2%; 
}
.green { 
    background: var(--circle-green); 
    width: 100px; 
    height: 100px; 
    bottom: 15%; 
    right: 5%; 
}
.red {
    background: var(--circle-red);
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 48%;
    transform: translateX(-50%);
}
.gray { 
    background: var(--circle-gray); 
    width: 80px; 
    height: 80px; 
    top: 15%; 
    right: 10%; 
}

/* Segundo set de círculos */

.blue-2 { 

    background: var(--circle-blue); 

    width: 200px; 

    height: 200px; 

    top: -5%; 

    left: 15%; 


}

.green-2 { 

    background: var(--circle-green); 

    width: 140px; 

    height: 140px; 

    bottom: 5%; 

    left: 10%; 


}

.red-2 { 

    background: var(--circle-red); 

    width: 180px; 

    height: 180px; 

    top: 40%; 

    right: -5%; 


}

.gray-2 { 

    background: var(--circle-gray); 

    width: 250px; 

    height: 250px; 

    top: 60%; 

    right: 20%; 


}



[data-theme="dark"] .blue-2,

[data-theme="dark"] .green-2,

[data-theme="dark"] .red-2,

[data-theme="dark"] .gray-2 {


}

/* ========== CONTENEDOR PRINCIPAL ========== */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    align-content: center;
    width: 75%;
    margin: auto;
    padding: 40px 0;
    min-height: calc(100vh - 250px);
    flex: 1;
}

.left-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.logo {
    width: 60%;
    max-width: 100%;
    filter: brightness(1);
    transition: filter 0.3s ease;
}

/* Logo principal - sin filtros, usar imagen original */
.logo {
    width: 60%;
    max-width: 100%;
    transition: opacity 0.3s ease;
}

.right-section {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== LOGIN BOX ========== */
.login-box {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow);
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

/* ========== SELECTOR DE IDIOMA Y TOGGLE THEME ========== */
.lang-theme-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.kc-theme-toggle {
    display: inline-flex;
    align-items: center;
}

.lang {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.sel-lang {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    background: var(--input-bg);
    border: 1px solid var(--border-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sel-lang:hover {
    border-color: var(--button-hover);
}

/* ========== TOGGLE THEME BUTTON ANIMADO ========== */
.kc-theme-toggle__btn {
    position: relative;
    width: 56px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 3px;
    transition: background 0.4s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .kc-theme-toggle__btn {
    background: linear-gradient(135deg, #1a1c20 0%, #2d3436 100%);
}

.kc-theme-toggle__btn::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
}

[data-theme="dark"] .kc-theme-toggle__btn::before {
    transform: translateX(28px);
}

.kc-theme-toggle__icon {
    position: absolute;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.kc-theme-toggle__icon--sun {
    left: 6px;
    color: #f39c12;
}

.kc-theme-toggle__icon--moon {
    right: 6px;
    color: #f1c40f;
    opacity: 0.3;
}

[data-theme="dark"] .kc-theme-toggle__icon--sun {
    opacity: 0.3;
}

[data-theme="dark"] .kc-theme-toggle__icon--moon {
    opacity: 1;
}

/* ========== TIPOGRAFÍA ========== */
h2 {
    color: var(--text-primary);
    text-align: center;
    font-size: 48px;
    font-weight: 700;
    margin: 1%;
    transition: color 0.3s ease;
}

h4 {
    color: var(--text-primary);
    margin-top: 3%;
    margin-bottom: 2%;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    transition: color 0.3s ease;
}

p {
    text-align: center;
    margin: 2%;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    gap: 10px;
    transition: color 0.3s ease;
}

label {
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.subTitle {
    color: var(--text-secondary);
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
    font-size: 18px;
    line-height: 20px;
    transition: color 0.3s ease;
}

/* ========== CORPORATE ACCOUNTS ========== */
.corporate-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
    width: 100%;
    padding: 0 10px;
    justify-content: center;
}

.corporate-accounts form {
    flex: 0 1 calc(25% - 12px);
    display: flex;
    justify-content: center;
    min-width: 140px;
    max-width: 180px;
}

.account {
    width: 100%;
    height: 65px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Light mode hover */
.account:hover {
    background: var(--button-hover);
    border-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 71, 186, 0.3);
}

/* Dark mode hover - fondo más claro para mejor contraste con SVGs */
[data-theme="dark"] .account:hover {
    background: #2a3f5f; /* Azul oscuro medio para buen contraste */
    border-color: var(--button-primary);
    box-shadow: 0 4px 12px rgba(93, 155, 255, 0.4);
}

/* SVG Images - Sin cambio de colores en logos corporativos */
.imagen-svg,
.imagen-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    max-height: 45px;
    object-fit: contain;
    transition: visibility 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

/* SVG default state en dark mode - convertir a monocromático suave */
[data-theme="dark"] .imagen-svg {
    filter: grayscale(100%) brightness(5) contrast(0.9);
    opacity: 0.85;
}

/* SVG hover state - mantener colores originales para identidad de marca */
.imagen-hover {
    visibility: hidden;
    filter: none; /* Sin filtros, colores originales */
}

/* En hover, mostrar el SVG con colores originales */
.account:hover .imagen-hover {
    visibility: visible;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5)); /* Sutil sombra blanca para destacar */
}

/* En dark mode hover, añadir un brillo sutil para mejor visibilidad */
[data-theme="dark"] .account:hover .imagen-hover {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6)) brightness(1.1);
}

.account:hover .imagen-svg {
    visibility: hidden;
}

/* ========== FORMULARIO ========== */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input {
    padding: 10px;
    border: 1px solid var(--border-secondary);
    background: var(--input-bg);
    color: var(--text-body);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus {
    border-color: var(--button-hover);
    box-shadow: 0 0 0 3px rgba(93, 155, 255, 0.15);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.forgot-password {
    font-size: 14px;
    color: var(--link-color);
    text-decoration: none;
    text-align: right;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--button-hover);
}

.login-btn {
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background: var(--button-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(93, 155, 255, 0.4);
}

/* ========== FOOTER/BANNER ========== */
.banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    width: 100%;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
    margin-top: auto;
    border-top: 1px solid var(--footer-border);
    transition: all 0.3s ease;
}

/* Contenedor de cada logo */
.banner-item {
    position: relative;
    padding: 0 25px;
    height: 40px;
    display: flex;
    align-items: center;
}

/* Separador vertical usando pseudo-elemento */
.banner-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background-color: #6D7075;
    transition: background-color 0.3s ease;
}

/* Separador en dark mode - blanco semi-transparente */
[data-theme="dark"] .banner-item:not(:last-child)::after {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Estilo de los logos */
.banner-item img {
    max-height: 40px;
    width: auto;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover effect opcional en los logos */
.banner-item:hover img {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Logos en dark mode - sin filtros, usarán imágenes _dark.svg */
[data-theme="dark"] .banner-item img {
    opacity: 1;
}

/* Responsive - Móvil */
@media (max-width: 767px) {
    .banner {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 15px 10px;
        gap: 0;
    }
    
    .banner-item {
        padding: 15px;
        height: auto;
        justify-content: center;
        border-right: 1px solid #6D7075;
        border-bottom: 1px solid #6D7075;
    }
    
    /* Quitar borde derecho en columna derecha */
    .banner-item:nth-child(even) {
        border-right: none;
    }
    
    /* Quitar borde inferior en última fila */
    .banner-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
    
    /* Ocultar el separador ::after en móvil */
    .banner-item::after {
        display: none;
    }
    
    .banner-item img {
        max-height: 30px;
    }
    
    /* Bordes en dark mode */
    [data-theme="dark"] .banner-item {
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1200px) {
    .banner-item {
        padding: 0 20px;
    }
    
    .banner-item img {
        max-height: 35px;
    }
    
    .banner-item:not(:last-child)::after {
        height: 25px;
    }
}

/* Pantallas pequeñas pero no móviles */
@media (min-width: 480px) and (max-width: 767px) {
    .banner {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .banner-item:nth-child(3n) {
        border-right: none;
    }
    
    .banner-item:nth-last-child(-n+3) {
        border-bottom: none;
    }
}

/* ========== POPUP ========== */
.popup-trigger-btn {
    background: rgba(93, 155, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.popup-trigger-btn:hover {
    background: var(--button-hover);
    color: white;
    border-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(93, 155, 255, 0.3);
}

.popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s;
}

[data-theme="dark"] .popup-modal {
    background-color: rgba(0, 0, 0, 0.85);
}

.popup-modal-content {
    position: relative;
    margin: 2% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: auto;
    background: var(--card-bg);
    border-radius: 8px;
    animation: slideDown 0.3s;
}

.popup-close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1;
    background: var(--card-bg);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    color: var(--circle-red);
    background: rgba(229, 0, 66, 0.1);
}

/* ========== CHECKBOX ========== */
.checkbox-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    margin-top: 20px;
    align-items: center;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--button-primary);
}

.checkbox-container a {
    font-size: 14px;
    margin-left: auto;
    color: var(--link-color);
}

.checkbox-container label {
    padding-left: 10px;
    cursor: pointer;
    margin-bottom: 0;
    color: var(--text-body);
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ========== ALERTS ========== */
.alert-error,
.alert-warning,
.alert-info,
.alert-success {
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.alert-error {
    background: rgba(229, 0, 66, 0.1);
    border: 1px solid var(--circle-red);
    color: var(--circle-red);
}

.alert-info {
    background: rgba(93, 155, 255, 0.1);
    border: 1px solid var(--button-primary);
    color: var(--button-primary);
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-info {
    color: var(--text-body);
}

/* ========== MEDIA QUERIES ========== */

/* Tablets */
@media (min-width: 768px) and (max-width: 1200px) {
    .main-container {
        min-height: auto;
        padding: 30px 20px;
        width: 85%;
    }
    
    .login-box {
        margin-bottom: 40px;
    }
    
    .corporate-accounts form {
        flex: 0 1 calc(50% - 8px);
        max-width: 200px;
        min-width: 160px;
    }
    
    .banner {
        padding: 15px 0;
        position: relative;
        margin-top: 60px;
    }
}

/* Desktop grande */
@media (min-width: 1201px) {
    .main-container {
        min-height: calc(100vh - 250px);
    }
    
    .banner {
        margin-top: auto;
    }
}

/* Mobile */
@media (max-width: 767px) {
    body {
        min-height: 100vh;
    }
    
    .main-container {
        flex-direction: column;
        text-align: center;
        width: 90%;
        min-height: auto;
        padding: 20px;
        margin: 20px auto;
        flex: 1 0 auto;
    }
    
    .left-section {
        margin-bottom: 20px;
    }
    
    .logo {
        width: 200px;
        max-width: 80%;
    }
    
    .login-box {
        padding: 25px 20px;
        border-radius: 15px;
        margin-bottom: 30px;
    }
    
    /* Lang-theme container stack en mobile */
    .lang-theme-container {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .lang {
        width: 100%;
        justify-content: center;
    }
    
    .kc-theme-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .corporate-accounts {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin: 15px 0;
    }
    
    .corporate-accounts form {
        width: 100%;
        max-width: 250px;
        flex: none;
    }
    
    .account {
        width: 100%;
        max-width: 250px;
        height: 55px;
    }
    
    h2 {
        font-size: 32px;
        margin: 10px 0;
    }
    
    .banner {
        padding: 15px 10px;
        margin-top: 40px;
        position: relative;
        bottom: 0;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .banner img {
        max-height: 40px;
    }
    
    /* Círculos ajustados para mobile */
    .blue { 
        width: 70px; 
        height: 70px; 
        top: 5%; 
        left: -35px;
    }
    .green { 
        width: 50px; 
        height: 50px; 
        bottom: 20px; 
        right: -25px;
    }
    .red { 
        width: 90px; 
        height: 90px; 
        bottom: -45px; 
        left: 50%; 
    }
    .gray { 
        width: 60px; 
        height: 60px; 
        top: -30px; 
        right: 10%;
    }
}

/* Fix para el footer en diferentes alturas */
@media (max-height: 700px) and (min-width: 768px) {
    .main-container {
        min-height: auto;
        padding: 20px 0;
    }
    
    .banner {
        position: relative;
        margin-top: 40px;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1201px) and (min-height: 900px) {
    .main-container {
        min-height: calc(100vh - 300px);
    }
}

/* ========== LOCALE DROPDOWN ========== */
#kc-locale ul {
    background-color: var(--card-bg);
    display: none;
    top: 20px;
    min-width: 100px;
    padding: 0;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

#kc-locale-dropdown {
    display: inline-block;
}

#kc-locale-dropdown:hover ul {
    display: block;
}

#kc-locale-dropdown a {
    color: var(--text-secondary);
    text-align: right;
    font-size: 14px;
}

a#kc-current-locale-link::after {
    content: "\2c5";
    margin-left: 4px;
}

#kc-current-locale-link {
    border-bottom: 1px solid var(--border-primary);
}

#kc-current-locale-link:hover {
    text-decoration: none;
}

/* ========== FOOTER TEXT ========== */
.corp-indentity-footer {
    display: grid;
    text-align: center;
    padding-right: 1rem;
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 1400px;
    padding-top: 1%;
    transition: color 0.3s ease;
}

[data-theme="dark"] .logo {
    filter: brightness(0) invert(1);
}