button, input, optgroup, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.5;
    word-spacing: 0.05em;
    margin: 0;
}

button, select {
    text-transform: none; /* Remove the inheritance of text transform in Edge and Firefox */
}

button, [type='button'], [type='reset'], [type='submit'] {
    -webkit-appearance: button; /* Correct the inability to style clickable types in iOS and Safari */
}

button{
    cursor: pointer;
    background-color: transparent;
    padding: 0;
}

button:focus:not(:focus-visible) {
    outline: 0;
}

label {
    display: inline-block
}

.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.select {
    cursor: pointer;
    width: 100%;
    height: auto;
    padding: 0.5rem 2rem 0.5rem 1rem;
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
    border-radius: 4px;
    background-color: var(--yellow);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    white-space: pre-wrap; /* Allows text to wrap */
    overflow-wrap: break-word; /* Allows text to break */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 20px;
}

[type='search'] {
    -webkit-appearance: textfield; /* Correct the odd appearance in Chrome and Safari */
    outline-offset: -2px; /* Correct the outline style in Safari */
}

input {
    &[type='text'],
    &[type='email'],
    &[type='password']{
        display: block;
        width: 100%;
        padding: 0.6rem 1.2rem;
        font-size: 1.6rem;
        font-weight: 400;
        line-height: 1.5;
        color: #212529;
        background-color: #fff;
        background-clip: padding-box;
        border: 1px solid #ced4da;
        border-radius: 0.6rem;
        appearance: none;
        transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;

        &::placeholder {
            color: #6c757d;
            opacity: 1;
        }
    }

    &[type='checkbox'],
    &[type='radio']{
        cursor: pointer;
        width: 2.5rem;
        height: 2.5rem;
        flex-shrink: 0;
        background-color: rgba(0,0,0,0);
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        border: 1px solid #b6c1d2;
        border-radius: 0.25em;
    }
}

input:focus {
    &[type='text'],
    &[type='email'],
    &[type='password'] {
        color: #212529;
        background-color: #fff;
        border-color: #86b7fe;
        outline: 0;
        box-shadow: 0 0 0 0.4rem rgba(13, 110, 253, .25);
    }
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset!important; // otherwise chrome add a light blue background when input is autocompleted
}

/* https://getbootstrap.com/docs/5.2/forms/floating-labels/ */
.form-floating {
    position: relative;
    margin-top: 1.5rem;

    > input {
        height: calc(5.6rem + 2px);
        line-height: 1.25;
        padding: 1.6rem 1.2rem;

        &::placeholder {
            color: transparent;
        }

        &:focus,
        &:not(:placeholder-shown) {
            padding-top: 2.6rem;
            padding-bottom: 1rem;
        }
        /* Duplicated because `:-webkit-autofill` invalidates other selectors when grouped */
        &:-webkit-autofill {
            padding-top: 2.6rem;
            padding-bottom: 1rem;
        }
    }

    > label {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding: 1.6rem 1.2rem;
        overflow: hidden;
        text-align: start;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
        border: 1px solid transparent;
        transform-origin: 0 0;
        transition: opacity .1s ease-in-out,transform .1s ease-in-out;
    }

    > input:focus,
    > input:not(:placeholder-shown) {
        ~ label {
            opacity: .65;
            transform: scale(.85) translateY(-0.8rem) translateX(0.24rem);
        }
    }

    > input:-webkit-autofill {
        ~ label {
            opacity: .65;
            transform: scale(.85) translateY(-0.8rem) translateX(0.24rem);
        }
    }
}

.form-submitted {
    /*.input-valid:not([type='password']){*/
    /*    padding-right: 4rem;*/
    /*    border-color: var(--green-flash);*/
    /*    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2300d27a' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");*/
    /*    background-repeat: no-repeat;*/
    /*    background-position: right 0.5rem center;*/
    /*    background-size: 2.8rem 2.8rem;*/
    /*    &:focus{*/
    /*        border-color: var(--green-flash);*/
    /*        box-shadow: 0 0 0 0.4rem rgba(0,210,122,.25);*/
    /*    }*/
    /*}*/
    .input-invalid{
        padding-right: 4rem;
        border-color: var(--red);
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e63757'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e63757' stroke='none'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.8rem center;
        background-size: 2.8rem 2.8rem;

        &:focus{
            border-color: var(--red);
            box-shadow: 0 0 0 0.4rem rgba(230,55,87,.25);
        }

        &[type='checkbox']{
            outline: 1px solid red;
        }
    }
}

.form-error-msg{
    margin-top: 0.8rem!important;
    margin-left: 0.8rem!important;
    text-align: left;
    font-size: 1.44rem;
    font-weight: 500;
    color: var(--red);
}

.form-check-top{
    padding: 1rem;
    background-color: var(--black-almost);
    color: #ffffff;
    text-align: center;
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
    box-shadow: var(--shadow-card);
}

.form-check-frame{
    padding: 1.5rem 0.5rem;
    background: #FFFFFF;
    border: 2px solid #000000;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    box-shadow: var(--shadow-card);
}
.form-check{
    user-select: none;
    display: flex;
    align-items: center;
    margin: 1rem;
    text-align: left;

    > label{
        cursor: pointer;
        margin-left: 1.6rem;
    }
}