h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ── Nav menu ───────────────────────────────────────────── */

/* Logout is a <button> (it must POST) wearing .mud-nav-link. Resets the UA button styling only. */
.nav-logout {
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: start;
}

/* MudBlazor scopes the nav hover to anchors. */
.nav-logout:hover {
    background-color: var(--mud-palette-action-default-hover);
}

/* ── Documents diagnostic ───────────────────────────────── */

/* Inline preview in each file row. object-fit:contain, not cover: cropping a portrait page to a square
   shows its middle band, which is the least identifiable part of a document. Contain keeps the whole page
   and its true shape, letterboxed on white. */
.doc-thumb {
    width: 36px;
    height: 46px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--mud-palette-lines-default);
    background: #fff;
}

/* ── Tooltips ───────────────────────────────────────────── */

/* MudBlazor sets no width on the tooltip, so one anchored near the right edge shrink-to-fits the space
   left and wraps a word per line. max-content sizes it to its text instead; the max-width keeps long
   ones wrapping and inside the viewport. */
.mud-tooltip {
    width: max-content;
    max-width: min(320px, calc(100vw - 32px));
}

/* ── Snackbars / toasts ─────────────────────────────────── */

/* MudBlazor only exposes transition DURATIONS, not the style, so the default is a plain fade. This replaces
   the entrance with a slide-in from the right and a slight scale overshoot ("pop"). Entrance only — the exit
   stays MudBlazor's own hide transition. The overshoot lives in both the keyframe (1.04) and the easing. */
@keyframes toast-slide-pop {
    0%   { transform: translateX(60px) scale(0.85); opacity: 0; }
    60%  { transform: translateX(0) scale(1.04); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

.mud-snackbar {
    animation: toast-slide-pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@media (prefers-reduced-motion: reduce) {
    .mud-snackbar {
        animation: none;
    }
}

/* ── App bar ────────────────────────────────────────────── */

.appbar-logo {
    height: 26px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

/* ── Login / Account pages ─────────────────────────────── */

.auth-page {
    /* No min-height:100vh — this page renders inside the MudBlazor shell (64px app-bar + container padding),
       so forcing full viewport height pushed the total past 100vh and produced a scrollbar. The shell already
       fills the viewport and the background is white, so the card just needs top spacing. */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fff;
    padding: 7vh 1rem 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Sized off the card's 420px width rather than a fixed height, so it scales with the card. */
.auth-logo {
    width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: .75rem 0 .25rem;
}

.auth-header p {
    color: #666;
    font-size: .9rem;
    margin: 0;
}

/* Account/Manage pages reuse .auth-field for inputs, but sit inside the MudBlazor shell rather than the
   login card, so they need their own width and status styling. */
.acct-form {
    max-width: 460px;
}

.acct-status {
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}

.acct-status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.acct-status-error {
    background: #fdecea;
    color: #c62828;
}

.auth-field input:disabled {
    background: #f0f0f0;
    color: #777;
    cursor: not-allowed;
}

.auth-error {
    background: #fdecea;
    color: #c62828;
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-field label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: #444;
    margin-bottom: .35rem;
    letter-spacing: .01em;
}

.auth-field input {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid #d0d0d0;
    border-radius: 7px;
    font-size: .95rem;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
    background: #fafafa;
    color: #1a1a1a;
}

.auth-field input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25,118,210,.12);
    background: #fff;
}

.auth-field input::placeholder {
    color: #aaa;
}

.auth-validation {
    display: block;
    color: #c62828;
    font-size: .78rem;
    margin-top: .25rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .75rem 0 1.25rem;
    font-size: .875rem;
    color: #555;
}

.auth-remember input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: #1976d2;
}

.auth-btn {
    width: 100%;
    padding: .8rem;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .02em;
    transition: background .18s, box-shadow .18s;
    box-shadow: 0 2px 8px rgba(25,118,210,.25);
}

.auth-btn:hover {
    background: #1565c0;
    box-shadow: 0 4px 12px rgba(25,118,210,.35);
}

.auth-btn:active {
    background: #0d47a1;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.auth-links a {
    color: #1976d2;
    text-decoration: none;
    font-size: .875rem;
    transition: color .15s;
}

.auth-links a:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* "or" separator between password sign-in and external providers */
.auth-divider {
    display: flex;
    align-items: center;
    color: #9aa0a6;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e6e6e6;
}

.auth-divider::before { margin-right: .75rem; }
.auth-divider::after { margin-left: .75rem; }

.auth-external-form { margin: 0; }

/* External-provider (SSO) button — white with subtle border, provider logo on the left */
.auth-external-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .75rem;
    background: #fff;
    color: #3c4043;
    border: 1.5px solid #d0d0d0;
    border-radius: 7px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s, box-shadow .18s;
}

.auth-external-btn + .auth-external-btn { margin-top: .6rem; }

.auth-external-btn:hover {
    background: #f7f9fc;
    border-color: #b8b8b8;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.auth-external-btn svg { flex: 0 0 auto; }

/* ── Upload Sessions ───────────────────────────────────── */

/* Soft "off red" tint for soft-deleted sessions in the admin table. Global (not scoped) because MudBlazor
   renders the <tr> outside any component's CSS scope. Also targets the cells and beats the hover rule. */
.mud-table-row.session-deleted,
.mud-table-row.session-deleted > td {
    background-color: rgba(244, 67, 54, 0.12) !important;
}

.mud-table-hover .mud-table-row.session-deleted:hover,
.mud-table-hover .mud-table-row.session-deleted:hover > td {
    background-color: rgba(244, 67, 54, 0.20) !important;
}

/* ── Payment Links ─────────────────────────────────────── */
/* Global, not scoped: MudBlazor renders the <tr>, <td> and chip outside the component's CSS scope. */

/* Rows needing attention. !important beats MudTable's row and hover backgrounds. */
.mud-table-row.pl-attention,
.mud-table-row.pl-attention > td {
    background-color: rgba(244, 67, 54, 0.10) !important;
}

.mud-table-hover .mud-table-row.pl-attention:hover,
.mud-table-hover .mud-table-row.pl-attention:hover > td {
    background-color: rgba(244, 67, 54, 0.18) !important;
}

.mud-table-root th.pl-center,
.mud-table-root td.pl-center {
    text-align: center;
}

/* Pulses a status that just changed. Fades a surface-coloured overlay over the chip rather than recolouring it,
   so it works for any status and theme. z-index:-1 keeps the overlay below the label; isolation makes that
   reliable. */
@keyframes pl-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.72; }
}

