/**=====================
    Professional Login CSS
==========================**/

/* Variables de colores profesionales */
:root {
    --theme-primary: #2b5f60;
    --theme-secondary: #c06240;
    --light-background: rgba(242, 243, 247, 0.7);
    --body-font-color: #86909c;
    --dark-text: #1f2f3e;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-color: #ecf3fa;
    --shadow-light: rgba(43, 95, 96, 0.1);
    --shadow-medium: rgba(43, 95, 96, 0.15);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--body-font-color);
    line-height: 1.6;
}

/* Contenedor principal */
.login-container {
    width: 100%;
    max-width: 1000px;
    margin: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-light);
    overflow: hidden;
    display: flex;
    min-height: 600px;
}

/* Panel izquierdo - Branding */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, var(--theme-primary) 0%, #1e4a4b 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-logo i {
    font-size: 36px;
    color: var(--white);
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
    font-weight: 400;
}

.brand-features {
    list-style: none;
    text-align: left;
    width: 100%;
    max-width: 280px;
}

.brand-features li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    opacity: 0.9;
}

.brand-features li i {
    width: 20px;
    margin-right: 12px;
    color: var(--theme-secondary);
}

/* Panel derecho - Formulario */
.login-form-panel {
    flex: 1;
    padding: 30px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

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

.login-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--body-font-color);
    font-size: 15px;
    font-weight: 400;
}

/* Formulario */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    color: var(--dark-text);
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(43, 95, 96, 0.1);
    background: var(--white);
}

.form-control::placeholder {
    color: var(--body-font-color);
    font-weight: 400;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--body-font-color);
    font-size: 16px;
    z-index: 2;
}

.form-control:focus + .input-icon {
    color: var(--theme-primary);
}

/* Toggle de contraseña */
.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--body-font-color);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    z-index: 2;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--theme-primary);
}

/* Checkbox personalizado */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}

.form-check-input:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 10px;
}

.form-check-label {
    color: var(--body-font-color);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

/* Botón principal */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, #1e4a4b 100%);
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 95, 96, 0.3);
}

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

.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%;
}

/* Enlaces */
.forgot-password {
    text-align: center;
    margin-top: 25px;
}

.forgot-password a {
    color: var(--theme-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--theme-secondary);
    text-decoration: underline;
}

/* Mensajes de error */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--body-font-color);
    font-size: 13px;
    margin: 0;
}

.login-footer a {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--theme-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        margin: 10px;
        max-width: none;
        min-height: auto;
    }
    
    .login-branding {
        padding: 30px 30px;
        min-height: 300px;
    }
    
    .login-form-panel {
        padding: 40px 30px;
    }
    
    .brand-title {
        font-size: 28px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .brand-features {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 5px;
        border-radius: 8px;
    }
    
    .login-branding {
        padding: 30px 20px;
        min-height: 250px;
    }
    
    .login-form-panel {
        padding: 30px 20px;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .form-control {
        padding: 14px 18px 14px 45px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
}

/* Animaciones de entrada */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.login-branding {
    animation: slideInLeft 0.6s ease-out;
}

.login-form-panel {
    animation: slideInRight 0.6s ease-out;
}

/* Estados de carga */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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