/*
    What is left of the Blazor project template's stylesheet.

    Everything this file used to say about how the product LOOKS — the font stack, the link colour,
    the button colours, the focus shadow, the content padding — has moved into the design system at
    `_content/Nakala.Client.Components/css/nakala.css`, where it is a token that the whole client
    consumes rather than a literal that only this file knows about. Leaving those declarations here
    would have been worse than not having them: this sheet loads AFTER the design system, so its
    `html, body { font-family: 'Helvetica Neue' }` quietly won the cascade against every token
    underneath it.

    What remains is the boot and failure chrome, and it stays here for one reason: it has to work
    when the application does not. The loading spinner is on screen before the WebAssembly runtime
    exists, and the error bar appears when the runtime has fallen over — neither can depend on a
    stylesheet the component library ships. It is written against the design tokens where they are
    available and falls back to a literal where they may not be.
*/

/* ---- validation, as the Blazor form components stamp it ---- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--nk-ok, #26b050);
}

.invalid {
    outline: 1px solid var(--nk-bad, #b91c1c);
}

.validation-message {
    color: var(--nk-bad, #b91c1c);
}

/* ---- the runtime has fallen over ---- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

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

/* ---- the runtime has not started yet ---- */

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #03173d;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
