/*
  Global base styles. Component-specific styling lives in co-located
  .razor.css files (Blazor CSS isolation) — keep this file to resets,
  the boot screen and the framework error banner.
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    margin: 0;
}

a {
    color: var(--color-ember);
}

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

h1:focus {
    outline: none;
}

/* ---------- Boot screen ---------- */

.app-boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    background: var(--color-surface);
}

.app-boot-mark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.app-boot-mark span {
    color: var(--color-ember);
}

.app-boot-trail {
    width: 190px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-line);
    overflow: hidden;
}

.app-boot-trail i {
    display: block;
    height: 100%;
    width: calc(var(--blazor-load-percentage, 10%));
    background: linear-gradient(90deg, var(--color-spent), var(--color-ember));
    border-radius: 2px;
    transition: width 0.15s ease-out;
}

/* ---------- Framework error banner ---------- */

#blazor-error-ui {
    background: var(--color-surface-raised);
    color: var(--color-text);
    border-top: 2px solid var(--color-danger);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 14px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 14px;
    top: 12px;
}

.blazor-error-boundary {
    background: var(--color-danger);
    padding: 16px;
    color: #fff;
    border-radius: var(--radius-sm);
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
}

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