/* Browser host: base page, boot screen and the Blazor error bar. Component styles live in _content/AutoReceipt.Ui/autoreceipt.css. */

html, body {
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

/* The page's colours before MudBlazor's theme exists (AppTheme's background, text and primary): the device's scheme, or the
   theme chosen on this device, which index.html sets as data-theme on <html> before anything is drawn. Once the app runs,
   MudBlazor's palette variables take over, so the page never shows the device's scheme under the chosen theme. */
:root {
    --ar-boot-background: #f5f7f9;
    --ar-boot-text: #1f2a33;
    --ar-boot-accent: #2b6c8a;
    --ar-boot-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ar-boot-background: #111518;
        --ar-boot-text: #e4eaee;
        --ar-boot-accent: #7cbad6;
        --ar-boot-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --ar-boot-background: #111518;
    --ar-boot-text: #e4eaee;
    --ar-boot-accent: #7cbad6;
    --ar-boot-scheme: dark;
}

:root {
    color-scheme: var(--mud-native-html-color-scheme, var(--ar-boot-scheme));
}

body {
    background: var(--mud-palette-background, var(--ar-boot-background));
    color: var(--mud-palette-text-primary, var(--ar-boot-text));
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- boot screen (until the WebAssembly app starts) ---------- */

.ar-boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.ar-boot-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: .3px;
}

.ar-boot-bar {
    width: 200px;
    height: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--ar-boot-accent) 18%, transparent);
    overflow: hidden;
}

.ar-boot-bar span {
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--ar-boot-accent);
    transition: width .2s ease-out;
}

.ar-boot-text {
    font-size: .85rem;
    opacity: .7;
}

.ar-boot-text::after {
    content: " " var(--blazor-load-percentage-text, "");
}

/* ---------- unhandled error bar ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 12px 48px 12px 16px;
    background: #fff4e5;
    color: #5f3b00;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
}

#blazor-error-ui .reload {
    margin-left: 8px;
    color: inherit;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 12px;
    top: 6px;
    border: 0;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}
