/* Loaded on every Unfold page (UNFOLD["STYLES"]). A tinted page background lets the white
   cards and tables stand out, which Unfold's white-on-white layout does not. */

#main {
    background-color: var(--color-base-100);
}

.dark #main {
    background-color: var(--color-base-950);
}

#main .bg-white,
#content-related {
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 2px 6px rgb(0 0 0 / 0.05);
}

/* Unfold leaves the recent-actions panel transparent; give it the cards' background. */
#content-related {
    background-color: white;
}

.dark #content-related {
    background-color: var(--color-base-900);
}

/* Unfold's secondary buttons share the page's new tint; make them white with a border. */
#main a.bg-base-100,
#main button.bg-base-100 {
    background-color: white;
    border-color: var(--color-base-200);
}

#main a.bg-base-100:hover,
#main button.bg-base-100:hover {
    background-color: var(--color-base-50);
}

.dark #main a.bg-base-100,
.dark #main button.bg-base-100 {
    background-color: var(--color-base-900);
    border-color: var(--color-base-700);
}

/* Forms sit on white like the cards. */
#main fieldset,
#main .inline-group {
    background-color: white;
}

.dark #main fieldset,
.dark #main .inline-group {
    background-color: var(--color-base-900);
}

/* Long checkbox labels (e.g. accepting the terms) wrap instead of running out of the form. */
.form-checkbox label {
    white-space: normal;
}
.form-checkbox > div {
    align-items: flex-start;
}
.form-checkbox > div > input[type="checkbox"] {
    margin-top: 0.2rem;
    flex: none;
}

/* Pages before login: the logo beside the site name, the page's heading below. */
.foundation-auth-brand {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.foundation-auth-brand img {
    border-radius: 0.6rem;
    height: 2.5rem;
    width: 2.5rem;
}

.foundation-auth-title h1 {
    font-size: 1.125rem;
    margin-top: 1rem;
}

/* Survey dialog (foundation.surveys) on dashboard pages. */
.foundation-survey-backdrop {
    align-items: flex-start;
    background: rgb(17 24 39 / 0.45);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 4vh 1rem;
    position: fixed;
    z-index: 70;
}

.foundation-survey {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.25);
    color: var(--color-font-default-light);
    max-width: 36rem;
    padding: 1.75rem;
    position: relative;
    width: 100%;
}

.dark .foundation-survey {
    background: var(--color-base-900);
    color: var(--color-font-default-dark);
}

.foundation-survey h2 {
    color: var(--color-font-important-light);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.25rem 0 0.5rem;
}

.dark .foundation-survey h2,
.dark .foundation-survey legend {
    color: var(--color-font-important-dark);
}

.foundation-survey-kicker {
    color: var(--color-primary-600);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.foundation-survey-intro,
.foundation-survey-note,
.foundation-survey-hint {
    margin-bottom: 0.75rem;
}

.foundation-survey-note,
.foundation-survey-hint {
    font-size: 0.8rem;
    opacity: 0.75;
}

.foundation-survey-close {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.foundation-survey-question {
    border-top: 1px solid var(--color-base-200);
    margin: 0;
    padding: 1rem 0 0.75rem;
}

.dark .foundation-survey-question {
    border-color: var(--color-base-700);
}

.foundation-survey legend {
    color: var(--color-font-important-light);
    float: left;
    font-weight: 600;
    margin-bottom: 0.5rem;
    width: 100%;
}

.foundation-survey-required {
    color: #dc2626;
}

.foundation-survey-options {
    clear: both;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.foundation-survey-options label {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
}

.foundation-survey-rating {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.foundation-survey-rating label {
    border: 1px solid var(--color-base-300);
    border-radius: 0.5rem;
    padding: 0.35rem 0.8rem;
}

.foundation-survey textarea {
    background: transparent;
    border: 1px solid var(--color-base-300);
    border-radius: 0.5rem;
    clear: both;
    display: block;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.foundation-survey-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.foundation-survey-actions button {
    background: var(--color-base-100);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
}

.dark .foundation-survey-actions button {
    background: var(--color-base-800);
}

.foundation-survey-actions .foundation-survey-send,
.dark .foundation-survey-actions .foundation-survey-send {
    background: var(--color-primary-600);
    color: #fff;
}

.foundation-survey-optout {
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 1rem;
    opacity: 0.75;
    text-decoration: underline;
}

.foundation-survey-results {
    width: 100%;
}

.foundation-survey-results td {
    padding: 0.3rem 0.5rem 0.3rem 0;
}

.foundation-survey-results meter {
    width: 100%;
}

.foundation-survey-texts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dark .foundation-survey-rating label,
.dark .foundation-survey textarea {
    border-color: var(--color-base-600);
}

@media (max-width: 480px) {
    .foundation-survey {
        padding: 1.25rem;
    }

    .foundation-survey-rating label {
        padding: 0.35rem 0.6rem;
    }
}
