﻿/* ================================================= HERRAMIENTAS BASE ================================================= */
* {
    box-sizing: border-box;
}

/* 🔥 AQUÍ ESTÁ LA MAGIA: Reemplazamos 'body' por '.auth-page-wrapper' para no romper tu _Layout 🔥 */
.auth-page-wrapper {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    min-height: 80vh; /* Da espacio suficiente para que el header y el footer respiren */
    padding: 40px 15px; /* Un poco de margen arriba y abajo */
}

/* ================================================= CONTENEDOR PRINCIPAL ================================================= */
.container-auth {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 850px;
    max-width: 100%;
    min-height: 550px;
}

/* ================================================= ESTILO DE FORMULARIOS ================================================= */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

/* 🔥 Encapsulado para que no afecte otros formularios de la página */
.container-auth form {
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

/* 🔥 Encapsulado para que no afecte otros títulos de la página */
.container-auth h1 {
    font-weight: bold;
    margin: 0;
    font-size: 2rem;
}

.small-text {
    font-size: 12px;
    color: #777;
    margin-bottom: 15px;
}

/* ================================================= INPUTS Y BOTONES ================================================= */
/* 🔥 Encapsulado para que NO rompa el buscador del Navbar ni otros inputs */
.container-auth input {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    border-radius: 8px;
    outline: none;
}

.btn-submit {
    border-radius: 20px;
    border: 1px solid #0062ff;
    background-color: #0062ff;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
    cursor: pointer;
    margin-top: 10px;
}

    .btn-submit:active {
        transform: scale(0.95);
    }

/* ================================================= ENLACES DE CAMBIO DE PANEL ================================================= */
.switch-text {
    margin-top: 25px;
    font-size: 13px;
    color: #555;
}

.switch-link {
    color: #0062ff;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

    .switch-link:hover {
        color: #0046b8;
        text-decoration: underline;
    }

/* 🔥 ================================================= ALINEACIÓN DE TEXTO ================================================= 🔥 */
.text-left-custom {
    align-self: flex-start;
    margin-left: 5px;
    margin-top: 15px;
    text-align: left;
}

/* 🔥 ================================================= SOCIAL (BOTÓN REDONDO) ================================================= 🔥 */
.social-container {
    margin: 10px 0;
}

.social-icon {
    border: 1px solid #DDDDDD;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 45px;
    width: 45px;
    text-decoration: none;
    background-color: #fff;
    transition: background 0.3s, transform 0.2s;
}

    .social-icon:hover {
        background-color: #f1f1f1;
        transform: scale(1.1);
    }

/* ================================================= LÓGICA DE LA ANIMACIÓN (SLIDE) ================================================= */
.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container-auth.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container-auth.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }

    50%, 100% {
        opacity: 1;
        z-index: 5;
    }
}

/* ================================================= OVERLAY (EL PANEL QUE SE MUEVE) ================================================= */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container-auth.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    background: none;
}

.container-auth.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    padding: 15px 40px 0;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transition: transform 0.6s ease-in-out;
}

/* 🖼️ PANEL IZQUIERDO (LOGIN) - SOLO IMAGEN */
.overlay-left {
    background-image: url('/images/login-bg.jpg');
    background-size: cover;
    background-position: center;
    transform: translateX(-20%);
}

.container-auth.right-panel-active .overlay-left {
    transform: translateX(0);
}

/* 🖼️ PANEL DERECHO (REGISTRO) - SOLO IMAGEN */
.overlay-right {
    background-image: url('/images/register-bg.jpg');
    background-size: cover;
    background-position: center;
    right: 0;
    transform: translateX(0);
}

.container-auth.right-panel-active .overlay-right {
    transform: translateX(20%);
}

/* Sombra de texto para asegurar legibilidad sobre cualquier imagen */
.overlay-panel h1 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.overlay-panel p {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    margin: 20px 0 30px;
    font-weight: 500;
}

.forgot-link {
    color: #555;
    font-size: 13px;
    text-decoration: none;
    margin: 15px 0;
}

    .forgot-link:hover {
        color: #0062ff;
    }

/* ================================================= RESPONSIVE (MÓVIL Y TABLETS) ================================================= */
@media (max-width: 768px) {
    /* El contenedor ahora ocupa casi todo el ancho de la pantalla */
    .container-auth {
        width: 95%;
        max-width: 400px; /* Tamaño ideal para móvil */
        min-height: 500px;
        height: auto;
    }

    /* Escondemos el panel de la imagen en móvil para que no estorbe */
    .overlay-container {
        display: none;
    }

    /* Los formularios ahora ocupan el 100% del contenedor */
    .form-container {
        width: 100%;
        position: relative;
        height: auto;
        transition: none !important; /* 🔥 ESTO MATA EL DELAY GENERAL */
    }

    /* Quitamos las animaciones de traslación en móvil para que no se pierdan los formularios */
    .container-auth.right-panel-active .sign-in-container {
        transform: none;
        display: none; /* Escondemos el login cuando el registro está activo */
    }

    .container-auth.right-panel-active .sign-up-container {
        transform: none;
        opacity: 1;
        z-index: 5;
        animation: none !important; /* 🔥 ESTO EVITA QUE SE QUEDE INVISIBLE MEDIO SEGUNDO */
        display: block;
    }

    /* Lógica para mostrar/esconder según el panel activo */
    .sign-up-container {
        display: none; /* Por defecto escondido */
        opacity: 1;
    }

    .container-auth.right-panel-active .sign-up-container {
        display: block;
    }

    .container-auth:not(.right-panel-active) .sign-in-container {
        display: block;
    }

    /* 🔥 Encapsulado en móvil */
    .container-auth form {
        padding: 40px 25px; /* Reducimos el padding para que quepan bien los inputs */
        height: auto;
    }

    /* 🔥 Encapsulado en móvil */
    .container-auth h1 {
        font-size: 1.5rem; /* Letras un chin más pequeñas */
        margin-bottom: 10px;
    }

    .btn-submit {
        width: 100%; /* Botón a todo lo ancho en móvil */
        padding: 12px;
    }
}

/* 👁️ CONTENEDOR DEL PASSWORD */
.password-wrapper {
    position: relative;
    width: 100%;
}

    /* 🔐 INPUT CON ESPACIO PARA EL OJITO */
    .password-wrapper input {
        padding-right: 45px !important;
    }

    /* 👁️ ICONO DEL OJO */
    .password-wrapper .toggle-password {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        z-index: 999;
        font-size: 16px;
        color: #666;
    }

        .password-wrapper .toggle-password:hover {
            color: #0062ff;
        }
