/* css/login.css */
/* ----------------------------------------------------------------------------
   PROYECTO: Investep Pro
   DISEÑO: Login Neutral (Always Light)
   ESTADO: Definitivo / Responsivo
   ---------------------------------------------------------------------------- */

:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-dim: #64748b;
    --accent: #2563eb;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --neon-accent: #4be4f0;
    --error: #ef4444;
    --success: #10b981;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* LOGO SUPERIOR */
.logo-container {
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: 0.3s ease;
    cursor: pointer;
}

    .logo-link:hover {
        transform: translateY(-5px);
        opacity: 0.9;
    }

.header-logo {
    height: 78px;
    width: auto;
    display: block;
    transition: 0.3s ease;
}

.logo-link:hover .header-logo {
    filter: drop-shadow(0 0 15px var(--neon-accent));
}

/* CARD DE LOGIN */
.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 45px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.form-group {
    margin-bottom: 25px;
}

    .form-group label {
        display: block;
        font-size: 0.95rem;
        color: var(--text-main);
        margin-bottom: 10px;
        font-weight: 600;
    }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-wrapper i.main-icon {
        position: absolute;
        left: 18px;
        color: var(--text-dim);
        font-size: 1.1rem;
    }

.toggle-password {
    position: absolute;
    right: 18px;
    color: var(--text-dim);
    cursor: pointer;
    z-index: 15;
}

.form-group input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 16px 45px 16px 50px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

    .form-group input:focus {
        background: #ffffff;
        border-color: var(--accent);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }

/* OPCIONES */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    cursor: pointer;
}

    .remember-me input {
        margin-right: 10px;
        width: 18px;
        height: 18px;
    }

.forgot-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* BOTON ACCESO */
.btn-login {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-login:hover {
        background: #1d4ed8;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .btn-login:disabled {
        background: #cbd5e1;
        cursor: not-allowed;
    }

/* BANNER ERROR */
.error-banner {
    background: #fef2f2;
    color: var(--error);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #fee2e2;
    display: none;
    text-align: center;
    font-weight: 600;
}

/* FOOTER */
.footer-text {
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.footer-rights {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.footer-brand-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    text-transform: uppercase;
    line-height: 1;
}

.brand-black {
    color: #000000;
}

.brand-blue {
    color: var(--accent);
}

/* YOEL BACKGROUND */
.background-image {
    position: fixed;
    bottom: 0;
    right: 0;
    height: 60vh;
    width: auto;
    z-index: 1;
    pointer-events: auto;
    object-fit: contain;
    cursor: grab;
    transition: right 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

    .background-image:hover {
        transform: scale(1.02);
    }

    .background-image.dragging {
        transition: none;
        cursor: move;
    }

/* --- RESPONSIVE MAESTRO (Tablets y Smartphones) --- */

/* 1. TABLETS (Vertical y Horizontal) */
@media (max-width: 1024px) {
    .background-image {
        height: 35vh; /* Yoel se reduce para dejar aire a la card */
    }

    .login-card {
        max-width: 380px;
        padding: 35px;
    }
}

/* 2. SMARTPHONES GRANDES / TABLETS PEQUEÑAS (Max 768px) */
@media (max-width: 768px) {
    .background-image {
        height: 25vh; /* Altura segura para no tocar la card */
    }

    .login-card {
        width: 85%;
        padding: 30px 25px;
    }

    .header-logo {
        height: 65px;
    }
}

/* 3. SMARTPHONES ESTÁNDAR (iPhone, Samsung, etc. - Max 480px) */
@media (max-width: 480px) {
    body {
        justify-content: flex-start; /* Empujamos contenido arriba */
        padding-top: 40px;
    }

    .login-card {
        width: 90%;
        padding: 25px 20px;
    }

    .background-image {
        height: 15vh; /* Yoel muy pequeño en la esquina para evitar solapamiento */
    }

    .footer-brand-text {
        font-size: 1.4rem;
    }
}

/* 4. DISPOSITIVOS PEQUEÑOS O MODO HORIZONTAL (Landscape) 
      Esta es la regla de oro para que NO quede debajo de la card */
@media (max-height: 600px) {
    .background-image {
        height: 15vh; /* Casi desaparece o se vuelve mínimo */
        bottom: 5px;
        right: 5px;
    }

    .logo-container {
        margin-bottom: 15px;
    }

    .header-logo {
        height: 50px;
    }
    /* Si la pantalla es muy bajita, permitimos scroll para no perder el botón */
    body {
        overflow-y: auto;
        display: block; /* Cambiamos a block para que el scroll funcione natural */
    }

    .login-card, .logo-container {
        margin-left: auto;
        margin-right: auto;
        margin-top: 20px;
    }
}

/* 5. LAPTOPS Y MONITORES (Desde 1025px hasta 1920px+) */
@media (min-width: 1025px) {
    .login-card {
        max-width: 420px; /* Tamaño perfecto para lectura y estética */
        padding: 45px;
        /* Efecto de elevación suave para pantallas grandes */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

        .login-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
        }

    .background-image {
        height: 55vh; /* Yoel tiene una presencia imponente pero elegante */
        max-height: 600px; /* Evitamos que crezca infinitamente en monitores 4K */
        right: 2%; /* Lo separamos un poco del borde físico de la pantalla */
        bottom: 0;
    }

    .header-logo {
        height: 78px; /* Tamaño original */
    }
}

/* 6. MONITORES ULTRA-WIDE O 4K (Pantallas muy anchas) */
@media (min-width: 2000px) {
    .login-card {
        max-width: 450px;
        transform: scale(1.1); /* Escalamos ligeramente para que no se vea minúsculo */
    }

    .background-image {
        height: 50vh;
        max-height: 800px;
        right: 5%; /* Lo centramos un poco más hacia la card para equilibrar el blanco */
    }
}

/* 7. AJUSTE DE ALTURA PARA LAPTOPS PEQUEÑAS (Tipo MacBook Air 11" o Chromebooks)
      Si la pantalla es ancha pero bajita */
@media (min-width: 1025px) and (max-height: 700px) {
    .logo-container {
        margin-bottom: 20px;
    }

    .login-card {
        padding: 30px 45px;
    }

    .background-image {
        height: 45vh;
    }
}