.login{
    width: 31.25rem;
    height: 31.25rem;    
    margin: 6.25rem auto; /* Centrat */

    border-radius: 1.5625rem;
    padding: 1.875rem;

    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;

    background-color: #F3F6F6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ajust per al formulari de signup que té més camps */
#signup-form {
    height: auto; /* Permet que l'altura s'ajusti automàticament */
    min-height: 31.25rem;
    justify-content: flex-start;
    gap: 1.25rem; /* Espai entre elements */
}

.login div{
    width: 25rem;
    height: 3.75rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: white;
    border-radius: 1.5625rem;
}
.login div input{
    width: 18.75rem;
    margin: 0.625rem;
    border: none;
    outline: none;
    background: none;
    color: black;
    padding: 0.3125rem;
}
.login i{
    font-size: 1.875rem;
}
.login div:focus-within{
    border:0.0625rem solid #bb86fc;  
}
.login:hover {
    box-shadow: 0 0.625rem 5.625rem #bb86fc;  
}

.login_singup{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    border-radius: 1.5625rem;
    border: none !important;
    overflow: hidden;
    background: none !important; /* Elimina el fons blanc */
    height: auto !important; /* Sobreescriu l'altura fixa */
}
.login_singup button{ 
    width: 12.5rem;
    height: 3.75rem;
    border: none;
    transition: all 0.3s ease;

    background: gray;
    font-size: 1.5625rem;
    margin: 0;
}
.login_singup button:hover {
    color: white;
    transform: scale(1.1);
    font-size: 1.75rem;
    transition: all 0.1s ease;
    z-index: 2;
}

.log_in, .sing_up {
    font-size: 1.5625rem;
}
.log_in{
    border-top-left-radius: 1.5625rem;
    border-bottom-left-radius: 1.5625rem;
    border-top-right-radius: 0rem;
    border-bottom-right-radius: 0rem;
    background: gray;
    font-size: 1.5625rem;
}
.sing_up{
    border-top-left-radius: 0rem;
    border-bottom-left-radius: 0rem;
    border-top-right-radius: 1.5625rem;
    border-bottom-right-radius: 1.5625rem;
    background: gray;
    font-size: 1.5625rem;
}

.log_in.activo, .sing_up.activo {
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    font-size: 1.875rem;
    z-index: 1;
}
.log_in:active, .sing_up:active, .log_in:hover, .sing_up:hover {
    transform: scale(1.02);
    font-size: 1.75rem;
    transition: all 0.1s ease;
}

/* Botons d'acció */
#inicia, #registra {
    width: 12.5rem;
    height: 3.125rem;
    font-size: 1.5625rem;
    border: none;
    border-radius: 1.5625rem;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.25rem;
}

#inicia:hover, #registra:hover {
    transform: scale(1.05);
    box-shadow: 0 0.3125rem 0.9375rem rgba(187, 134, 252, 0.4);
}

/* Efecte de transició suau entre formularis */
.login {
    animation: fadeIn 0.3s ease;
}

.missatge {
    padding: 10px;
    margin: 10px auto;
    border-radius: 5px;
    text-align: center;
    max-width: 400px;
}
.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* responsive */
@media screen and (max-width: 500px) {
    .login {
        width: 85% !important;
        margin: 1.25rem 0;
    }
    .login div {
        width: 85%;
    }
    .login div input {
        width: 85%;
    }
    .formulari_user_pw {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .log_in, .sing_up {
        font-size: 1.25rem !important;
    }
}
