:root {
    color-scheme: light;
    --bg: hsl(var(--background));
    --surface: hsl(var(--card));
    --surface-raised: hsl(var(--secondary));
    --surface-input: hsl(var(--background));
    --pg-border: hsl(var(--border));
    --pg-border-strong: hsl(var(--input));
    --text: hsl(var(--foreground));
    --pg-muted: hsl(var(--muted-foreground));
    --pg-muted-strong: hsl(var(--foreground));
    --pg-accent: hsl(var(--primary));
    --pg-accent-hover: hsl(var(--primary) / .82);
    --pg-accent-soft: hsl(var(--accent));
    --success: #15803d;
    --success-soft: #f0fdf4;
    --warning: #a16207;
    --danger: hsl(var(--destructive));
    --danger-soft: #fef2f2;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius: var(--radius-lg);
    --font-sans: "Roboto", system-ui, sans-serif;
}

.dark { color-scheme: dark; --success: #4ade80; --success-soft: #052e16; --warning: #fbbf24; --danger-soft: #450a0a; }

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

html, body { min-height: 100%; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Roboto", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: #1f6feb; color: #fff; }

button, a, summary, input, select { touch-action: manipulation; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { text-wrap: balance; }

/* Valores são editados como texto financeiro; os controles de incremento nativos atrapalham. */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--pg-accent);
    outline-offset: 2px;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    padding: 12px 14px;
    border: 1px solid #6e3035;
    border-radius: var(--radius-md);
    background: var(--danger-soft);
    color: #ffb3ad;
    box-shadow: 0 12px 40px #0008;
}

#blazor-error-ui .reload {
    margin-left: 12px;
    color: #ffb3ad;
    font-weight: 700;
}

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