/* ==========================================================================
   Blok „Sygnały z licznikiem” (.au-signals): kafle do zaznaczenia i karta z licznikiem;
   zaznaczenia trafiają do formularza (view.js → window.dtsFormPrefill).
   Źródło (prototyp): assets/css/podstrony/audyt.css („Kiedy warto zrobić audyt”).
   Miernik ma tyle segmentów, ile sygnałów (--n), kreska progu stoi po --k segmentach.
   ========================================================================== */

/* wspólne drobiazgi modułów Audytu (te same reguły w kilku blokach) */
/* the eyebrow takes its own row, so the copy on the right starts level with the title */
.au-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem);
}
.au-head > .eyebrow.eyebrow { grid-column: 1 / -1; margin: 0; }
.au-head h2 { margin: 0; max-width: 16ch; }
.au-head__lead, .au-head__lead p { margin: 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; max-width: 58ch; }
.au-head__lead p + p { margin-top: .7rem; }

.au-signals { padding: clamp(3.5rem, 7vw, 6rem) 0 var(--section-y); }
.au-signals__body {
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(.75rem, 1.4vw, 1.125rem); align-items: stretch;
}
.au-signals__list {
  margin: 0; padding: 0; border: 0; min-width: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.625rem, 1vw, .75rem);
}
.au-sig {
  position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; align-items: center; gap: .9rem;
  min-height: 76px; padding: .8rem 1rem .8rem .8rem; border-radius: 18px; cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line), 0 12px 26px -22px rgba(22, 42, 67, .4);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
/* an odd number of tiles: the last one takes the whole row */
.au-sig:last-child:nth-of-type(odd) { grid-column: 1 / -1; }
.au-sig:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 16px 30px -22px rgba(22, 42, 67, .5); }
.au-sig input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.au-sig__text { font-size: 1rem; font-weight: 500; line-height: 1.4; color: var(--navy-900); text-wrap: pretty; }
.au-sig__box {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 0 0 1.5px var(--muted-2); transition: background-color .25s, box-shadow .25s;
}
.au-sig__box .icon { width: 14px; height: 14px; stroke-width: 2.8; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s var(--ease); }
.au-sig:has(input:checked) { box-shadow: inset 0 0 0 2px var(--navy-900), var(--shadow-float); }
.au-sig input:checked + .au-tile { background: var(--orange); color: #fff; box-shadow: 0 8px 16px -10px rgba(236, 110, 40, .9); }
.au-sig input:checked ~ .au-sig__box { background: var(--navy-900); box-shadow: none; }
.au-sig input:checked ~ .au-sig__box .icon { opacity: 1; transform: none; }
.au-sig:has(input:focus-visible) { outline: 2px solid var(--navy-900); outline-offset: 3px; }

.au-gauge {
  display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.4rem, 2.4vw, 1.9rem); border-radius: var(--radius-xl);
  background: radial-gradient(70% 55% at 100% 0%, rgba(248, 120, 49, .08), rgba(248, 120, 49, 0) 70%), #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 22px 44px -30px rgba(22, 42, 67, .45);
}
.au-gauge__label { margin: 0; font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; color: var(--muted); }
.au-gauge__result { display: grid; gap: 1rem; }
.au-gauge__count {
  margin: 0; display: flex; align-items: baseline; gap: .5rem;
  font-size: clamp(3.25rem, 2.4rem + 2.4vw, 4.5rem); font-weight: 300; line-height: .9; letter-spacing: -.04em;
  color: var(--navy-900); font-variant-numeric: tabular-nums;
}
.au-gauge__count small { font-family: var(--font-ui); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
/* one segment per signal; the mark after the k-th is where the audit starts to pay off */
.au-meter { position: relative; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 4px; margin-top: 1.1rem; }
.au-meter i { height: 12px; border-radius: 3px; background: var(--navy-50); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .35s, box-shadow .35s; }
.au-meter i.is-on { background: var(--orange-600); box-shadow: none; }
/* a 2px line whose label overflows it evenly, centred above the line */
.au-meter__mark {
  position: absolute; top: -1.25rem; bottom: -5px; width: 2px; margin-left: -1px;
  left: calc((100% - (var(--n, 7) - 1) * 4px) * var(--k, 2) / var(--n, 7) + (var(--k, 2) - .5) * 4px);
  display: flex; justify-content: center; align-items: flex-start;
  font-family: var(--font-ui); font-size: .75rem; font-weight: 600; line-height: 1; color: var(--navy-900); font-variant-numeric: tabular-nums;
}
.au-meter__mark::after { content: ""; position: absolute; left: 0; right: 0; top: 1rem; bottom: 0; border-radius: 1px; background: var(--navy-900); }
.au-gauge__say { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--navy-900); }
.au-gauge .btn { margin-top: auto; justify-content: space-between; }
.no-js .au-gauge__result { display: none; }

/* --------------------------------------------------------------------------
   Responsywność
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .au-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .au-head h2 { max-width: 18ch; }
  .au-signals__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .au-signals__list { grid-template-columns: minmax(0, 1fr); }
  .au-sig { min-height: 0; }
}
@media (max-width: 560px) {
  .au-gauge .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .au-sig { transition: none; }
  .au-sig:hover { transform: none; }
}
