@import url('lib/tailwindcss/dist/preflight.css');

:root {
    color-scheme: light dark;

    --bg: light-dark(#ffffff, #0b0b0c);
    --surface: light-dark(#f7f7f8, #141416);
    --surface-raised: light-dark(#ffffff, #18181b);
    --border: light-dark(#e4e4e7, #26262a);
    --border-strong: light-dark(#d4d4d8, #3f3f46);

    --text: light-dark(#18181b, #ededef);
    --text-muted: light-dark(#71717a, #a1a1aa);

    --accent: light-dark(#2563eb, #6e8bff);
    --accent-hover: light-dark(#1d4ed8, #8aa2ff);
    --accent-contrast: light-dark(#ffffff, #0b0b0c);

    --danger: light-dark(#b91c1c, #f87171);
    --danger-surface: light-dark(#fef2f2, #2a1414);
    --danger-border: light-dark(#fecaca, #4c1d1d);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;

    --shadow-sm: 0 1px 2px light-dark(rgb(0 0 0 / .06), rgb(0 0 0 / .4));
    --shadow-md: 0 4px 16px -4px light-dark(rgb(0 0 0 / .10), rgb(0 0 0 / .55)),
                 0 1px 2px light-dark(rgb(0 0 0 / .06), rgb(0 0 0 / .4));

    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --dur: 160ms;
    --ease: cubic-bezier(.2, 0, 0, 1);

    --page-width: 1024px;
    --content-width: 768px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

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

html { min-height: 100%; }

body {
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    margin: 0 0 var(--space-3);
    line-height: 1.25;
    letter-spacing: -0.011em;
    font-weight: 600;
}

h1 { font-size: 1.75rem; }
h1:focus { outline: none; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

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

code {
    font-family: var(--font-mono);
    font-size: .875em;
    padding: .1em .35em;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

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

.page-width {
    width: 100%;
    max-width: var(--page-width);
    margin-inline: auto;
}

.btn-default,
.btn-subtle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

    .btn-default:hover,
    .btn-subtle:hover {
        background: var(--surface);
        border-color: var(--accent);
    }

.valid.modified:not([type=checkbox]) { outline: 1px solid light-dark(#26b050, #4ade80); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }

.blazor-error-boundary {
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--danger-surface);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

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