﻿/* style.css */
* {
    box-sizing: border-box;
}

body {
    background: url('/img/fondo-login.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    margin: 0;
}
    body::before,
    body::after {
        content: "";
        position: fixed;
        width: 200px;
        height: 200px;
        background: white;
        z-index: 1;
    }

    body::before {
        top: 0;
        right: 0;
        border-bottom-left-radius: 100%;
    }

    body::after {
        bottom: 0;
        left: 0;
        border-top-right-radius: 100%;
    }

h1 {
    font-weight: bold;
    margin: 0;
}

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

span {
    font-size: 12px;
}

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

button {
    border-radius: 20px;
    border: 1px solid #0052D4;
    background-color: #0052D4;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
}

    button:active {
        transform: scale(0.95);
    }

    button:focus {
        outline: none;
    }

form {
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

input {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    border-radius: 20px;
}

.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; /* <--- ANCHO */
    max-width: 100%;
    min-height: 600px; /* <--- ALTO */
}


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

.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {
    0% {
        opacity: 0;
        transform: translateX(0%);
    }

    100% {
        opacity: 1;
        transform: translateX(100%);
    }
}

.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.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(to right, #0052D4, #4364F7);
    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%);
}

.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-left {
    transform: translateX(-20%);
}

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

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}
/* Grupo input con icono */
.input-group {
    position: relative;
    width: 100%;
}

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

    .input-group input {
        padding-left: 40px;
    }

