* input::-webkit-outer-spin-button,
* input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


body {
    margin: 0;
}

@media (min-width: 768px) {
    ._mobile {
        display: none;
    }
}

@media (max-width: 767px) {
    ._desktop {
        display: none;
    }
}

#root {
    display: flex;
    font-family: 'Inter', sans-serif;
    width: 100%;

    @media (max-width: 767px) {
        flex-direction: column;
    }
}

:root {
    --button-color: #2a61ba;
    --theme-bg-text-color-mix: color-mix(in srgb, var(--theme-color), var(--theme-text-color) 10%);
    --theme-bg-color-darkened: color-mix(in srgb, var(--theme-color), black 10%);
    --highlight-color: rgba(var(--theme-text-color), 0.15);

    --success-bg-color: rgb(212, 245, 215);
    --success-text-color: rgb(16, 49, 33);
    --success-border-color: rgba(16, 49, 33, 0.2);

    /* Overridden in auth.css */
    --error-bg-color: rgb(254, 202, 201);
    --error-text-color: rgb(144, 11, 9);
    --error-border-color: rgba(113, 16, 15, 0.2);

    --info-bg-color: rgb(208, 227, 250);
    --info-text-color: rgb(15, 44, 88);
    --info-border-color: rgba(15, 44, 88, 0.2);
}

input {
    padding-left: 8px;
}

.field-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;

    .label-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;

        label {
            font-weight: 500;
            font-size: 16px;
        }
    }

    .subtext {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.2;
    }
}

.input, .select {
    height: 38px;
    width: 100%;
    box-sizing: border-box;

    background-color: var(--field-bg-color);
    color: var(--field-text-color);
    font-size: 14px;

    border-radius: 8px;
    border: 1px solid rgb(153, 153, 153);

    &:disabled {
        color: rgb(102, 102, 102);
    }
}

.button, .link-button {
    height: 43px;
    width: 100%;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--button-text-color);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;

    &:hover {
        filter: brightness(80%);
    }

    &.primary {
        background-color: var(--button-color);
        color: white;
    }
}

.button {
    border: none;

    &:disabled {
        opacity: 0.5;
        cursor: default;

        &:hover {
            filter: none;
        }
    }
}

.link-button {
    text-decoration: none;
    text-align: center;
    line-height: 43px;
}

.loading-spinner {
    width: 1.3em;
    height: 1.3em;
    margin-right: 0.5em;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.message-box {
    box-sizing: border-box;
    width: 100%;
    padding: 20px;
    border-radius: 8px;

    display: flex;
    flex-direction: column;
    gap: 15px;

    h3, p {
        margin: 0;
    }

    p, a {
        line-height: 1.4;
    }

    &.error {
        background-color: var(--error-bg-color);
        color: var(--error-text-color);
        border: 1px solid var(--error-border-color);

        a {
            color: var(--error-text-color);
        }
    }

    &.success {
        background-color: var(--success-bg-color);
        color: var(--success-text-color);
        border: 1px solid var(--success-border-color);

        a {
            color: var(--success-text-color);
        }
    }

    &.info {
        background-color: var(--info-bg-color);
        color: var(--info-text-color);
        border: 1px solid var(--info-border-color);

        a {
            color: var(--info-text-color);
        }
    }

    .action-button-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;

        /* The box's link color rules are for inline prose links, not the button-styled ones. */
        .action-button {
            color: black;

            &.primary {
                color: white;
            }
        }
    }
}

/* "tag"-type misc classes */

.small-width {
    width: 120px;
}

.shrink {
    width: fit-content;
}

.smaller {
    font-size: smaller;
}

/* Generic overlay dialog, paired with the shared <Modal> component. */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(17, 24, 39, 0.5);
}

.modal-content {
    box-sizing: border-box;
    width: min(100%, 560px);
    max-height: 90vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #111827;
}

.modal-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    padding: 0 0.25rem;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    padding: 1.25rem;
}