* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    overflow: hidden;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ===== IMAGEN (65% en PC) ===== */
.login-image {
    width: 65%;
    background: url("../img/fondo.png") center / cover no-repeat;
    position: relative;
}

.login-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.9) 0%,
        rgba(30, 58, 138, 0.6) 100%
    );
}

.login-image-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 10vw 80px;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-image-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.login-image-content p {
    font-size: 18px;
    line-height: 1.7;
    opacity: 0.9;
    font-weight: 300;
}

/* ===== FORMULARIO (35% en PC) ===== */
.login-form-area {
    width: 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0,0,0,0.03);
    position: relative;
    z-index: 10;
}

.login-box {
    width: 100%;
    max-width: 380px;
}

.brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand h2 {
    font-size: 24px;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand p {
    color: #64748b;
    font-size: 14px;
    margin-top: 5px;
}

/* ===== MENSAJES DE ESTADO ===== */
.success-msg {
    background: #dcfce7; 
    color: #166534; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: 600; 
    text-align: center; 
    margin-bottom: 20px; 
    border: 1px solid #bbf7d0;
}

.error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    border: 1px solid #fecaca;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* ===== INPUTS ===== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
    transition: 0.3s;
}

input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-family: inherit;
}

input::placeholder {
    color: #94a3b8;
}

input:focus {
    outline: none;
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input:focus + i {
    color: #3b82f6;
}

.forgot-link {
    display: block;
    text-align: right; 
    margin-bottom: 20px;
}

.forgot-link a {
    color: #2563eb; 
    font-size: 13px; 
    text-decoration: none; 
    font-weight: 600; 
    transition: 0.2s;
}

.forgot-link a:hover {
    text-decoration: underline;
}

/* ===== BOTÓN ===== */
button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    font-family: inherit;
}

button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.3);
}

button:active {
    transform: translateY(0);
}

.btn-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media(max-width: 900px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-image {
        display: none;
    }

    .login-form-area {
        width: 100%;
        height: 100vh;
        padding: 20px;
        background: #f8fafc;
    }

    .login-box {
        background: #ffffff;
        padding: 40px 25px;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    }
}

/* ===== BOTÓN MOSTRAR/OCULTAR CONTRASEÑA ===== */
#password {
    padding-right: 45px; /* Espacio para que el texto no pise el ojito */
}

.toggle-password {
    position: absolute;
    right: 16px; 
    left: auto !important; /* ¡Vital! Anula el left:16px del otro ícono */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 20px;
    transition: color 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    color: #3b82f6; 
}