html, body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    color: var(--fg-default);
    background: var(--canvas-subtle);
}

/* The /manage list renders its add "+" into the toolbar-actions section;
   MainLayout surfaces it beside the page heading, so keep it vertically centred there. */
.page-title-actions {
    display: inline-flex;
    align-items: center;
}

/* ---- generic view/edit form rows ------------------------------------------
   TerraStack's FormLayoutSchemaComponent renders each field as a label block
   (.fc-min-w-40) beside a field block, but leaves the fc-* classes for the
   host app to define. Label at 40% on the left, field at 60% on the right;
   on narrow screens the field drops below the label at full width. */
.fc-min-w-40 {
    width: 40%;
}

/* The row only flexes from MudBlazor's lg breakpoint; keep it a row down to md */
.d-lg-flex:has(> .fc-min-w-40) {
    display: flex !important;
    flex-direction: row;
}

/* The field block carries an inline width:100%; pin it to the remaining 60% */
.d-lg-flex:has(> .fc-min-w-40) > .fc-min-w-40 + div {
    width: 60% !important;
    min-width: 0;
}

.fc-max-w-400 {
    max-width: 400px;
}

@media (max-width: 959.98px) {
    .fc-min-w-40,
    .fc-max-w-400 {
        width: 100%;
        max-width: 100%;
    }

    .d-lg-flex:has(> .fc-min-w-40) {
        flex-direction: column;
    }

    .d-lg-flex:has(> .fc-min-w-40) > .fc-min-w-40 + div {
        width: 100% !important;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    background: var(--danger-subtle);
    color: var(--danger-fg);
    border-top: 1px solid var(--danger-fg);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- account pages ------------------------------------------------------
   Sign-in, forgot password, reset and invitation all render the same centred
   card inside AccountLayout — the AuditTrace sign-in card (HQU-1593): white on
   the paper, the title in the display face, ink for the one button. */
.account-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: safe center;
    justify-content: center;
    padding: 48px 16px;
    background: var(--canvas-subtle);
    font-family: var(--font-sans);
}

.account-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: var(--canvas-default);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-floating);
}

.account-card__title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: var(--display-tracking);
    color: var(--fg-default);
}

.account-card__subtitle {
    margin: 0 0 24px;
    color: var(--fg-muted);
}

.account-card__error {
    background: var(--danger-subtle);
    color: var(--danger-fg);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.account-card__notice {
    background: var(--success-subtle);
    color: var(--success-fg);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.account-card__label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--fg-muted);
    margin-bottom: 6px;
}

/* White inside the heavier input rule; focus shows through the border. */
.account-card__input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--canvas-default);
    color: var(--fg-default);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px; /* 16px stops iOS Safari zooming the page on focus */
}

.account-card__input:hover { border-color: var(--fg-subtle); }
.account-card__input:focus { outline: none; border-color: var(--accent-fg); }

.account-card__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--fg-muted);
    margin-bottom: 20px;
}

/* Ink, like every primary action in the portal. */
.account-card__button {
    width: 100%;
    min-height: 44px;
    padding: 11px;
    background: var(--emphasis-bg);
    color: var(--emphasis-fg);
    border: 1px solid var(--emphasis-bg);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-15);
    font-weight: 600;
    cursor: pointer;
}

.account-card__button:hover { background: var(--emphasis-bg-hover); }

.account-card__link {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: var(--accent-fg);
    font-size: var(--text-md);
}
