/* ============================================================================
   hearing-test.css — orientacyjny test słuchu (/test-sluchu)

   Większość użytkowników to osoby starsze: duże pola do kliknięcia (min.
   48 px), czytelna czcionka, wysoki kontrast, jasne stany. Przycisk
   „Słyszę” jest duży, bo w czasie testu wzrok bywa skupiony gdzie indziej.
   ============================================================================ */

.ht-app { max-width: 760px; margin: 0 auto; }

.ht-card {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
}
.ht-card h2 { font-size: 24px; line-height: 1.3; margin: 0 0 12px; color: var(--color-ink, #0f172a); }
.ht-card h2:focus { outline: none; }
.ht-card h3 { font-size: 19px; margin: 0 0 12px; }
.ht-card p { font-size: 16px; line-height: 1.65; color: var(--color-ink-mid, #334155); }
.ht-lead { font-size: 17px !important; }
.ht-muted { font-size: 14px !important; color: var(--color-ink-soft, #64748b) !important; }
.ht-sub { margin-top: 24px !important; }

.ht-ticks { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.ht-ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.ht-ticks .bi { color: var(--color-primary, #1d4ed8); font-size: 20px; flex-shrink: 0; margin-top: 1px; }

.ht-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.55;
  margin: 18px 0 22px;
  color: #78350f;
}

.ht-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 8px; }
.ht-app .btn--lg { min-height: 52px; padding: 12px 24px; font-size: 16.5px; }

/* ── Etapy ─────────────────────────────────────────────────────────── */
.ht-steps {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  counter-reset: st;
}
.ht-steps li {
  flex: 1;
  counter-increment: st;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted, #94a3b8);
  border-top: 4px solid var(--color-border, #e2e8f0);
  padding-top: 6px;
}
.ht-steps li.is-done    { color: var(--color-ink-soft, #64748b); border-color: var(--color-primary-light, #93c5fd); }
.ht-steps li.is-current { color: var(--color-primary, #1d4ed8); border-color: var(--color-primary, #1d4ed8); }

/* ── Ankieta ───────────────────────────────────────────────────────── */
.ht-form { display: grid; gap: 14px; }
.ht-q { border: 0; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--color-border-soft, #f1f5f9); }
.ht-q legend { font-size: 16px; font-weight: 600; line-height: 1.45; margin-bottom: 10px; color: var(--color-ink, #0f172a); }
.ht-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ht-opt { position: relative; }
.ht-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ht-opt span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 2px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  font-size: 15.5px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ht-opt span:hover { border-color: var(--color-primary, #1d4ed8); }
.ht-opt input:checked + span { border-color: var(--color-primary, #1d4ed8); background: var(--color-primary, #1d4ed8); color: #fff; font-weight: 600; }
.ht-opt input:focus-visible + span { outline: 3px solid var(--color-primary-light, #93c5fd); outline-offset: 2px; }
.ht-error { color: #b91c1c !important; font-weight: 600; }

/* ── Przygotowanie ─────────────────────────────────────────────────── */
.ht-check { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.ht-check label { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; cursor: pointer; padding: 10px 12px; border-radius: 10px; background: var(--color-surface, #f8fafc); }
.ht-check input { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; accent-color: var(--color-primary, #1d4ed8); }

.ht-lr { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.ht-lr .btn--lg { min-width: 130px; justify-content: center; }

/* ── Test ─────────────────────────────────────────────────────────── */
.ht-test { text-align: center; }
.ht-progress { height: 10px; background: var(--color-surface, #f1f5f9); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.ht-progress span { display: block; height: 100%; width: 0; background: var(--color-primary, #1d4ed8); transition: width .3s ease; }
.ht-ear { font-size: 17px !important; font-weight: 700; color: var(--color-ink, #0f172a) !important; min-height: 1.6em; }

.ht-hear {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  margin: 12px auto 18px;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary, #1d4ed8);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(29, 78, 216, .3);
  transition: transform .08s ease, background .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;   /* bez opóźnienia i powiększania przy stuknięciu */
}
.ht-hear .bi { font-size: 56px; }
.ht-hear:hover { background: var(--color-primary-dark, #1e40af); }
.ht-hear:focus-visible { outline: 4px solid var(--color-primary-light, #93c5fd); outline-offset: 4px; }
/* Krótka informacja zwrotna po naciśnięciu — BEZ zdradzania, czy był dźwięk. */
.ht-hear.is-pressed { transform: scale(.95); background: var(--color-primary-dark, #1e40af); }

.ht-app kbd {
  font-family: inherit;
  font-size: 13px;
  padding: 2px 7px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--color-surface, #f8fafc);
}

/* ── Wynik ────────────────────────────────────────────────────────── */
.ht-alert { border-left-width: 6px; }
.ht-alert h2 { display: flex; gap: 10px; align-items: flex-start; }
.ht-alert--urgent { border-color: #dc2626; background: #fef2f2; }
.ht-alert--urgent h2 .bi { color: #dc2626; }
.ht-alert--doctor { border-color: #ea580c; background: #fff7ed; }
.ht-alert--doctor h2 .bi { color: #ea580c; }
.ht-alert--check  { border-color: var(--color-primary, #1d4ed8); background: #eff6ff; }
.ht-alert--check h2 .bi { color: var(--color-primary, #1d4ed8); }
.ht-alert--repeat { border-color: #ca8a04; background: #fefce8; }
.ht-alert--repeat h2 .bi { color: #ca8a04; }
.ht-alert--ok     { border-color: #16a34a; background: #f0fdf4; }
.ht-alert--ok h2 .bi { color: #16a34a; }
.ht-reasons { margin: 10px 0 0; padding-left: 20px; }
.ht-reasons li { font-size: 15.5px; line-height: 1.55; margin-bottom: 4px; }

.ht-chart { margin: 0; }
.ht-chart svg { width: 100%; height: auto; display: block; }
.ht-grid  { stroke: var(--color-border-soft, #eef2f7); stroke-width: 1; }
.ht-limit { stroke: #fca5a5; stroke-width: 1.5; stroke-dasharray: 5 4; }
.ht-axis  { font-size: 12px; fill: var(--color-ink-soft, #64748b); }
.ht-line  { fill: none; stroke-width: 2; }
.ht-line--right { stroke: #dc2626; }
.ht-line--left  { stroke: #2563eb; stroke-dasharray: 5 3; }
.ht-mark--right { fill: #fff; stroke: #dc2626; stroke-width: 2.5; }
.ht-mark--left  { fill: none; stroke: #2563eb; stroke-width: 2.5; }
.ht-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; margin-top: 8px; color: var(--color-ink-soft, #64748b); }
.ht-legend--right { color: #dc2626; font-weight: 600; }
.ht-legend--left  { color: #2563eb; font-weight: 600; }

.ht-next__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ht-next__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color .12s, background .12s;
}
a.ht-next__item:hover { border-color: var(--color-primary, #1d4ed8); background: #f8fbff; }
.ht-next__item .bi { font-size: 22px; color: var(--color-primary, #1d4ed8); flex-shrink: 0; }
.ht-next__item strong { display: block; font-size: 15px; margin-bottom: 2px; }
.ht-next__item span { font-size: 13.5px; line-height: 1.45; color: var(--color-ink-soft, #64748b); }

/* ════════════════════════════════════════════════════════════════════
   STRONA: fakty w nagłówku, dwie kolumny, sekcje z linkami
   Wzorzec jak kalkulator i strona główna: .section / .section-title /
   .section--alt z main.css, FAQ jako <details>, baner jak .cta-banner.
   ════════════════════════════════════════════════════════════════════ */
.ht-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.ht-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink-mid, #334155);
}
.ht-facts .bi { color: var(--color-primary, #1d4ed8); }

.ht-page { padding-top: 24px; padding-bottom: 8px; }

/* Test + panel boczny. Test ma pierwszeństwo: na telefonie panel spada
   POD test, żeby nie przesuwać przycisku „Zaczynamy” w dół ekranu. */
.ht-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (min-width: 992px) {
  .ht-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .ht-aside  { position: sticky; top: 88px; }
}
.ht-layout .ht-app { max-width: none; margin: 0; }

.ht-aside { display: grid; gap: 14px; }
.ht-aside__box {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  padding: 16px 18px;
}
.ht-aside__box--warn { background: #fef2f2; border-color: #fecaca; }
.ht-aside__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ht-aside__box--warn .ht-aside__title .bi { color: #dc2626; }
.ht-aside__box p { font-size: 14.5px; line-height: 1.55; margin: 0; color: var(--color-ink-mid, #334155); }
.ht-aside__list { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.7; color: var(--color-ink-mid, #334155); }
.ht-aside__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--color-primary, #1d4ed8);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .22);
  transition: background .15s;
}
.ht-aside__cta:hover { background: var(--color-primary-dark, #1e40af); color: #fff; }
.ht-aside__cta > .bi:first-child { font-size: 22px; }
.ht-aside__cta span { flex: 1; font-size: 13.5px; line-height: 1.4; opacity: .95; }
.ht-aside__cta strong { display: block; font-size: 15px; }

/* .section-title z main.css nie ma dolnego marginesu (kalkulator dokłada
   go stylem w linii przy każdym nagłówku). Tutaj raz, dla całej strony. */
.ht-page .section-title { margin-bottom: 20px; }

.ht-section-lead { max-width: 760px; color: var(--color-ink-soft, #475569); font-size: 16px; line-height: 1.7; margin-bottom: 24px; }

.ht-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.ht-feature {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  padding: 20px;
}
.ht-feature .bi {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--color-primary, #1d4ed8);
  font-size: 20px;
  margin-bottom: 12px;
}
.ht-feature h3 { font-size: 16.5px; margin: 0 0 6px; }
.ht-feature p { font-size: 14.5px; line-height: 1.6; margin: 0; color: var(--color-ink-soft, #475569); }

/* Przebieg — pozioma oś na komputerze, pionowa na telefonie */
.ht-howto { border-radius: var(--radius-xl, 20px); padding: 40px; margin-bottom: 8px; }
.ht-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  counter-reset: none;
}
.ht-timeline li { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ht-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 44px;
  right: -12px;
  height: 2px;
  background: var(--color-primary-light, #bfdbfe);
}
.ht-timeline__n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.ht-timeline strong { font-size: 15.5px; }
.ht-timeline span:not(.ht-timeline__n) { font-size: 14px; line-height: 1.5; color: var(--color-ink-soft, #475569); }

.ht-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ht-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ht-link:hover { border-color: var(--color-primary, #1d4ed8); box-shadow: 0 8px 20px rgba(15, 23, 42, .07); transform: translateY(-2px); }
.ht-link .bi { font-size: 24px; color: var(--color-primary, #1d4ed8); margin-bottom: 6px; }
.ht-link strong { font-size: 16px; color: var(--color-ink, #0f172a); }
.ht-link span { font-size: 14px; line-height: 1.5; color: var(--color-ink-soft, #475569); }

.ht-faq { display: grid; gap: 10px; max-width: 860px; }
.ht-faq__item { border: 1px solid var(--color-border, #e2e8f0); border-radius: 12px; background: #fff; }
.ht-faq__q {
  cursor: pointer;
  list-style: none;
  padding: 16px 48px 16px 18px;
  font-size: 16px;
  font-weight: 600;
  position: relative;
}
.ht-faq__q::-webkit-details-marker { display: none; }
.ht-faq__q::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-primary, #1d4ed8);
}
.ht-faq__item[open] .ht-faq__q::after { content: "−"; }
.ht-faq__a { padding: 0 18px 16px; }
.ht-faq__a p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--color-ink-mid, #334155); }

/* Baner — jak .cta-banner na stronie głównej */
.ht-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin: 40px 0 16px;
  padding: 36px 40px;
  border-radius: var(--radius-xl, 20px);
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.ht-banner__title { color: #fff; font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin: 0 0 6px; }
.ht-banner__sub { color: rgba(255, 255, 255, .75); font-size: 16px; line-height: 1.6; margin: 0; max-width: 520px; }
.ht-banner__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ht-banner__link { color: rgba(255, 255, 255, .85); font-size: 14.5px; }
.ht-banner__link:hover { color: #fff; }

.ht-disclaimer { font-size: 13.5px; color: var(--color-ink-soft, #64748b); text-align: center; margin: 8px 0 40px; }

@media (max-width: 860px) {
  .ht-timeline { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ht-timeline li { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .ht-timeline li::after { display: none; }
  .ht-timeline__n { margin-bottom: 0; }
  .ht-timeline span:not(.ht-timeline__n) { flex-basis: 100%; padding-left: 48px; }
  .ht-howto { padding: 28px 20px; }
  .ht-banner { padding: 28px 22px; }
}

@media (max-width: 600px) {
  .ht-card { padding: 20px 16px; border-radius: 14px; }
  .ht-card h2 { font-size: 21px; }
  .ht-steps li { font-size: 0; }          /* na telefonie same paski postępu */
  .ht-app .btn--lg { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-progress span, .ht-hear { transition: none; }
}

/* ── Wydruk wyniku — do zabrania na badanie ───────────────────────── */
@media print {
  .site-header, .site-footer, .page-header, .ht-actions, .ht-steps, .ht-aside, .section,
  .related-articles, .ht-banner, .ht-disclaimer,
  .ht-next__grid, .cookie-consent, .search-overlay, .md-notice { display: none !important; }
  .ht-card { box-shadow: none; border-color: #999; page-break-inside: avoid; }
  .ht-result::before {
    content: "Orientacyjny test słuchu — WybierzAparat.pl. To nie jest badanie diagnostyczne.";
    display: block;
    font-size: 12px;
    margin-bottom: 10px;
  }
}