/* Two classes, one animation, alternated per change — an animation only restarts when its class is added. */
.mud-chip.pl-pulse-a,
.mud-chip.pl-pulse-b {
    position: relative;
    isolation: isolate;
}

.mud-chip.pl-pulse-a::after,
.mud-chip.pl-pulse-b::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background-color: var(--mud-palette-surface);
    pointer-events: none;
    animation: pl-pulse 1s ease-in-out 20;
}

@media (prefers-reduced-motion: reduce) {
    .mud-chip.pl-pulse-a::after,
    .mud-chip.pl-pulse-b::after {
        animation: none;
        opacity: 0.45;
    }
}

/* Suppressed: this table reloads on every change ping, so the bar flickers constantly. */
.pl-table .mud-progress-linear {
    display: none !important;
}

/* Copy button stays hidden until the pointer is anywhere on the row. Faded rather than
   display:none so the link never shifts sideways as it appears. Fades out on the way back so
   sweeping down the table doesn't strobe, but appears instantly on the way in. */
.case-row .case-copy-btn {
    opacity: 0;
    transition: opacity .15s ease-in-out;
    padding: 3px;
}

.case-row:hover .case-copy-btn,
.case-row .case-copy-btn:focus-visible {
    opacity: 1;
    transition-duration: 0s;
}

.case-row .case-copy-btn .mud-icon-root {
    font-size: 1rem;
}

/* ── AppDialog ─────────────────────────────────────────── */

/* Global rather than scoped: MudDialog renders these elements outside AppDialog's CSS scope. */
.app-dialog .mud-dialog-title {
    padding: 20px 16px 12px 24px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.app-dialog .mud-dialog-content {
    padding: 20px 24px;
}

.app-dialog .mud-dialog-actions {
    padding: 8px 24px 20px;
    gap: 12px;
}

.app-dialog .mud-dialog-actions > * {
    margin-left: 0;
}

/* Soft-deleted payment links, shown only when "Show deleted" is on. Same off-red tint as Upload Sessions'
   .session-deleted — the standard deleted-row style (see CLAUDE.md). !important beats MudTable's own row and
   hover backgrounds. */
.mud-table-row.pl-deleted,
.mud-table-row.pl-deleted > td {
    background-color: rgba(244, 67, 54, 0.12) !important;
}

.mud-table-hover .mud-table-row.pl-deleted:hover,
.mud-table-hover .mud-table-row.pl-deleted:hover > td {
    background-color: rgba(244, 67, 54, 0.20) !important;
}
