/* Login Unificado Moderno - Colores corporativos Valles */

/* Contenedor principal unificado */
.login-unified-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #eeeff1 0%, #f8f9fa 50%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(46, 44, 154, 0.08), rgba(74, 91, 168, 0.08));
    animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: 5%;
    left: -15%;
    animation-delay: 0s;
    background: linear-gradient(45deg, rgba(46, 44, 154, 0.06), rgba(74, 91, 168, 0.06));
}

.shape-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -10%;
    animation-delay: 7s;
    background: linear-gradient(45deg, rgba(74, 91, 168, 0.05), rgba(46, 44, 154, 0.05));
}

.shape-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 15%;
    animation-delay: 14s;
    background: linear-gradient(45deg, rgba(46, 44, 154, 0.07), rgba(74, 91, 168, 0.07));
}

.shape-4 {
    width: 180px;
    height: 180px;
    top: 25%;
    right: 20%;
    animation-delay: 10s;
    background: linear-gradient(45deg, rgba(74, 91, 168, 0.04), rgba(46, 44, 154, 0.04));
}

.shape-5 {
    width: 120px;
    height: 120px;
    bottom: 40%;
    right: 5%;
    animation-delay: 17s;
    background: linear-gradient(45deg, rgba(46, 44, 154, 0.06), rgba(74, 91, 168, 0.06));
}

@keyframes floatShape {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.05;
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
        opacity: 0.15;
    }
}

/* Patrón de cuadrícula sutil */
.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(46, 44, 154, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 44, 154, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Elementos corporativos decorativos */
.corporate-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.element {
    position: absolute;
    border: 2px solid rgba(46, 44, 154, 0.1);
    border-radius: 8px;
    animation: elementFloat 25s ease-in-out infinite;
}

.element-1 {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    border-color: rgba(46, 44, 154, 0.08);
}

.element-2 {
    width: 60px;
    height: 60px;
    top: 70%;
    right: 15%;
    animation-delay: 8s;
    border-color: rgba(74, 91, 168, 0.08);
    border-radius: 50%;
}

.element-3 {
    width: 100px;
    height: 40px;
    bottom: 25%;
    left: 5%;
    animation-delay: 16s;
    border-color: rgba(46, 44, 154, 0.06);
}

@keyframes elementFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
        opacity: 0.2;
    }
}

.login-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    height: 100%;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.logo-container {
    margin-bottom: 20px;
    animation: slideUp 0.8s ease-out 0.1s both;
}

.corporate-logo {
    max-height: 60px;
    width: auto;
    max-width: 300px;
    filter: drop-shadow(0 4px 8px rgba(46, 44, 154, 0.2));
    transition: all 0.3s ease;
}

.corporate-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(46, 44, 154, 0.3));
}

.portal-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2e2c9a;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #2e2c9a, #4a5ba8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideUp 0.8s ease-out;
}

.portal-subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
    max-width: 500px;
    line-height: 1.5;
    animation: slideUp 0.8s ease-out 0.2s both;
}

.login-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    align-items: start;
}

.login-form-container {
    display: flex;
    justify-content: center;
}

.widget-container {
    display: flex;
    justify-content: center;
}

/* Responsive para el diseño unificado */
@media (min-width: 768px) {
    .login-main {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 40px;
    }
    
    .portal-title {
        font-size: 3rem;
    }
    
    .portal-subtitle {
        font-size: 1.1rem;
    }
    
    .login-content {
        gap: 25px;
    }
    
    .corporate-logo {
        max-height: 70px;
        max-width: 350px;
    }
}

/* En pantallas pequeñas, hacer que formulario y widget tengan el mismo ancho */
@media (max-width: 767px) {
    .login-form-container,
    .widget-container {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }
    
    .pe_login,
    .widget-container #solicitar-empleo {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
        box-sizing: border-box;
    }
}

@media (min-width: 1024px) {
    .login-main {
        gap: 50px;
    }
    
    .portal-title {
        font-size: 3.5rem;
    }
    
    .portal-subtitle {
        font-size: 1.2rem;
    }
    
    .corporate-logo {
        max-height: 80px;
        max-width: 400px;
    }
}

@media (max-height: 700px) {
    .login-content {
        gap: 20px;
    }
    
    .portal-title {
        font-size: 2rem;
        margin-bottom: 5px;
    }
    
    .portal-subtitle {
        font-size: 0.9rem;
    }
    
    .login-main {
        gap: 25px;
    }
    
    .pe_login {
        padding: 30px 25px;
        box-sizing: border-box;
    }
    
    .widget-container #solicitar-empleo {
        padding: 30px 25px;
        box-sizing: border-box;
    }
    
    .corporate-logo {
        max-height: 50px;
        max-width: 250px;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .corporate-logo {
        max-height: 45px;
        max-width: 200px;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
}

/* Login Moderno - Respetando colores originales */
.pe_login {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 50px 40px;
    border-radius: 20px;
    display: flex;
    flex-flow: column;
    align-items: center;
    box-shadow: 0 20px 40px rgba(46, 44, 154, 0.1), 0 0 0 1px rgba(46, 44, 154, 0.05);
    position: relative;
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pe_login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2e2c9a, #4a5ba8);
    border-radius: 20px 20px 0 0;
}

.pe_login p {
    font-size: 2rem;
    font-weight: 600;
    color: #2e2c9a;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.pe_login p::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2e2c9a, #4a5ba8);
    border-radius: 2px;
}

.pe_login form {
    display: flex;
    align-items: center;
    flex-flow: column;
    width: 100%;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 25px;
}

.pe_login form input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px !important;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2d3748;
    box-sizing: border-box;
    margin-bottom: 0;
    min-height: 56px;
}

