* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

body {
background-image: url("./assets/img/cuidad-violeta.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-family: 'Lato', sans-serif;
}

h2 {
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.993);
font-family: "Inter", sans-serif;
font-optical-sizing: auto;
font-weight: 300;
font-style: normal;
}

label {
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.993);
font-weight: 400;
font-style: normal;
cursor: pointer;
}

/* CONTENEDOR PRINCIPAL */
.contenedor-general {
display: flex;
width: 700px;
height: 500px;
border: 2px solid rgb(243, 5, 164);
border-radius: 8px;
overflow: hidden;
font-family: 'Lato', sans-serif;
color: white;
background-color: rgba(146, 33, 180, 0.562);
}

/* Formularios flexibles */
.formulario {
flex: 1;
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: flex-start;
padding: 20px;
transition: flex 0.5s ease;
position: relative;
overflow: hidden;
}

/* Línea blanca vertical de 90% en formularios colapsados */
.formulario::after {
content: "";
position: absolute;
top: 5%;
height: 90%;
width: 2px;
background-color: white;
transition: all 0.3s ease;
opacity: 0;
}

/* Mostrar línea en REGISTRO colapsado (borde izquierdo) */
#login-radio:checked ~ .registro::after {
left: 0;
opacity: 1;
}

/* Mostrar línea en LOGIN colapsado (borde derecho) */
#registro-radio:checked ~ .login::after {
right: 0;
opacity: 1;
}

/* Títulos verticales por defecto */
.titulo {
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 25px;
cursor: pointer;
user-select: none;
padding-left: 10px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease;
height: auto;
width: auto;
box-sizing: border-box;
border-bottom: none;
margin-top: 0;
position: relative;
}

/* Título horizontal cuando formulario activo */
#login-radio:checked ~ .login .titulo,
#registro-radio:checked ~ .registro .titulo {
writing-mode: horizontal-tb;
transform: none;
font-size: 24px;
margin-bottom: 30px;
border-bottom: 2px solid white;
padding-left: 0;
padding-bottom: 10px;
align-self: flex-start;
width: 100%;
box-sizing: border-box;
}

/* FORZAR que los formularios ocultos mantengan título arriba */
#login-radio:checked ~ .registro,
#registro-radio:checked ~ .login {
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: flex-start;
}

/* Formularios reales */
.formulario form {
width: 100%;
display: flex;
flex-direction: column;
gap: 6px;
transition: opacity 0.3s ease;
max-height: 300px;
justify-content: flex-start;
margin-top: 20px;
}

input {
width: 180px;
padding: 5px;
border-radius: 5px;
border: none;
transition: all 0.5s ease;
}

input:focus {
outline: none;
width: 220px;
}

button {
color: rgb(240, 1, 168);
background-color: white;
font-size: 12px;
cursor: pointer;
border: 2px solid rgb(226, 4, 152);
border-radius: 5px;
padding: 7px 20px;
transition: all 0.3s ease;
width: auto;
max-width: 150px;
align-self: flex-start;
}

button:hover {
text-decoration: underline;
color: rgb(255, 3, 179);
}

/* Por defecto: login activo */
#login-radio:checked ~ .login {
flex: 4;
}

#login-radio:checked ~ .registro {
flex: 1;
}

/* Cuando registro está activo */
#registro-radio:checked ~ .registro {
flex: 4;
}

#registro-radio:checked ~ .login {
flex: 1;
}

/* Ocultar contenido de formulario cuando está en flex:1 */
#login-radio:checked ~ .registro form,
#registro-radio:checked ~ .login form {
opacity: 0;
pointer-events: none;
height: 0;
margin: 0;
padding: 0;
transition: opacity 0.3s ease, height 0.3s ease;
}

#login-radio:checked ~ .login form,
#registro-radio:checked ~ .registro form {
opacity: 1;
pointer-events: auto;
height: auto;
margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
.contenedor-general {
    flex-direction: column;
    width: 90%;
    height: auto;
}

.formulario {
    flex: 1 !important;
    width: 100%;
}

.titulo {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    font-size: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid white;
    align-self: flex-start;
}

.formulario::after {
    display: none !important;
}
}
