/* ============================================================
   LOGIN PAGE — CuentaCursoLogin
   Split layout: branding (left) + form (right)
   ============================================================ */

/* Contenedor principal del login */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* === PANEL DE MARCA (izquierda) === */
.login-brand {
    flex: 1 1 45%;
    background: linear-gradient(160deg, var(--color2) 0%, var(--color1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Imagen de fondo con desenfoque */
.login-brand::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: url('../img/cuentacurso-background.jpg') center / cover no-repeat;
    filter: blur(8px);
    opacity: 0.35;
    z-index: 1;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(43, 172, 200, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
}

/* Asegurar que el contenido esté por encima de las capas de fondo */
.login-brand > * {
    position: relative;
    z-index: 3;
}

.login-brand-logo {
    width: clamp(140px, 22vw, 220px);
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: logoFadeIn 0.8s ease-out;
}

.login-brand-tagline {
    color: var(--color-text-secondary);
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
    font-weight: 400;
    text-align: center;
    max-width: 320px;
    line-height: 1.6;
    opacity: 0.85;
}

/* === PANEL DEL FORMULARIO (derecha) === */
.login-form-panel {
    flex: 1 1 55%;
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: cardSlideUp 0.6s ease-out;
}

.login-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card-header h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 0.35rem;
}

.login-card-header p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* Campos */
.login-field {
    margin-bottom: 1.25rem;
}

.login-field .input {
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.login-field .input:focus {
    border-color: var(--color5);
    box-shadow: 0 0 0 3px rgba(43, 172, 200, 0.18);
}

.login-field .validation-message {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    min-height: 1.2em;
}

/* Opciones (recuérdame + link) */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.login-forgot-link {
    color: var(--color5);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.25s ease;
}

.login-forgot-link:hover {
    color: var(--color4);
    text-decoration: underline;
}

/* Botón principal */
.login-submit-btn {
    width: 100%;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(38, 131, 174, 0.3);
    letter-spacing: 0.3px;
}

.login-submit-btn:hover {
    background-color: var(--btn-primary-hover-bg);
    box-shadow: 0 6px 20px rgba(38, 131, 174, 0.4);
    transform: translateY(-1px);
}

.login-submit-btn:active {
    transform: scale(0.97);
}

/* Divisor */
.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Botón Google */
.login-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.07);
    color: var(--color-text-primary);
    border: 1.5px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.login-google-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--color4);
}

.login-google-btn img {
    width: 20px;
    height: 20px;
}

/* Registro */
.login-register-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.login-register-link .link {
    font-weight: 600;
    color: var(--color5);
}

/* === ANIMACIONES === */
@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand {
        flex: 0 0 auto;
        padding: 2rem 1.5rem 1.5rem;
    }

    .login-brand-logo {
        width: 100px;
        margin-bottom: 1rem;
    }

    .login-brand-tagline {
        font-size: 0.8rem;
        max-width: 260px;
    }

    .login-form-panel {
        padding: 1rem 1rem 2rem;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.2);
    }
}

@media (max-width: 400px) {
    .login-brand {
        padding: 1.5rem 1rem 1rem;
    }

    .login-brand-logo {
        width: 80px;
    }

    .login-card {
        padding: 1.5rem 1rem;
    }
}
