:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

html {
    background-color: var(--surface-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--surface-bg);
    background-image: var(--workspace-mesh);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
}

a,
button,
[role="button"] {
    transition-duration: var(--motion-fast);
    transition-property: color, background-color, border-color, box-shadow, transform;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    color: var(--text-header);
}

/* App shell surfaces that MudBlazor renders itself. These classes are handed
   to MudAppBar/MudText via their Class parameter, so they land on markup that
   MainLayout.razor.css can never reach — its scope attribute is only stamped
   onto that file's own literal elements, and no ancestor of the app bar
   carries it either, which makes ::deep useless here too. This stylesheet is
   linked after MudBlazor.min.css, so equal-specificity rules win on order. */
.ark-appbar {
    border-bottom: 1px solid var(--border);
    /* Translucent on purpose: the palette's AppbarBackground is opaque, which
       would leave the blur below with nothing to show through. */
    background: var(--surface-glass-strong);
    backdrop-filter: blur(18px);
}

/* The navigation rail's surface.
   Global, not scoped: MudDrawer renders its own <aside> and no ancestor carries
   MainLayout.razor.css's isolation attribute, the same constraint the app bar
   above has.
   MudBlazor paints the drawer from PaletteDark.DrawerBackground, which was
   #08131b — DARKER than the #0b1117 canvas, so in dark mode the rail sank into
   a black gutter instead of floating. The platform's rail is the card tier at
   85% with a blur behind it, one step ABOVE the canvas, and that is what the
   React shell's aside already does. This matches them. */
.ark-drawer {
    background: var(--surface-glass);
    backdrop-filter: blur(24px) saturate(1.5);
    border-right: 1px solid var(--border);
}

.ark-appbar__title {
    font-family: var(--font-family-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-header);
}

@media (max-width: 768px) {
    .ark-appbar__title {
        font-size: 0.95rem;
    }
}

.ark-foundation {
    display: grid;
    gap: var(--spacing-lg);
    max-width: 72rem;
    padding: clamp(var(--spacing-lg), 5vw, 3rem) var(--container-padding-desktop);
}

.ark-foundation h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.2;
}

.ark-foundation p {
    max-width: 42rem;
    margin: 0;
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-subtle);
    color: var(--text-secondary);
}


.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--danger-color);
}

.validation-message {
    color: var(--danger-text);
}

.blazor-error-boundary {
    padding: var(--spacing-md);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    background: var(--danger-bg);
    color: var(--danger-text);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: var(--border-color-secondary);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
