:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #d8e0ea;
  --border-strong: #b8c5d6;
  --ink: #0f1b2d;
  --ink-2: #33465f;
  --muted: #6b7d95;
  --brand: #14507d;
  --brand-ink: #0d3b5e;
  --brand-soft: #e3edf6;
  --ok: #146c43;
  --ok-soft: #e3f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf3e0;
  --danger: #b3261e;
  --danger-soft: #fbe9e8;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 4px 12px rgba(15, 27, 45, 0.1), 0 24px 48px rgba(15, 27, 45, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--brand-ink);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border-strong);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: #8f1e17;
}

.btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 9px;
}

.btn--block {
  width: 100%;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field > span {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 0.35rem;
}

.input,
.select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 80, 125, 0.22);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
  margin-bottom: 1rem;
}

.alert--error {
  background: var(--danger-soft);
  border-color: #f0c4c1;
  color: #8f1e17;
}

.alert--ok {
  background: var(--ok-soft);
  border-color: #bfe0cd;
  color: #0f5132;
}

.alert--warn {
  background: var(--warn-soft);
  border-color: #ecd7a8;
  color: #74490a;
}

.alert[hidden],
[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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