/* Theme tokens of the default pages. A host stylesheet overrides any of them on :root. */
:root {
    --um-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --um-color-text: #1f2328;
    --um-color-text-muted: #59636e;
    --um-color-background: #f6f8fa;
    --um-color-surface: #ffffff;
    --um-color-border: #d1d9e0;
    --um-color-accent: #0b57d0;
    --um-color-accent-contrast: #ffffff;
    --um-color-danger: #b42318;
    --um-color-success: #1a7f37;
    --um-radius: 0.5rem;
}

.um-page {
    margin: 0;
    min-height: 100vh;
    background: var(--um-color-background);
    color: var(--um-color-text);
    font-family: var(--um-font-family);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    box-sizing: border-box;
}

/* With an application layout: its header, the page and its footer stack, and the page keeps its width. */
.um-page-framed {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}

.um-page-framed > main {
    box-sizing: border-box;
    width: calc(100% - 2rem);
    margin: 3rem auto;
}

/* The first focusable element of a page with a layout; out of sight until a keyboard user reaches it. */
.um-skip-link {
    position: absolute;
    top: -10rem;
    left: 1rem;
    z-index: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--um-color-border);
    border-radius: var(--um-radius);
    background: var(--um-color-surface);
    color: var(--um-color-accent);
}

.um-skip-link:focus {
    top: 1rem;
}

.um-card {
    width: 100%;
    max-width: 26rem;
    background: var(--um-color-surface);
    border: 1px solid var(--um-color-border);
    border-radius: var(--um-radius);
    padding: 2rem;
    box-sizing: border-box;
}

.um-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.um-title {
    margin: 0;
    font-size: 1.5rem;
}

.um-subtitle {
    margin: 0;
    font-size: 1rem;
}

.um-form,
.um-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* The password repetition is hidden by the strength script until the password passes; the flex display would undo it. */
.um-field[hidden] {
    display: none;
}

.um-field input,
.um-field select,
.um-field textarea {
    font: inherit;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--um-color-border);
    border-radius: var(--um-radius);
    background: var(--um-color-surface);
    color: var(--um-color-text);
}

.um-button {
    font: inherit;
    padding: 0.6rem 1rem;
    border: 1px solid var(--um-color-accent);
    border-radius: var(--um-radius);
    background: var(--um-color-accent);
    color: var(--um-color-accent-contrast);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.um-button-secondary {
    background: var(--um-color-surface);
    color: var(--um-color-accent);
}

.um-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--um-radius);
    border: 1px solid currentColor;
}

.um-alert p {
    margin: 0;
}

.um-alert-error,
.um-field-error {
    color: var(--um-color-danger);
}

.um-field-error {
    margin: 0;
    font-size: 0.875rem;
}

.um-hint,
.um-footer {
    margin: 0;
    color: var(--um-color-text-muted);
    font-size: 0.875rem;
}

.um-hint a,
.um-footer a {
    color: var(--um-color-accent);
}

.um-providers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.um-identities,
.um-plans,
.um-sign-ins {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.um-identity,
.um-sign-in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.um-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.um-password-strength {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--um-color-text-muted);
}

.um-password-strength ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}

.um-check-passed {
    color: var(--um-color-success);
    font-weight: 600;
}

/* Account page: one card, sections separated by a rule. */
.um-account-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--um-color-border);
}

.um-account-section h2 {
    margin: 0;
    font-size: 1.1rem;
}

.um-plan h3 {
    margin: 0;
    font-size: 1rem;
}

.um-notice {
    color: var(--um-color-success);
}

.um-badge {
    display: inline-block;
    padding-inline: 0.4em;
    border-radius: var(--um-radius);
    font-size: 0.85em;
    color: var(--um-color-text-muted);
    background: var(--um-color-background);
}

.um-expired {
    color: var(--um-color-danger);
}

/* A flex item of the page would otherwise grow to the width of its widest table. */
.um-main-wide {
    min-width: 0;
    max-width: 72rem;
    margin-inline: auto;
    padding: 1.5rem;
}

.um-admin-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: end;
    margin-block: 1rem;
}

/* The visually hidden header text is absolutely positioned; without this anchor it leaves the scroll area. */
.um-table-scroll {
    position: relative;
    overflow-x: auto;
}

.um-admin-table,
.um-legal-table {
    width: 100%;
    border-collapse: collapse;
}

.um-admin-table th,
.um-admin-table td,
.um-legal-table th,
.um-legal-table td {
    padding: 0.5rem 0.75rem;
    text-align: start;
    border-bottom: 1px solid var(--um-color-border);
}

.um-admin-table th[aria-sort="ascending"] a::after {
    content: " \2191";
}

.um-admin-table th[aria-sort="descending"] a::after {
    content: " \2193";
}

.um-pager {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-block: 1rem;
}

.um-admin-facts,
.um-legal-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
}

.um-admin-facts dd,
.um-legal-facts dd {
    margin: 0;
}

/* A long email address or URL must break instead of widening the page. */
.um-legal-facts dd {
    overflow-wrap: anywhere;
}

/* Legal pages: a reading width for long text, one rule between sections, addresses in the body font. */
.um-card-reading {
    max-width: 48rem;
}

.um-legal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--um-color-border);
}

.um-legal-section h2,
.um-legal-section h3,
.um-legal-section p,
.um-legal-section ul,
.um-legal-section dl {
    margin: 0;
}

.um-legal-section h2 {
    font-size: 1.1rem;
}

.um-legal-section h3 {
    font-size: 1rem;
}

.um-legal-page address {
    font-style: normal;
}

/* Legal labels run long, such as the German VAT label: they wrap beside their value, and stand above it when narrow. */
.um-legal-facts {
    grid-template-columns: fit-content(40%) minmax(0, 1fr);
}

@media (max-width: 30rem) {
    .um-legal-facts {
        grid-template-columns: minmax(0, 1fr);
    }
}

.um-legal-table caption {
    text-align: start;
    font-weight: 600;
    padding-block-end: 0.5rem;
}

.um-legal {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
}

.um-legal a {
    color: var(--um-color-accent);
}

.um-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
