:where(
    button,
    .button,
    input:not([type="checkbox"]):not([type="radio"]),
    .select select,
    textarea
) {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: none;
    display: inline-flex;
    font-size: 1rem;
    justify-content: flex-start;
    line-height: 1.5;
    padding: 0.45rem 0.8rem;
    vertical-align: top;
}

input[type="checkbox"] {
    accent-color: var(--primary-orange-darker);
}

:where(
    input:not([type="checkbox"]):not([type="radio"]),
    .select select,
    textarea
) {
    background-color: hsl(0deg, 0%, 100%);
    border-color: hsl(0deg, 0%, 86%);
    border-radius: 4px;
    color: hsl(0deg, 0%, 21%);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
textarea {
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
    max-width: 100%;
    width: 100%;
}

.input.error,
input.error,
.select select.error,
textarea.error {
    border-color: var(--error-red);
    box-shadow: 0 0 0 1px rgba(214, 82, 67, 0.3);
}

.invalid-value {
    margin-top: 0.35rem;
    color: var(--error-red);
    font-size: 0.95rem;
}

.is-fullwidth {
    display: block;
    width: 100%;
}

textarea {
    display: block;
    max-width: 100%;
    min-width: 100%;
    resize: vertical;
}

textarea:not([rows]) {
    max-height: 40em;
    min-height: 8em;
}

:where(.button, button) {
    background-color: #fff;
    /* Equivalent to hsl(0deg, 0%, 100%) */
    border: 1px solid hsl(0, 0%, 86%);
    color: hsl(0, 0%, 21%);
    cursor: pointer;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition:
        color 0.2s linear,
        background-color 0.2s linear,
        border-color 0.2s linear;
}

.button:hover,
button:hover {
    border-color: var(--primary-blue-light);
    background-color: var(--primary-blue-lighter);
}

.button.primary,
button.primary {
    background-color: var(--primary-blue);
    border-color: transparent;
    color: #fff;
}

.button.primary:hover,
button.primary:hover {
    background-color: #fff;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.button.orange,
button.orange {
    background-color: var(--primary-orange);
    border-color: transparent;
    color: #fff;
}

.button.orange:hover,
button.orange:hover {
    background-color: #fff;
    color: var(--primary-orange-darker);
    border-color: var(--primary-orange);
}

.button.day-delete,
button.day-delete {
    font-size: 0.85rem;
    border-radius: 50%;
    padding: 4px 6px;
    background: var(--error-red);
    border-color: white;
    color: white;
}

.button.day-delete:hover,
button.day-delete:hover {
    background: white;
    border-color: var(--error-red);
    color: var(--error-red);
}

.button.error,
button.error {
    background-color: var(--error-red);
    color: #fff;
}

.button.error:hover,
button.error:hover {
    background-color: #fff;
    color: var(--error-red);
    border-color: var(--error-red);
}

.button.transparent,
button.transparent {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--primary-blue) !important;
}

.button.transparent:hover,
button.transparent:hover {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    text-decoration: underline;
}

/* Base styles for select element */
.select {
    position: relative;
    width: fit-content;
}

.select select {
    -moz-appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid hsl(0, 0%, 86%);
    width: max-content;
    border-radius: 4px;
    color: hsl(0, 0%, 21%);
    padding: 0.45rem 2rem 0.45rem 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: none;
    transition:
        color 0.2s linear,
        background-color 0.2s linear,
        border-color 0.2s linear;
    /* Ensures the select fits within parent */
}

.select::after {
    content: "\F282";
    display: inline-block;
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: 400 !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
    right: 0.5rem;
    color: var(--primary-orange);
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

/* Focus effect for select */
.select select:focus {
    outline: none;
    /* Removes default focus outline */
    border-color: var(--primary-blue);
    /* Matches button focus styles */
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3);
    /* Light blue shadow */
}

/* Disabled select style */
.select select:disabled {
    background-color: hsl(0, 0%, 95%);
    color: hsl(0, 0%, 60%);
    cursor: not-allowed;
}

/* Primary style variant for select */
.select select.primary {
    background-color: var(--primary-blue);
    border-color: transparent;
    color: #fff;
}

/* Hover effect for primary select */
.select select.primary:hover {
    background-color: #fff;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
