.main{
    width: 100%;
    max-width: 550px;
    container-type: inline-size;
    container-name: form;
}

.form{
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form__group{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form__group--hidden{
    display: none;
}

.form__label{
    font-weight: 500;
    font-size: 0.875em;
    color: var(--dark-gray);
}

.form__input{
    width: 100%;
    padding: 10px 16px;
    background-color: #FDFCFC;
    border: 1px solid #B6B6B6;
    border-radius: 4px;
    font-size: 0.875em;
    font-weight: 300;
    transition: .3s ease-in-out border-color;
}

.form__input.error{
    border-color: #ed4646;
}

.form__input.error + span{
    color: #ed4646;
}

.form__input--select{
    appearance: none;
    background-image: url('../../assets/svg/chevron-down.svg');
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
}

.form__input:focus-visible{
    outline: none;
    border-color: var(--primary);
}

.form__input.error:focus-visible, .form__input--datetime:invalid{
    border-color: #ed4646;
}

.form__buttons{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form__submit, .form__return{
    flex-grow: 1;
    height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1em;
    line-height: 22px;
    cursor: pointer;
    transition: .3s ease-in-out scale;
}

.form__submit:hover, .form__return:hover, .form__submit:focus, .form__return:focus{
    scale: 1.03;
}

.form__submit i, .form__return i{
    font-size: 20px;
}

.form__submit{
    background-color: var(--primary);
}

.form__return{
    background-color: var(--pale-gray);
    text-decoration: none;
}

@container form (min-width: 400px){
    .form__label{
        font-size: 1em;
    }
    
    .form__input{
        font-size: 1em;
    }

    .form__buttons{
        flex-direction: row;
        gap: 28px;
    }

    .form__submit, .form__return{
        width: 50%;
        font-size: 1.0625em;
    }
}