/* AI CONTEXT: Fundament stylów
   PURPOSE: Tokeny kolorów i typografii, reset, formularze, przyciski.
   DEPENDENCIES: brak */

:root {
  color-scheme: light dark;

  --bg: #f4f5f4;
  --surface: #ffffff;
  --surface-2: #ebeeec;
  --line: #dee2e0;
  --line-strong: #8b9491;
  --text: #14181a;
  --muted: #4e5654;
  --faint: #626c69;
  --accent: #0d7349;
  --accent-ink: #ffffff;
  --accent-soft: #dbeee4;
  --danger: #9d3520;
  --danger-soft: #f6e2dc;

  --radius: 10px;
  --shadow: 0 1px 2px rgb(18 30 24 / 0.05), 0 12px 28px -16px rgb(18 30 24 / 0.28);

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

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.375rem);

  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f0e;
    --surface: #151817;
    --surface-2: #1c2120;
    --line: #272d2b;
    --line-strong: #5c6663;
    --text: #edf1ef;
    --muted: #97a29e;
    --faint: #838e8a;
    --accent: #4bd28d;
    --accent-ink: #06170e;
    --accent-soft: #142a1f;
    --danger: #e08a72;
    --danger-soft: #2a1814;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 28px -16px rgb(0 0 0 / 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

main {
  flex: 1;
  padding-block: 40px 72px;
}

/* Typografia */

.title {
  font-size: var(--text-xl);
  font-weight: 640;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

.subtitle {
  font-size: var(--text-lg);
  font-weight: 620;
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.meta {
  color: var(--muted);
  font-size: var(--text-sm);
}

.num {
  font-variant-numeric: tabular-nums;
}

.hint {
  color: var(--faint);
  font-size: var(--text-sm);
}

/* Formularze */

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 560;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

input::placeholder {
  color: var(--faint);
}

input:hover:not(:disabled) {
  border-color: var(--muted);
}

input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

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

.field {
  margin-bottom: 18px;
}

.field__error {
  margin-top: 6px;
  color: var(--danger);
  font-size: var(--text-sm);
}

/* Przyciski */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 560;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  border-color: var(--muted);
}

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

.btn--primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.btn--primary:hover {
  border-color: var(--accent);
  filter: brightness(1.06);
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding-inline: 8px;
}

.btn--quiet:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.btn--danger {
  color: var(--danger);
  border-color: var(--line-strong);
  background: transparent;
}

.btn--danger:hover {
  border-color: var(--danger);
}

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

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