@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

body {
    background-color: #7E3F8F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Roboto', sans-serif;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
}

.welcome-screen, .form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #9E55A1;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}

form {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

.logo, .logo-form {
    width: 150px;
    margin-bottom: 20px;
}

.tarjetas-container {
    position: relative;
    width: 100%;
    height: 200px; /* Ajustar según la altura necesaria para las tarjetas */
    overflow: hidden;
}

.tarjeta {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    pointer-events: none; /* Prevent interaction with hidden cards */
}

.tarjeta.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto; /* Allow interaction with active card */
}

.tarjeta.next {
    transform: translateX(100%);
}

.tarjeta.prev {
    transform: translateX(-100%);
}

label {
    width: 100%;
    margin: 10px 0 5px 0;
    font-size: 1rem; /* Ajustar tamaño de fuente */
}

input, select {
    width: 100%; /* Ajustar el ancho según el margen de los botones */
    margin: 10px 0; /* Igualar el margen de los botones */
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 1rem; /* Ajustar tamaño de fuente */
    background-color: white;
    color: black;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="black" class="bi bi-chevron-down" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/> </svg>') no-repeat right 10px center;
}

select option {
    color: black;
}

.botones {
    display: flex;
    flex-direction: column;
    width: 100%; /* Ajustar el ancho según el margen del input */
    margin: 20px 0 0 0; /* Igualar el margen del input */
}

button, #comenzar {
    padding: 10px 20px; /* Ajustar el padding */
    height: 44px; /* Ajustar altura para que todos los botones tengan el mismo alto */
    background-color: #5C217C;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif; /* Aplicar la fuente Roboto a los botones */
    font-size: 1rem; /* Ajustar tamaño de fuente */
    margin: 10px 0; /* Margen entre botones */
}

#finalizar {
    display: none;
}

#comenzar {
    margin-top: 20px;
    width: 100%; /* Ajustar el ancho para que coincida con los inputs */
    background-color: #5C217C;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif; /* Aplicar la fuente Roboto a los botones */
    font-size: 1rem; /* Ajustar tamaño de fuente */
    height: 44px; /* Ajustar altura para que todos los botones tengan el mismo alto */
    display: flex;
    align-items: center;
    justify-content: center;
}

#siguiente, #finalizar {
    margin-left: auto;
}

/* Animación de temblor */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.2s;
}

/* Media queries para responsividad */
@media (max-width: 600px) {
    .container {
        padding: 12px; /* Ajustar padding */
    }

    .welcome-screen, .form-container {
        padding: 12px; /* Ajustar padding */
        border-radius: 5px; /* Reducir el border-radius */
    }

    .logo, .logo-form {
        width: 200px; /* Ajustar el tamaño del logo */
    }

    .tarjetas-container {
        height: 180px; /* Ajustar la altura de las tarjetas */
    }

    label, input, select {
        font-size: 1.15rem; /* Reducir el tamaño de fuente */
    }

    .botones {
        flex-direction: column; /* Cambiar la dirección a columna */
        width: 100%; /* Ancho completo */
        margin: 20px 0 0 0; /* Ajustar margen */
    }

    #siguiente, #finalizar {
        order: -1; /* Poner "Siguiente" y "Finalizar" arriba */
    }

    button, #comenzar {
        width: 100%; /* Ancho completo */
        margin: 10px 0; /* Ajustar margen */
    }
}

/* Media query para pantallas grandes */
@media (min-width: 601px) {
    .container {
        padding: 20px; /* Ajustar padding */
        transform: scale(1.15); /* No escalar en pantallas grandes */
    }

    .welcome-screen, .form-container {
        border-radius: 10px; /* Mantener el border-radius */
    }

    .logo, .logo-form {
        width: 200px; /* Mantener el tamaño del logo */
    }

    .tarjetas-container {
        height: 200px; /* Mantener la altura de las tarjetas */
    }

    label, input, select {
        font-size: 1rem; /* Mantener el tamaño de fuente */
    }

    .botones {
        flex-direction: row; /* Cambiar la dirección a fila */
        width: 100%; /* Ajustar el ancho de los botones */
    }

    button, #comenzar {
        width: calc(50% - 10px); /* Ajustar el ancho de los botones */
        margin: 0 5px; /* Ajustar margen */
    }
}