.pe_login form input:focus {
    outline: none;
    border-color: #2e2c9a;
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 44, 154, 0.1);
    transform: translateY(-2px);
    border-radius: 12px !important;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 18px;
    transition: all 0.3s ease;
}

.pe_login form input:focus + .input-icon {
    color: #2e2c9a;
    transform: translateY(-50%) scale(1.1);
}

.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2e2c9a 0%, #4a5ba8 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(46, 44, 154, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.pe_login > a {
    color: #4a5ba8 !important;
    text-decoration: none !important;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.pe_login > a:visited {
    color: #4a5ba8 !important;
}

.pe_login > a:link {
    color: #4a5ba8 !important;
}

.pe_login > a:active {
    color: #4a5ba8 !important;
}

.pe_login > a:focus {
    color: #4a5ba8 !important;
}

.pe_login > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4a5ba8;
    transition: width 0.3s ease;
}

.pe_login > a:hover::after {
    width: 100%;
}

.pe_login > a:hover {
    color: #2e2c9a !important;
    transform: translateY(-1px);
}

p.alert-login {
    width: 100%;
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    padding: 18px 20px;
    border-radius: 12px;
    color: #c53030;
    font-size: 14px;
    text-align: center;
    border: 1px solid #feb2b2;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Efectos interactivos adicionales */
.input-group.focused .input-icon {
    color: #2e2c9a;
    transform: translateY(-50%) scale(1.1);
}

.input-group.has-value .input-icon {
    color: #2e2c9a;
}

.input-group.focused input {
    border-color: #2e2c9a;
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 44, 154, 0.1);
    transform: translateY(-2px);
}

/* Animación de carga */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejoras en la accesibilidad */
.pe_login input:focus,
.pe_login button:focus {
    outline: 2px solid #2e2c9a;
    outline-offset: 2px;
}

/* Asegurar border-radius consistente en todos los inputs */
.pe_login input[type="text"],
.pe_login input[type="email"],
.pe_login input[type="password"],
.pe_login input[type="tel"],
.pe_login input[type="number"] {
    border-radius: 12px !important;
}

.pe_login input[type="text"]:focus,
.pe_login input[type="email"]:focus,
.pe_login input[type="password"]:focus,
.pe_login input[type="tel"]:focus,
.pe_login input[type="number"]:focus {
    border-radius: 12px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pe_login {
        padding: 40px 30px;
        border-radius: 16px;
        margin: 20px;
        box-sizing: border-box;
    }
    
    .widget-container #solicitar-empleo {
        padding: 40px 30px;
        box-sizing: border-box;
    }
    
    .pe_login p {
        font-size: 1.75rem;
    }
    
    .pe_login form input {
        padding: 16px 18px 16px 45px;
        font-size: 15px;
    }
    
    .input-icon {
        left: 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .pe_login {
        padding: 30px 25px;
        margin: 15px;
        box-sizing: border-box;
    }
    
    .widget-container #solicitar-empleo {
        padding: 30px 25px;
        box-sizing: border-box;
    }
    
    .pe_login p {
        font-size: 1.5rem;
    }
}

/* Ocultar header en login y eliminar scroll */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.login-unified-container + header,
.login-unified-container ~ header {
    display: none !important;
}

/* Permitir scroll en todos los dispositivos */
html, body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

#app {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.login-unified-container {
    min-height: 100vh;
    height: auto;
}

/* Ajustar el widget para el diseño unificado */
.widget-container #solicitar-empleo {
    margin-top: 0;
    animation: slideUp 0.8s ease-out 0.4s both;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(46, 44, 154, 0.1), 0 0 0 1px rgba(46, 44, 154, 0.05);
    position: relative;
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    box-sizing: border-box;
}

.widget-container #solicitar-empleo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2e2c9a, #4a5ba8);
    border-radius: 20px 20px 0 0;
}

.widget-container #solicitar-empleo .content {
    margin-left: 0;
    padding-top: 0;
    text-align: center;
}

.widget-container #solicitar-empleo .content p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2e2c9a;
    margin-bottom: 20px;
    position: relative;
}

.widget-container #solicitar-empleo .content p::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2e2c9a, #4a5ba8);
    border-radius: 2px;
}

.widget-container #solicitar-empleo .content a {
    background: linear-gradient(135deg, #2e2c9a 0%, #4a5ba8 100%);
    padding: 15px 35px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(46, 44, 154, 0.3);
    font-size: 0.9rem;
}

.widget-container #solicitar-empleo .content a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.widget-container #solicitar-empleo .content a:hover::before {
    left: 100%;
}

.widget-container #solicitar-empleo .content a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(46, 44, 154, 0.4);
    color: white;
}

.widget-container #solicitar-empleo img {
    display: none;
}

.widget-container #solicitar-empleo .icon-container,
.widget-container #solicitar-empleo .floating-elements {
    display: none;
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .pe_login form input:focus {
        transform: none;
    }
    
    .btn-login:hover {
        transform: none;
    }
    
    .pe_login > a:hover {
        transform: none;
    }
    
    .login-unified-container:hover .shape {
        transform: none;
    }
}
