/* ========================================
   PÁGINA DE LOGIN - SISTEMA RPA
   Diseño minimalista y elegante
    Paleta alineada al logo corporativo
======================================== */

:root {
    --brand-blue: #0c3c5d;
    --brand-blue-dark: #083045;
     --brand-yellow: #e8b100;
     --brand-yellow-soft: #f8e7a5;
     --text-main: #1f2733;
     --text-muted: #64748b;
     --surface: #ffffff;
     --surface-alt: #f5f7fa;
     --border: #d9e1ea;
}

/* ========================================
   LAYOUT DE LOGIN
======================================== */
body {
    background: var(--brand-blue);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo sutil */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 177, 0, 0.12) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-out;
}

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

.login-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* ========================================
   HEADER DEL LOGIN - MINIMALISTA
======================================== */
.login-header {
    background: var(--surface);
    color: var(--brand-blue);
    padding: 1.25rem 2rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.login-icon {
    width: 100%;
    min-height: 56px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.25rem;
}

.login-logo {
    height: clamp(96px, 16vw, 140px);
    width: auto;
    max-width: min(98%, 480px);
    display: block;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .login-logo {
        height: clamp(80px, 20vw, 115px);
        max-width: min(98%, 400px);
    }
}

.login-title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--brand-blue);
    letter-spacing: -0.5px;
}

.login-subtitle {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ========================================
   BODY DEL LOGIN
======================================== */
.login-body {
    padding: 1.5rem 2rem 2rem;
    background: var(--surface);
    position: relative;
}

.login-alerts {
    position: static;
    margin-bottom: 0.75rem;
    z-index: 1;
    pointer-events: auto;
}

.login-alerts .alert {
    pointer-events: auto;
    box-shadow: 0 6px 16px rgba(15, 74, 115, 0.12);
}

/* ========================================
   FORMULARIOS - MINIMALISTA
======================================== */
.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: block;
}

.form-label i {
    margin-right: 0.375rem;
    color: var(--brand-yellow);
    opacity: 0.7;
}

.input-group {
    width: 100%;
}

.input-group-text {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-muted);
}

.form-control {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    color: var(--text-main);
    width: 100%;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 6px 6px 0;
    flex: 1;
}

.input-group .input-group-text {
    border-radius: 6px 0 0 6px;
}

.form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(15, 74, 115, 0.15);
    outline: none;
}

.input-group .form-control:focus {
    border-left-color: transparent;
}

.input-group:focus-within .input-group-text {
    border-color: var(--brand-blue);
    background: var(--surface-alt);
    color: var(--brand-blue);
}

/* ========================================
    CAPTCHA DE SERVIDOR
======================================== */
.captcha-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.captcha-canvas-container {
    background: var(--surface-alt);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

#captchaCanvas,
#captchaImage {
    display: block;
    border-radius: 4px;
}

.captcha-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex: 1;
}

.captcha-input-group .form-control {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem;
    color: var(--brand-blue);
}

.btn-captcha-refresh {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    flex-shrink: 0;
}

.btn-captcha-refresh:hover {
    background: var(--brand-blue);
    color: var(--surface);
    border-color: var(--brand-blue);
    transform: rotate(180deg);
}

.btn-captcha-refresh i {
    font-size: 1rem;
}

/* ========================================
   BOTONES - MINIMALISTA
======================================== */
.btn-login {
    background: var(--brand-blue);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    color: var(--surface);
    margin-top: 0.5rem;
    width: 100%;
}

.btn-login:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 74, 115, 0.35);
    color: var(--surface);
}

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

#togglePassword {
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

#togglePassword:hover {
    background: var(--surface-alt);
    color: var(--brand-blue);
}

/* ========================================
   ALERTAS - MINIMALISTA
======================================== */
.alert {
    border-radius: 6px;
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    border-left: 3px solid;
}

.alert i {
    margin-right: 0.5rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    color: #14532d;
    border-left-color: #22c55e;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border-left-color: #3b82f6;
}

/* ========================================
   FOOTER DEL LOGIN - MINIMALISTA
======================================== */
.login-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.login-footer .link-secondary {
    color: var(--text-muted);
}

.login-footer .link-secondary:hover {
    color: var(--brand-blue);
}

.login-footer .link-primary {
    color: var(--brand-blue);
    font-weight: 500;
}

.login-footer .link-primary:hover {
    color: var(--brand-yellow);
}

.login-footer hr {
    border-color: var(--border);
    margin: 0.5rem 0;
}

/* ========================================
   INFO FOOTER - MINIMALISTA
======================================== */
.login-info {
    background: var(--surface-alt);
    padding: 0.875rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.login-info i {
    color: #22c55e;
    margin-right: 0.25rem;
}

.login-info small {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ========================================
   ERRORES DE VALIDACIÓN
======================================== */
.text-danger.small {
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

.text-danger i {
    font-size: 0.75rem;
}

/* ========================================
   TEXTO MUTED
======================================== */
.text-muted {
    color: #9ca3af !important;
    font-size: 0.8125rem;
}

.text-muted i {
    opacity: 0.7;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 575.98px) {
    body {
        padding: 0.5rem;
    }
    
    .login-header {
        padding: 1.75rem 1.5rem 1.25rem;
    }
    
    .login-icon {
        width: auto;
        height: auto;
        min-height: 72px;
    }
    
    .login-icon i {
        font-size: 1.5rem;
    }

    .login-logo {
        height: clamp(96px, 26vw, 140px);
        width: min(70vw, 260px);
        max-width: 90%;
    }
    
    .login-title {
        font-size: 1.25rem;
    }
    
    .login-subtitle {
        font-size: 0.75rem;
    }
    
    .login-body {
        padding: 1.25rem 1.5rem 1.75rem;
    }
    
    /* Captcha responsive: cambiar a vertical en móviles */
    .captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-canvas-container {
        width: 100%;
        justify-content: center;
    }
    
    #captchaCanvas {
        max-width: 100%;
    }
}

/* ========================================
   ANIMACIONES SUTILES
======================================== */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Placeholder elegante */
.form-control::placeholder {
    color: #d1d5db;
}

/* Focus states suaves */
.form-control:focus::placeholder {
    color: #9ca3af;
}
