/* Палітра збігається зі src/theme/colors.ts. Оранжевий лише для декору: на білому він не дає контрасту 4.5:1 для тексту. */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-muted: #f1ece4;
  --border: #ddd5c9;
  --text: #1b1f2a;
  --text-secondary: #545b6b;
  --primary: #1d4e89;
  --primary-edge: #143a68;
  --on-primary: #ffffff;
  --accent: #e8730c;
  --correct: #1e7b45;
  --correct-bg: #e3f3e9;
  --incorrect: #b3261e;
  --incorrect-bg: #fbe6e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(27 31 42 / 6%), 0 8px 24px rgb(27 31 42 / 6%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --surface: #1b1f29;
    --surface-muted: #242936;
    --border: #353b4a;
    --text: #f2efea;
    --text-secondary: #b4bac7;
    --primary: #8db8f0;
    --primary-edge: #5e8fcb;
    --on-primary: #0e1a2b;
    --accent: #ffa24d;
    --correct: #6bd49a;
    --correct-bg: #163324;
    --incorrect: #ff8a80;
    --incorrect-bg: #3a1a18;
    --shadow: none;
  }
}

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

html {
  font-size: 112.5%; /* 18px: аудиторія 50+ */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2rem, 42rem);
  margin-inline: auto;
}

/* Шапка */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--primary);
  border-bottom-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary-edge);
  color: var(--on-primary);
}

.btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Hero */
.hero {
  padding-block: 2.5rem 3.5rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 5.5vw, 3.1rem);
  letter-spacing: -0.01em;
  max-width: 20ch;
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
}

h3 {
  font-size: 1.15rem;
}

.lead {
  margin: 1.2rem 0 1.8rem;
  max-width: 38rem;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* Макет питання в hero: показує механіку, не скріншот застосунку */
.sample {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.sample-label {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sample-q {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.sample-q .hl {
  text-decoration: underline dotted var(--accent) 3px;
  text-underline-offset: 0.25em;
}

.sample-opt {
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}

.sample-opt.is-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.sample-es {
  margin: 1rem 0 0;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 0.95rem;
}

/* Секції */
section {
  padding-block: 2.5rem;
}

.section-alt {
  background: var(--surface-muted);
}

.section-intro {
  margin: 0.8rem 0 0;
  max-width: 40rem;
  color: var(--text-secondary);
}

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  padding: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card p {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
}

.facts {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.facts strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
  color: var(--primary);
}

.facts span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.free-list {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
}

.free-list li + li {
  margin-top: 0.4rem;
}

/* Форма списку очікування */
.form-box {
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.field label {
  font-weight: 600;
}

.field input[type='email'],
.field select {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--primary);
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.form-note {
  margin: 0.8rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.form-status {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status.ok {
  background: var(--correct-bg);
  color: var(--correct);
}

.form-status.err {
  background: var(--incorrect-bg);
  color: var(--incorrect);
}

.form-box .btn {
  margin-top: 1.2rem;
  width: 100%;
}

/* FAQ */
details {
  border-bottom: 1px solid var(--border);
  padding-block: 0.9rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

details p {
  margin: 0.6rem 0 0;
  color: var(--text-secondary);
}

/* Футер */
.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0 0 0.6rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
}

/* Тест */
.quiz-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.progress {
  height: 8px;
  margin-top: 0.6rem;
  border-radius: 99px;
  background: var(--surface-muted);
  overflow: hidden;
}

.progress > div {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.25s ease;
}

.quiz-sign {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.quiz-sign svg {
  width: 9rem;
  height: 9rem;
}

.quiz-stem {
  margin: 1.2rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
}

.options {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option {
  width: 100%;
  min-height: 3.4rem;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.option:hover:not([disabled]) {
  border-color: var(--primary);
}

.option[disabled] {
  cursor: default;
}

.option.is-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.option.is-wrong {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
}

.feedback {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--surface-muted);
}

.feedback strong {
  display: block;
  margin-bottom: 0.3rem;
}

.feedback.ok strong {
  color: var(--correct);
}

.feedback.bad strong {
  color: var(--incorrect);
}

.quiz-next {
  margin-top: 1.2rem;
  width: 100%;
}

.result-score {
  margin: 0.6rem 0 0;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.3rem;
}

.prose p,
.prose li {
  color: var(--text-secondary);
}

.facts-lg strong {
  font-size: 1.6rem;
}

.band {
  margin-top: 1rem;
  background: var(--primary);
  color: var(--on-primary);
}

.band .section-intro {
  color: inherit;
  opacity: 0.9;
}

.band .btn {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border);
}

.band .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b1f2a;
}

.form-status .suggest {
  margin-left: 0.4rem;
  padding: 0.2rem 0.6rem;
  border: 2px solid currentcolor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* Мобільні: цілі натискання ≥ 44px, кнопки на всю ширину, менші цифри у фактах */
.brand,
.nav-link,
.footer-links a,
.form-note a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-links {
  gap: 0 1.4rem;
}

@media (max-width: 40rem) {
  .btn-row .btn {
    flex: 1 1 100%;
  }

  .facts-lg strong {
    font-size: 1.3rem;
  }
}
