/* View Transitions - Animación deslizante*/

@view-transition{
    navigation: auto;
}

::view-transition-group(*){
    animation-duration: 1s;
}

::view-transition-old(root){
    animation: slide-out-to-left 1s forwards;
}

::view-transition-new(root){
    animation: slide-in-from-right 1s forwards;
}

@keyframes slide-out-to-left{
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slide-in-from-right{
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ============================= */
/* 🔃 RESETEO Y BASE             */
/* ============================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins');

* {
    box-sizing: border-box;
}

body {
    display: flex;
    background-color: #f6f5f7;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: "Poppins", sans-serif;
    overflow: hidden;
    height: 100vh;
    margin: 0;
}

h1 {
    font-weight: 700;
    letter-spacing: -1.5px;
    margin: 0 0 15px;
}

h1.title {
    font-size: 45px;
    line-height: 45px;
    text-shadow: 0 0 10px rgba(16, 64, 74, 0.5);
}

p {
    font-size: 14px;
    font-weight: 100;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
    text-shadow: 0 0 10px rgba(16, 64, 74, 0.5);
}

span {
    font-size: 14px;
    margin-top: 25px;
}

a {
    color: #333;
    font-size: 16px;
    text-decoration: none;
    margin: 15px 0;
    transition: 0.3s ease-in-out;
}

a:hover {
    color: #abb6b7;
}

.social-container{
    display: flex;
    width: 100px;
    justify-content: space-around;
}

.content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 50px;
    align-items: center;
    justify-content: space-around;
}

.content .checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.content input {
    accent-color: #333;
    width: 12px;
    height: 12px;
}

.content label {
    font-size: 14px;
    user-select: none;
    padding-left: 5px;
}

button {
    position: relative;
    border-radius: 20px;
    border: 1px solid #72e681;
    background-color: #72e681;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 10px;
    padding: 12px 80px;
    letter-spacing: 1px;
    text-transform: capitalize;
    transition: 0.3s ease-in-out;
}

button:hover {
    letter-spacing: 3px;
}

button.ghost {
    background-color: rgba(225,225,225,0.2);
    border: 2px solid #fff;
    color: #fff;
}

button.ghost i {
    position: absolute;
    opacity: 0;
    transition: 0.3s ease-in-out;
}

button.ghost i.register { right: 70px; }
button.ghost i.login { left: 70px; }

button.ghost:hover i.register { right: 40px; opacity: 1; }
button.ghost:hover i.login { left: 40px; opacity: 1; }

form {
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

input {
    background-color: #eee;
    border-radius: 10px;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
}

/* Contenedor de input + botón de mostrar/ocultar */
.password-container {
    position: relative;
    width: 100%;
}

/* Input de contraseña dentro del contenedor */
.password-container input {
    width: 100%;
    padding-right: 40px; /* espacio para el botón */
}

/* Botón de mostrar/ocultar */
.password-container .toggle-pass {
    position: absolute;
    top: 35%;
    right: 10px; /* margen desde el borde derecho */
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    font-size: 16px;
    padding: 5px;
}

.container {
    background-color: #fff;
    border-radius: 25px;
    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: 100%;
    max-width: 420px;
    min-height: 540px;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    transition: all 0.6s ease-in-out;
}

.login-container {
    left: 0;
    z-index: 2;
}

.register-container {
    left: 0;
    z-index: 1;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s ease-in-out;
}

.container.mobile-register-active .register-container {
    transform: translateY(0);
    z-index: 5;
    opacity: 1;
}

.container.mobile-register-active .login-container {
    opacity: 0;
}

.mobile-switch {
    background-color: transparent;
    color: #4bb6b7;
    padding: 10px 20px;
    border: none;
    font-size: 14px;
    margin-top: 10px;
    cursor: pointer;
}

.overlay-container {
    display: none;
}

/* TABLET (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 768px;
    }

    .form-container {
        width: 50%;
    }

    .register-container {
        opacity: 0;
        z-index: 1;
        transform: translateX(0);
    }

    .container.right-panel-active .register-container {
        transform: translateX(100%);
        opacity: 1;
        z-index: 5;
    }

    .login-container {
        transform: translateX(0);
    }

    .container.right-panel-active .login-container {
        transform: translateX(100%);
    }

    .overlay-container {
        display: block;
        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: translate(-100%);
    }

    .mobile-switch{
        display: none;
    }

    .social-container{
        display: flex;
        width: 100px;
        justify-content: space-around;
    }

    .overlay {
        background-image: url('../images/diente.gif');
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 0 0;
        color: #fff;
        position: relative;
        left: -100%;
        height: 100%;
        width: 200%;
        transform: translateX(0);
        transition: transform 0.6s ease-in-out;
    }

    .overlay::before {
        content: "";
        position: absolute;
        left: 0; right: 0; top: 0; bottom: 0;
        background: linear-gradient(to top, rgba(46,94,109,0.4) 40%, rgba(46,94,109,0));
    }

    .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%); }
}

/* PC (1024px en adelante) */
@media (min-width: 1024px) {
    .container {
        max-width: 768px;
    }

    .form-container {
        width: 50%;
    }

    .register-container {
        opacity: 0;
        z-index: 1;
        transform: translateX(0);
    }

    .container.right-panel-active .register-container {
        transform: translateX(100%);
        opacity: 1;
        z-index: 5;
    }

    .login-container {
        transform: translateX(0);
    }

    .container.right-panel-active .login-container {
        transform: translateX(100%);
    }

    .overlay-container {
        display: block;
        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: translate(-100%);
    }

    .mobile-switch{
        display: none;
        }

    .overlay {
        background-image: url('../images/diente.gif');
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 0 0;
        color: #fff;
        position: relative;
        left: -100%;
        height: 100%;
        width: 200%;
        transform: translateX(0);
        transition: transform 0.6s ease-in-out;
    }

    .overlay::before {
        content: "";
        position: absolute;
        left: 0; right: 0; top: 0; bottom: 0;
        background: linear-gradient(to top, rgba(46,94,109,0.4) 40%, rgba(46,94,109,0));
    }

    .container.right-panel-active .overlay {
        transform: translateX(50%);
    }

    .social-container{
        display: flex;
        width: 100px;
        justify-content: space-around;
    }

    .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%); }
}

/* Contenedor del mensaje */
#mensaje {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* No bloquea botones */
}

/* Mostrar mensaje */
#mensaje.mensaje {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Tipos de mensaje */
#mensaje.exito {
    background-color: #4caf50; /* Verde */
    color: white;
    border: 1px solid #388e3c;
}

#mensaje.error {
    background-color: #f44336; /* Rojo */
    color: white;
    border: 1px solid #d32f2f;
}

#mensaje.info {
    background-color: #2196f3; /* Azul */
    color: white;
    border: 1px solid #1976d2;
}

/* Animación de entrada/salida */
#mensaje.mensaje {
    animation: slideDown 0.5s forwards;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