/* Botón de acceder más moderno */
.btn-acceder {
    border-radius: 25px;
    border: none;
    background: linear-gradient(to right, #0052D4, #4364F7);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

    .btn-acceder:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(0,82,212,0.3);
    }

/* Mensaje de error con icono */
.error-alert {
    margin-top: 20px;
    background: #ffe0e0;
    color: #b30000;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
a.btn {
    display: inline-block;
    border-radius: 25px;
    background: linear-gradient(to right, #0052D4, #4364F7);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 40px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: 15px;
    cursor: pointer;
}

    a.btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(0,82,212,0.4);
    }
button.btn-white {
    display: inline-block;
    border-radius: 25px;
    background: #ffffff;
    color: #0052D4;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 40px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid #ffffff;
    margin-top: 15px;
    cursor: pointer;
}

    button.btn-white:hover {
        background: #f0f0f0;
        box-shadow: 0 4px 15px rgba(0,82,212,0.3);
        transform: scale(1.05);
    }
.logo {
    display: block;
    margin: 0 auto 40px auto;
    max-width: 1440px; /* El tamaño visual */
    width: 80%; /* Responsive */
    height: auto;
}
/* =========================
   ADAPTACIÓN RESPONSIVE MÓVIL
   (ASP.NET Core .NET 8 – VS 2022)
   ========================= */

/* Tablets / portátiles pequeños */
@media (max-width: 992px) {
    body {
        height: auto;
        min-height: 100vh;
        padding: 16px 12px;
        align-items: stretch;
    }

    .container {
        width: 100%;
        max-width: 680px;
        min-height: unset;
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(0,0,0,.15);
        margin: 0 auto;
    }

    /* Que los paneles de formulario ocupen ancho completo y se apilen */
    .form-container {
        position: relative;
        width: 100%;
        height: auto;
        transform: none !important;
    }

    .sign-in-container,
    .sign-up-container {
        width: 100%;
        left: 0;
    }

    /* El overlay pasa a bloque debajo del login */
    .overlay-container {
        position: relative;
        left: 0;
        width: 100%;
        height: auto;
        transform: none !important;
        overflow: visible;
    }

    .overlay {
        left: 0;
        width: 100%;
        height: auto;
        transform: none !important;
        border-radius: 0 0 14px 14px;
    }

    .overlay-panel {
        position: relative;
        width: 100%;
        height: auto;
        padding: 24px 22px;
        transform: none !important;
        text-align: center;
    }

    /* Tipografías y paddings algo más compactos */
    form {
        padding: 28px 28px 16px;
    }

    h1 {
        font-size: 26px;
    }

    p {
        font-size: 14px;
        line-height: 1.5;
    }

    .btn-acceder, a.btn, button.btn-white {
        padding: 12px 32px;
        font-size: 13px;
    }

    /* Logo más razonable en pantallas medias */
    .logo {
        width: auto;
        max-width: 220px;
        height: auto;
        margin-bottom: 28px;
    }

    /* Esquinas decorativas más pequeñas para que no tapen nada */
    body::before, body::after {
        width: 140px;
        height: 140px;
        opacity: .85;
    }
}

/* =========================================================
   MODO MÓVIL: layout vertical con el mismo toggle de clase
   (.NET 8 + VS 2022)  —  sin cambiar HTML ni JS
   ========================================================= */
@media (max-width: 576px) {

    /* Fondo y contenedor general */
    body {
        height: auto;
        min-height: 100vh;
        padding: 16px 12px;
        align-items: stretch;
    }

        body::before, body::after {
            width: 90px;
            height: 90px;
            opacity: .7;
        }

    .container {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        border-radius: 12px;
        overflow: hidden;
        /* ---> PASAMOS A GRID VERTICAL (form login / overlay / form alta) */
        display: grid;
        grid-template-rows: auto auto auto;
        min-height: unset;
    }

    /* --------- FORMULARIOS (mismo markup, nuevas reglas) --------- */
    .form-container {
        position: relative; /* anula el absolute del desktop */
        width: 100%;
        height: auto;
        transform: none !important;
        transition: none;
    }

    /* Login visible por defecto */
    .sign-in-container {
        grid-row: 1;
        opacity: 1;
        max-height: 1000px; /* animación suave por altura */
        overflow: hidden;
        transition: max-height .5s ease, opacity .5s ease;
        z-index: 1;
    }

    /* Registro oculto por defecto */
    .sign-up-container {
        grid-row: 3;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .5s ease, opacity .5s ease;
        z-index: 1;
    }

    /* Al activar la clase (clic en “Ver información”), intercambiamos */
    .container.right-panel-active .sign-in-container {
        opacity: 0;
        max-height: 0;
        pointer-events: none;
    }

    .container.right-panel-active .sign-up-container {
        opacity: 1;
        max-height: 1000px;
        pointer-events: auto;
    }

    /* --------- OVERLAY como bloque informativo entre secciones --------- */
    .overlay-container {
        position: relative;
        left: 0;
        width: 100%;
        height: auto;
        transform: none !important;
        overflow: visible;
        grid-row: 2;
        z-index: 2; /* por encima de fondos, no tapa botones */
    }

    .overlay {
        left: 0;
        width: 100%;
        height: auto;
        transform: none !important;
        border-radius: 10px;
        background: linear-gradient(to right, #0052D4, #4364F7);
    }

    .overlay-panel {
        position: relative;
        width: 100%;
        height: auto;
        padding: 18px 16px;
        transform: none !important;
        text-align: center;
    }

    /* En móvil no “deslizamos” el overlay: alternamos su contenido.
     El JS sigue añadiendo/quitando .right-panel-active */
    .overlay-left,
    .overlay-right {
        display: none;
    }
    /* Estado por defecto: se ve el de la derecha (marketing + “Ver información”) */
    .overlay-right {
        display: block;
    }
    /* Estado alterno (tras pulsar Ver información): mostramos “¿Ya tienes cuenta?” */
    .container.right-panel-active .overlay-right {
        display: none;
    }

    .container.right-panel-active .overlay-left {
        display: block;
    }

    /* --------- Ajustes visuales (tipos, inputs, logo, botones) --------- */
    form {
        padding: 22px 18px 14px;
    }

    h1 {
        font-size: 22px;
    }

    p {
        font-size: 13px;
        margin: 14px 0 20px;
    }

    span {
        font-size: 12px;
    }

    .input-group i {
        left: 12px;
        font-size: 13px;
    }

    .input-group input {
        padding: 11px 14px 11px 38px;
        margin: 6px 0;
        border-radius: 16px;
        font-size: 14px;
    }

    .btn-acceder, a.btn, button.btn-white {
        padding: 11px 22px;
        font-size: 12px;
        letter-spacing: .5px;
    }

    .error-alert {
        font-size: 12px;
        padding: 8px 10px;
        margin-top: 14px;
    }

    /* Logo compacto; misma clase .logo */
    .logo {
        max-width: 160px;
        width: 70%;
        height: auto;
        margin-bottom: 20px;
    }

    /* IMPORTANTE: anulamos TODAS las transiciones horizontales del desktop
     para que no afecten en móvil */
    .container.right-panel-active .sign-in-container,
    .container.right-panel-active .sign-up-container,
    .container.right-panel-active .overlay,
    .container.right-panel-active .overlay-container {
        transform: none !important;
    }
}
}