@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

/* =========================================
   1. RESETEO Y VARIABLES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #FF7F50;
    --gradiente: linear-gradient(to right, rgb(255, 69, 0), rgb(255, 127, 80));
}

body {
    background-image: linear-gradient(to right, rgb(250, 235, 215), rgb(255, 250, 240));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    height: 100vh;
}

/* =========================================
   2. TIPOGRAFÍA Y ELEMENTOS GENERALES
   ========================================= */
h1 {
    font-weight: 800;
    margin: 0 0 1rem 0;
    color: var(--primary);
}

h2 { text-align: center; }

p {
    font-size: 14px;
    font-weight: 100;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
}

span {
    font-size: 12px;
    margin-bottom: 15px;
    display: block;
}

a {
    color: #333;
    font-size: 14px;
    text-decoration: none;
    margin: 15px 0;
}

/* =========================================
   3. BOTONES
   ========================================= */
button {
    border-radius: 20px;
    border: 1px solid var(--primary);
    background: var(--gradiente);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(235, 125, 36, 0.3);
    margin-top: 1rem;
}

button:active { transform: scale(0.95); }
button:focus { outline: none; }
button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: var(--gradiente);
}

/* Botón transparente (Ghost) para el panel de color */
button.ghost {
    background: transparent;
    border-color: #FFFFFF;
    box-shadow: none;
}

button.ghost:hover {
    background: #FFFFFF;
    color: var(--primary);
}

/* =========================================
   4. FORMULARIOS (ESTILOS VISUALES)
   ========================================= */
form {
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

/* Inputs personalizados */
.input-group {
    position: relative;
    width: 100%;
    margin: 8px 0;
}

.input-group input {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    padding-left: 40px;
    width: 100%;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

/* =========================================
   5. CONTENEDOR PRINCIPAL Y ANIMACIONES
   ========================================= */
.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    width: 900px;
    max-width: 100%;
    min-height: 550px;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

/* --- A. LOGIN (Visible por defecto a la izquierda) --- */
.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

/* Al activar el panel derecho, el login se mueve a la derecha (detrás del registro) */
.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

/* --- B. REGISTRO (Oculto por defecto a la izquierda) --- */
.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

/* Al activar panel, el registro se mueve a la derecha y aparece */
.container.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; }
}

/* =========================================
   6. OVERLAY (PANEL DESLIZANTE DE COLOR)
   ========================================= */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%; /* Empieza a la DERECHA */
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

/* Al activar, el contenedor del overlay se mueve a la IZQUIERDA */
.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

/* Fondo degradado naranja */
.overlay {
    background: var(--gradiente);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

/* Contenido de texto dentro del panel naranja */
.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-panel h1 { color: #FFFFFF; }

/* Panel Izquierdo (Aparece cuando estamos en Registro) -> Botón "Iniciar Sesión" */
.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

/* Panel Derecho (Aparece cuando estamos en Login) -> Botón "Registrarse" */
.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    background-color: #222;
    color: #fff;
    font-size: 14px;
    bottom: 0;
    position: fixed;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 999;
}

/* =========================================
   8. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    
    /* Contenedor fluido */
    .container {
        width: 100%;
        min-height: 100vh;
        height: auto;
        border-radius: 0;
        box-shadow: none;
        overflow-x: hidden;
        position: relative;
    }

    .form-container {
        width: 100%;
        height: 70%; /* Formularios arriba */
        top: 0;
        left: 0;
        padding: 0 20px;
    }

    /* Reseteo de posiciones de escritorio */
    .sign-in-container, 
    .sign-up-container {
        width: 100%;
        left: 0;
        transform: none; 
        position: absolute;
    }

    /* Visibilidad */
    .sign-in-container {
        z-index: 2;
        opacity: 1;
        pointer-events: all;
    }
    
    .sign-up-container {
        z-index: 1;
        opacity: 0;
        pointer-events: none;
    }

    /* Estados Activos Móvil */
    .container.right-panel-active .sign-in-container {
        opacity: 0;
        z-index: 1;
        pointer-events: none;
        transform: translateY(-20px);
    }

    .container.right-panel-active .sign-up-container {
        opacity: 1;
        z-index: 5;
        pointer-events: all;
        transform: translateY(0);
        animation: show 0.6s;
    }

    /* Overlay abajo en móvil */
    .overlay-container {
        width: 100%;
        height: 30%; /* Botones abajo */
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none !important;
        border-radius: 30px 30px 0 0;
    }

    .overlay {
        width: 200%;
        left: -100%;
        transform: translateX(0);
    }

    .container.right-panel-active .overlay {
        transform: translateX(50%);
    }

    .overlay-panel {
        width: 50%;
        padding: 0 15px;
        top: 0;
        right: auto;
    }

    /* Corrección de textos en móvil */
    .overlay-left { transform: translateX(0); }
    .overlay-right { right: 0; transform: translateX(0); }
    
    .overlay-panel h1 { font-size: 1.2rem; }
    .overlay-panel p { font-size: 0.85rem; margin: 10px 0 15px; }
}
