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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; letter-spacing: 0.01em; margin: 0 0 var(--space-3); line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h1:focus { outline: none; }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background 120ms, border-color 120ms;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-muted); }
.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-muted); color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink-muted); }
.input, select.input, textarea.input {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); width: 100%;
}
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-5); }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: 0.93rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.badge-illustrative { background: var(--illustrative-soft); color: var(--illustrative); }
.badge-live { background: var(--ok-soft); color: var(--ok); }
.badge-phase { background: var(--surface-sunken); color: var(--ink-muted); }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-header p { margin: 0; color: var(--ink-muted); }

.placeholder { text-align: left; max-width: 640px; }
.placeholder .badge { margin-bottom: var(--space-3); }

/* Blazor plumbing */
#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--warn-soft); color: var(--warn); padding: var(--space-3) var(--space-5); box-shadow: var(--shadow-raised);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: var(--space-4); top: var(--space-3); }
.blazor-error-boundary { background: var(--danger-soft); color: var(--danger); padding: var(--space-4); border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "Something went wrong displaying this section."; }
.validation-message { color: var(--danger); font-size: 0.85rem; }

/* Sign-in pages */
.auth-title { text-align: center; font-size: 1.35rem; margin-bottom: var(--space-5); }
.auth-aside { text-align: center; margin: var(--space-4) 0 0; font-size: 0.9rem; }
