﻿/* ========================================
   VARIABLES CSS - LOGIN EMPRESA
======================================== */
:root {
    --empresa-primary: #0066CC;
    --empresa-secondary: #004080;
    --empresa-accent: #00A3E0;
    --empresa-success: #28a745;
    --empresa-danger: #dc3545;
    --empresa-warning: #ffc107;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --border-radius: 16px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ========================================
   LAYOUT BASE
======================================== */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--empresa-primary) 0%, var(--empresa-secondary) 50%, var(--empresa-accent) 100%);
    opacity: 0.95;
    z-index: -1;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

/* ========================================
   ANIMACIONES
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   LOGO
======================================== */
.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-placeholder {
    display: inline-block;
}

.logo-img {
    max-width: 120px;
    height: auto;
    transition: var(--transition);
}

    .logo-img:hover {
        transform: scale(1.05);
    }

/* ========================================
   BADGE EMPRESAS
======================================== */
.empresa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--empresa-primary), var(--empresa-accent));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
    }

    50% {
        box-shadow: 0 4px 16px rgba(0, 102, 204, 0.5);
    }
}

/* ========================================
   SECCIÓN BIENVENIDA
======================================== */
.welcome-section {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

/* ========================================
   ALERTAS
======================================== */
.alert {
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border: none;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--empresa-success);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--empresa-danger);
}

/* ========================================
   FORMULARIO
======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

    .form-label i {
        color: var(--empresa-primary);
    }

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-light);
}

    .form-control:focus {
        outline: none;
        border-color: var(--empresa-primary);
        background: white;
        box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    }

    .form-control::placeholder {
        color: #a0a0a0;
    }

/* ========================================
   PASSWORD WRAPPER
======================================== */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

    .toggle-password:hover {
        color: var(--empresa-primary);
    }

/* ========================================
   OPCIONES DEL FORMULARIO
======================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-dark);
}

    .remember-me input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--empresa-primary);
    }

.forgot-password {
    font-size: 0.875rem;
    color: var(--empresa-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

    .forgot-password:hover {
        color: var(--empresa-secondary);
        text-decoration: underline;
    }

/* ========================================
   ERROR ALERT
======================================== */
.error-alert {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--empresa-danger);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--empresa-danger);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ========================================
   RECAPTCHA
======================================== */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.g-recaptcha {
    transform: scale(0.95);
    transform-origin: center;
}

/* ========================================
   BOTÓN PRINCIPAL
======================================== */
.btn-cocrianza-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--empresa-primary), var(--empresa-accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .btn-cocrianza-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn-cocrianza-primary:active {
        transform: translateY(0);
    }

    .btn-cocrianza-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ========================================
   AUTH TOGGLE
======================================== */
.auth-toggle {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.auth-toggle-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.auth-toggle-link {
    display: inline-block;
    color: var(--empresa-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

    .auth-toggle-link:hover {
        color: var(--empresa-secondary);
        text-decoration: underline;
    }

/* ========================================
   VOLVER A LOGIN USUARIOS
======================================== */
.back-to-user {
    text-align: center;
    margin-top: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
}

    .back-link:hover {
        color: var(--empresa-primary);
    }

/* ========================================
   TRUST SECTION
======================================== */
.trust-section {
    margin-top: 2rem;
    text-align: center;
}

.trust-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: var(--transition);
}

    .trust-badge:hover {
        background: rgba(0, 102, 204, 0.1);
        color: var(--empresa-primary);
        transform: translateY(-2px);
    }

    .trust-badge i {
        color: var(--empresa-primary);
    }

/* ========================================
   VALIDACIONES
======================================== */
.text-danger {
    display: block;
    font-size: 0.8rem;
    color: var(--empresa-danger);
    margin-top: 0.5rem;
}

.form-control.is-invalid {
    border-color: var(--empresa-danger);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .empresa-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .trust-badges {
        gap: 0.5rem;
    }

    .trust-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
