/* style.css — единственный файл стилей. Тёмная тема + типографика (модуль ui). */

:root {
  --bg: #14161a;
  --surface: #1d2026;
  --surface-2: #262a31;
  --fg: #e6e8eb;
  --muted: #9aa0a6;
  --accent: #5b9dd9;
  --accent-strong: #6fb0e8;
  --border: #333842;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app {
  width: 100%;
  max-width: 460px;
  padding: 64px 24px 48px;
}

h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Форма ─────────────────────────────────────────────────────────── */
.counter {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color-scheme: dark; /* тёмный нативный date-picker */
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 157, 217, 0.25);
}

.btn {
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: #0f1216;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--accent-strong); }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 157, 217, 0.4);
}

/* ── Результат ─────────────────────────────────────────────────────── */
.result {
  margin: 28px 0 0;
  min-height: 1.6em;
  font-size: 1.25rem;
  font-weight: 500;
}

.result:empty { display: none; }

.result--error { color: #e6957f; font-size: 1rem; font-weight: 400; }

.result strong {
  color: var(--accent-strong);
  font-weight: 700;
}

/* ── Мобайл (390) ──────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .app { padding: 40px 18px 36px; }
  h1 { font-size: 1.65rem; }
  .counter { padding: 20px; }
}
