/* AutoNest: styles for the homepage sections far below the first screen
   (road, income table, cooperation terms, audience/agreement, contact form).
   Loaded without blocking the first paint (index.html: media="print" swap), after css/site.css,
   so the first screen draws sooner. Only the homepage uses these classes. */

/* ---------- Kto jeździ Twoim autem (#tenants) ----------
   A short white pause between the black process band and the black road. */

.tenants {
  padding-block: calc(var(--section) * 0.7);
  background: var(--c-white);
}

.tenants-head {
  display: grid;
  gap: var(--s-4);
}

.section .tenants-head h2 {
  margin: 0;
}

.tenants-head .prose {
  max-width: var(--measure);
  margin: 0;
  color: var(--c-muted);
}

.tenant-list {
  display: grid;
  gap: var(--s-5);
  margin: var(--s-7) 0 0;
  padding: 0;
  list-style: none;
}

.tenant {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* framed like the icons in "Warunki współpracy" (.fact-mark), in the light-section line colour */
.tenant-mark {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--s-4);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
}

.tenant-mark svg {
  display: block;
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tenant h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 400;
  line-height: 1.2;
}

.tenant p {
  margin: var(--s-2) 0 0;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.tenant-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
  color: var(--c-ink);
  font-size: var(--fs-sm);
}

.tenant-facts li {
  position: relative;
  padding-left: 1.5rem;
}

/* small check mark in the accent colour */
.tenant-facts li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.35em;
  width: 0.75rem;
  height: 0.4rem;
  border-left: 1.5px solid var(--c-accent);
  border-bottom: 1.5px solid var(--c-accent);
  transform: rotate(-45deg);
}

@media (min-width: 720px) {
  .tenant-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
  }

}

@media (min-width: 1100px) {
  .tenants-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(1.5rem, 3vw, 3rem);
    align-items: end;
  }

  .section .tenants-head h2 {
    grid-column: 1 / 7;
  }

  .tenants-head .prose {
    grid-column: 7 / 13;
  }
}

/* ---------- Droga Twojego wynagrodzenia (#compensation) ----------
   A night drive over the footer-map streets. Static by default (whole road lit, all stops listed);
   js/road.js adds the month marks and, when motion is allowed, .is-live: the section becomes a tall
   scroll track, the stage pins to the screen and scrolling drives the car from start to finish.
   The wide road shows from 720px, the tall one below. */

.road {
  padding-block: var(--section);
  color: var(--c-white);
  background: var(--c-black);
  scroll-margin-top: var(--nav-h);
}

.road-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
}

.road-kicker {
  margin: 0 0 var(--s-3);
  color: var(--c-silver);
}

.road h2 {
  max-width: 24ch;
  margin: 0;
  color: var(--c-white);
  font-size: var(--fs-h2);
}

.road-meter {
  display: grid;
  justify-items: end;
  margin: 0;
  text-align: right;
}

.road-meter-label,
.road-month {
  color: var(--c-silver);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
}

.road-meter-label {
  text-transform: uppercase;
}

.road-total {
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 4.25rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.road-map {
  position: relative;
  margin-top: var(--s-6);
  aspect-ratio: 400 / 760;
  max-height: 80svh;
  margin-inline: auto;
}

@media (min-width: 720px) {
  .road-map {
    width: min(100%, 80rem);
    aspect-ratio: 1200 / 460;
    max-height: none;
  }
}

.road-city {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 40%, transparent 100%);
  pointer-events: none;
  /* own layer: drawn once, never repainted while the road animates above it */
  will-change: transform;
}

.road-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.road-svg-wide {
  display: none;
}

@media (min-width: 720px) {
  .road-svg-wide {
    display: block;
  }

  .road-svg-tall {
    display: none;
  }
}

.road-svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.road-edge {
  stroke: #2a2e33;
  stroke-width: 34;
}

.road-body {
  stroke: #101214;
  stroke-width: 30;
}

.road-dash {
  stroke: #4a4f56;
  stroke-width: 1.5;
  stroke-dasharray: 10 12;
}

/* lit stretch behind the car: pathLength="1", so the offset is simply 1 - progress */
.road-glow,
.road-trail {
  stroke-dasharray: 1 1;
  stroke-dashoffset: var(--road-left, 0);
}

.road-glow {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 12;
}

.road-trail {
  stroke: var(--c-white);
  stroke-width: 2.5;
}

.road-svg text {
  fill: #7b8189;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.road-svg-tall text {
  font-size: 24px;
}

.road-svg .road-tick {
  stroke: #4a4f56;
  stroke-width: 2;
}

.road-svg .road-tick.is-major {
  stroke-width: 3;
}

.road-svg .road-branch {
  stroke: #1d2023;
  stroke-width: 22;
}

.road-svg .road-branch-dash {
  stroke: #4a4f56;
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
}

.road-sign-box {
  fill: #121417;
  stroke: #4a4f56;
  stroke-width: 1.5;
}

.road-sign-glyph {
  fill: #a4a9b0;
  font-weight: 700;
}

.road-svg .road-sign-glyph {
  letter-spacing: 0;
}

.road-svg .road-sign-icon {
  fill: none;
  stroke: #a4a9b0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.road-svg .is-past .road-sign-icon {
  stroke: var(--c-white);
}

/* passed marks light up */
.road-svg .is-past .road-tick,
.road-svg .road-tick.is-past {
  stroke: var(--c-white);
}

.road-svg .is-past text,
.road-svg text.is-past {
  fill: var(--c-white);
}

.road-svg .is-past .road-sign-box {
  stroke: var(--c-white);
}

.road-svg .is-past .road-sign-glyph {
  fill: var(--c-white);
}

.road-svg .road-sign[data-stop="finish"].is-past .road-sign-box {
  fill: var(--c-accent);
  stroke: var(--c-accent);
}

.road-car {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  will-change: transform;
  display: none;
  width: 3rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -1.5rem;
  pointer-events: none;
}

/* headlight beam */
.road-car::before {
  content: "";
  position: absolute;
  left: 92%;
  top: 50%;
  width: 6.5rem;
  height: 3.5rem;
  margin-top: -1.75rem;
  background: radial-gradient(ellipse 100% 60% at 0% 50%, rgba(255, 240, 200, 0.38), transparent 70%);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
}

.road-car svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.road-car-body {
  fill: var(--c-white);
}

.road-car-glass {
  fill: #1d2023;
}

.road-car-lamp {
  fill: none;
  stroke: #ffe9a8;
  stroke-width: 2;
  stroke-linecap: round;
}

.road-toasts {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.road-toast {
  position: absolute;
  margin: -2.25rem 0 0;
  color: var(--c-white);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: road-toast 1100ms var(--ease-out) forwards;
}

.road-toast.is-big {
  color: #7fb8ff;
  font-size: var(--fs-lead);
}

@keyframes road-toast {
  0% { opacity: 0; transform: translate(-50%, 0.5rem); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -2.25rem); }
}

/* ---- stops ---- */

.road-foot {
  margin-top: var(--s-6);
}

.road-stops {
  display: grid;
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .road-stops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .road-stops {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.road-stop {
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-line-dark);
}

.road-fig {
  margin: 0 0 var(--s-3);
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.road-fig span {
  display: block;
  margin-top: var(--s-1);
  color: var(--c-silver);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}

.road-stop[data-stop="finish"] .road-fig {
  color: #7fb8ff;
}

.road-stop h3 {
  margin: 0;
  color: var(--c-white);
  font-size: var(--fs-body);
}

.road-stop p:not(.road-fig) {
  margin: var(--s-2) 0 0;
  color: var(--c-silver);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.road-note {
  margin: var(--s-5) 0 0;
  color: #7b8189;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* ---- live: pinned stage driven by scroll ---- */

.road.is-live {
  height: 420svh;
  padding: 0;
  /* the pinned stage brings its own room for the nav bar: land flush with the top of the screen
     (cancels the page scroll padding) */
  scroll-margin-top: calc(-1 * var(--nav-h));
}

.road.is-live .road-pin {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100svh;
  padding: calc(var(--nav-h) + var(--s-4)) 0 var(--s-4);
  overflow: hidden;
}

.road.is-live .road-map {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  margin-top: var(--s-4);
}

.road.is-live .road-car {
  display: block;
}

.road.is-live .road-foot {
  margin-top: var(--s-4);
}

/* one stop at a time, all in one grid cell so the height never jumps */
.road.is-live .road-stops {
  grid-template-columns: minmax(0, 1fr);
}

.road.is-live .road-stop {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2) var(--s-6);
  max-width: 56rem;
  padding-top: var(--s-3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.road.is-live .road-stop.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.road.is-live .road-fig {
  margin: 0;
}

/* phones and tablets: leave room for the docked call-to-action bar */
@media (max-width: 1199px) {
  body.cta-dock .road.is-live .road-pin {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 720px) {
  .road.is-live .road-stop {
    grid-template-columns: 13rem minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 719px) {
  .road.is-live .road-kicker {
    display: none;
  }

  .road.is-live .road-head {
    flex-wrap: nowrap;
    align-items: center;
  }

  .road.is-live h2 {
    font-size: 1.625rem;
  }

  .road.is-live .road-total {
    font-size: 1.625rem;
  }

  .road.is-live .road-fig {
    font-size: 1.375rem;
  }

  .road.is-live .road-fig span {
    display: inline;
    margin-left: var(--s-2);
  }

  .road.is-live .road-stop p:not(.road-fig) {
    font-size: var(--fs-xs);
  }

  .road.is-live .road-note {
    margin-top: var(--s-3);
    font-size: 0.6875rem;
  }

  .road-car {
    width: 2.25rem;
    height: 1.125rem;
    margin: -0.5625rem 0 0 -1.125rem;
  }
}

/* ---------- Dochód (tabela) ---------- */

/* Rows slide up into place when revealed; overflow-y stays hidden (with room below for the slide)
   so the browser never flashes a vertical scrollbar beside the table mid-animation. */
.deal-scroll {
  margin-top: var(--s-7);
  margin-bottom: -1rem;
  padding-bottom: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
}

.deal {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.deal caption {
  caption-side: bottom;
  padding-top: var(--s-4);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  text-align: left;
}

.deal th,
.deal td {
  padding: var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--c-line);
  font-weight: 400;
  text-align: right;
  vertical-align: baseline;
}

.deal thead th {
  padding-top: var(--s-5);
  border-bottom-color: var(--c-ink);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.deal th:first-child,
.deal td:first-child {
  padding-left: 0;
  color: var(--c-muted);
  text-align: left;
}

.deal tbody th {
  font-size: var(--fs-sm);
}

.deal .pick,
.deal thead .pick {
  background: var(--c-white);
  color: var(--c-ink);
  font-weight: 600;
}

/* The highlighted column reads as a raised white sheet with a hairline accent cap. */
.deal thead .pick {
  position: relative;
  color: var(--c-ink);
  font-weight: 600;
  box-shadow: inset 0 2px 0 var(--c-accent);
}

.deal tr.total th,
.deal tr.total td {
  padding-block: var(--s-5);
  border-bottom: 0;
  color: var(--c-ink);
  font-size: var(--fs-lead);
  font-weight: 600;
}

.deal tr.total td.pick {
  color: var(--c-ink);
}

.cell-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.aside-note {
  max-width: 52rem;
  margin-top: var(--s-6);
  padding-left: var(--s-5);
  border-left: 1px solid var(--c-ink);
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

@media (max-width: 719px) {
  .deal-scroll {
    overflow: visible;
  }

  .deal {
    display: block;
    min-width: 0;
    border-top: 1px solid var(--c-ink);
  }

  .deal thead {
    display: none;
  }

  .deal caption {
    display: block;
    width: 100%;
  }

  .deal tbody,
  .deal tr,
  .deal th,
  .deal td {
    display: block;
    width: auto;
    text-align: left;
  }

  .deal tr {
    padding: var(--s-4) 0 var(--s-3);
    border-bottom: 1px solid var(--c-line);
  }

  .deal th,
  .deal td {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-1) 0;
    border-bottom: 0;
  }

  .deal th[scope="row"] {
    padding-bottom: var(--s-2);
    color: var(--c-ink);
    font-weight: 600;
  }

  .cell-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    color: var(--c-muted);
    white-space: normal;
  }

  .deal .pick {
    margin-inline: calc(-1 * var(--s-3));
    padding-inline: var(--s-3);
    font-weight: 600;
  }

  .deal .pick .cell-label {
    color: var(--c-ink);
  }

  .deal tr.total {
    border-bottom: 0;
  }

  .deal tr.total th,
  .deal tr.total td {
    padding-block: var(--s-1);
    font-size: var(--fs-body);
  }
}

/* ---------- Warunki współpracy ---------- */

.facts {
  display: grid;
  margin: var(--s-7) 0 0;
  border-top: 1px solid var(--c-line-dark);
}

.fact {
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--c-line-dark);
}

.facts dt {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
  color: var(--c-white);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.facts dd {
  max-width: 34rem;
  margin: 0;
  color: var(--c-silver);
}

.fact-mark {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--c-steel);
}

.fact-mark svg {
  display: block;
  width: 3rem;
  height: 3rem;
  color: var(--c-white);
  fill: none;
  stroke: var(--c-white);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 720px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .fact:nth-child(odd) {
    padding-right: clamp(2rem, 4vw, 4rem);
    border-right: 1px solid var(--c-line-dark);
  }

  .fact:nth-child(even) {
    padding-left: clamp(2rem, 4vw, 4rem);
  }
}

.pledge-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-5);
  margin-top: var(--s-8);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--c-graphite);
  border: 1px solid var(--c-line-dark);
}

.pledge-bar p {
  max-width: 34ch;
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: var(--track-display);
}

.pledge-bar .button {
  flex: none;
}

@media (min-width: 880px) {
  .pledge-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 519px) {
  .pledge-bar .button {
    width: 100%;
  }
}

/* ---------- Dla kogo / Warunki umowy ---------- */

.bleed {
  display: grid;
  gap: var(--s-7);
}

.bleed .split-copy {
  display: flex;
  flex-direction: column;
  padding-inline: var(--gutter);
}

.media-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 18rem;
  background: var(--c-mist);
}

.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 18rem;
  object-fit: cover;
}

.media-frame img[src*="mercedes-eclass"] {
  object-position: 32% 70%;
}

.media-frame img[src*="mercedes-wheel"] {
  object-position: 46% center;
}

/* The photographs sit flush against their neighbours: E-Class on the black band above,
   the wheel on the form section below (desktop and mobile). */
#audience {
  padding-top: 0;
  padding-bottom: calc(var(--section) / 2);
}

#agreement {
  padding-top: calc(var(--section) / 2);
  padding-bottom: 0;
}

@media (min-width: 880px) {
  .bleed-start,
  .bleed-end {
    align-items: stretch;
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .bleed-start {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 1fr);
    padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  }

  .bleed-end {
    grid-template-columns: minmax(16rem, 1fr) minmax(0, 1fr);
    padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  }

  .bleed .split-copy {
    justify-content: center;
    padding-inline: 0;
  }

  #audience .split-copy {
    padding-top: calc(var(--section) / 2);
  }

  #agreement .split-copy {
    padding-bottom: calc(var(--section) / 2);
  }

  .media-frame {
    min-height: 32rem;
  }

  .media-frame img {
    position: absolute;
    inset: 0;
    min-height: 0;
  }
}

.fit,
.clauses {
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--c-line);
}

.fit li,
.clauses li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-line);
}

.fit li::marker,
.clauses li::marker,
.policy li::marker {
  content: none;
}

.fit li::before,
.clauses li::before,
.policy li::before {
  content: "";
  flex: 0 0 auto;
  width: 0.75rem;
  height: 1px;
  margin-top: 0.8em;
  background: var(--c-ink);
}

/* ---------- Formularz ---------- */

.act {
  border: 0;
}

.form-panel {
  display: grid;
  gap: var(--s-7);
  align-items: start;
}

.form-intro h2 {
  max-width: 14ch;
  margin: 0 0 var(--s-5);
}

.form-lead {
  max-width: var(--measure);
  color: var(--c-muted);
  font-size: var(--fs-lead);
  line-height: 1.55;
}

form {
  margin: 0;
}

#contact-form {
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--c-white);
  border: 1px solid var(--c-line);
}

@media (min-width: 1100px) {
  .form-panel {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(3rem, 6vw, 6rem);
  }

  .form-intro {
    position: sticky;
    /* motion.js lowers this when the intro is taller than the viewport. */
    top: var(--intro-top, calc(var(--nav-h) + var(--s-6)));
  }
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s-4);
    row-gap: var(--s-5);
  }

  .field-name { grid-column: span 6; }
  .field-phone { grid-column: span 6; }
  .field-email { grid-column: span 7; }
  .field-nip { grid-column: span 5; }
  .field-firma { grid-column: 1 / -1; }
  .registry-inner .field-address { grid-column: 1 / -1; }
  .registry-inner .field-regon { grid-column: span 6; }
  .registry-inner .field-krs { grid-column: span 6; }

  .form-hint,
  .field-note,
  .field-wide,
  fieldset,
  .field-debt,
  .consent,
  .form-row,
  .form-status,
  .registry-fields,
  .span-all {
    grid-column: 1 / -1;
  }
}

.form-hint {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.req {
  color: var(--c-error);
  font-weight: 600;
}

.field {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
}

label,
legend {
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
}

.field-name,
.field-phone,
.field-email,
.field-nip,
.field-firma,
.field-address,
.field-regon,
.field-krs {
  width: 100%;
}

input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  min-width: 0;
  min-height: var(--field-h);
  margin: 0;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-field);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: max(1rem, 16px);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover {
  border-color: var(--c-ink);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: inset 0 0 0 1px var(--c-accent), 0 0 0 4px var(--c-accent-ring);
}

input.invalid,
input[aria-invalid="true"] {
  border-color: var(--c-error);
}

input.invalid:focus {
  border-color: var(--c-error);
  box-shadow: inset 0 0 0 1px var(--c-error), 0 0 0 4px rgba(179, 38, 30, 0.2);
}

fieldset {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: var(--s-2);
}

/* Car count: native radios stay in place (focusable, clickable), the label becomes the target. */
.choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--field-h);
  padding: 0 var(--s-3);
  border: 1px solid var(--c-field);
  background: var(--c-white);
  font-size: var(--fs-body);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.choice:last-child {
  grid-column: 1 / -1;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--c-ink);
}

.choice:has(input:checked) {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-white);
}

.choice:has(input:focus-visible) {
  box-shadow: inset 0 0 0 1px var(--c-accent), 0 0 0 4px var(--c-accent-ring);
  border-color: var(--c-accent);
}

.choices.invalid .choice {
  border-color: var(--c-error);
}

@media (min-width: 720px) {
  .choices {
    grid-template-columns: repeat(4, minmax(3.5rem, 1fr)) minmax(9rem, 2.2fr);
  }

  .choice:last-child {
    grid-column: auto;
  }
}

@supports not selector(:has(*)) {
  .choice input {
    position: static;
    width: 1.125rem;
    height: 1.125rem;
    margin-right: var(--s-2);
    opacity: 1;
    accent-color: var(--c-ink);
  }
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  min-height: 0;
  color: var(--c-error);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.field-error:empty {
  display: none;
}

.field-error:not(:empty)::before,
.form-status.error:not(:empty)::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm.9 12H7.1v-1.8h1.8V12Zm0-3.4H7.1V4h1.8v4.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm.9 12H7.1v-1.8h1.8V12Zm0-3.4H7.1V4h1.8v4.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.span-all.field-error {
  margin-top: calc(-1 * var(--s-3));
}

/* Debt answer: custom listbox driven by form.js */
.debt-menu {
  position: relative;
}

.debt-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.debt-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  min-height: var(--field-h);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-field);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: max(1rem, 16px);
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.debt-trigger:hover {
  border-color: var(--c-ink);
}

.debt-trigger:focus-visible,
.debt-menu.is-open .debt-trigger {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: inset 0 0 0 1px var(--c-accent), 0 0 0 4px var(--c-accent-ring);
}

.debt-menu.is-placeholder .debt-trigger {
  color: var(--c-muted);
}

.debt-trigger svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: var(--c-ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-base) var(--ease-out);
}

.debt-menu.is-open .debt-trigger svg {
  transform: rotate(180deg);
}

.field-debt select.invalid ~ .debt-trigger {
  border-color: var(--c-error);
}

.debt-list {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  margin: 0;
  padding: var(--s-1) 0;
  border: 1px solid var(--c-ink);
  background: var(--c-white);
  box-shadow: var(--shadow-overlay);
  transform-origin: top center;
  animation: list-in var(--t-base) var(--ease-out);
}

.debt-list[hidden] {
  display: none;
}

@keyframes list-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.debt-list [role="option"] {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--s-3) var(--s-6) var(--s-3) var(--s-4);
  border: 0;
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: max(1rem, 16px);
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.debt-list [role="option"]:first-child {
  color: var(--c-muted);
}

.debt-list [role="option"]:hover {
  background: var(--c-mist);
}

.debt-list [role="option"]:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: -2px;
  background: var(--c-mist);
}

.debt-list [role="option"][aria-selected="true"]:not([data-value=""]) {
  font-weight: 600;
}

.debt-list [role="option"][aria-selected="true"]:not([data-value=""])::after {
  content: "";
  position: absolute;
  right: var(--s-4);
  top: 50%;
  width: 0.4rem;
  height: 0.75rem;
  margin-top: -0.5rem;
  border: solid var(--c-ink);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.field-note {
  min-height: 1.35em;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.field-note:empty {
  display: none;
}

.registry-fields {
  min-width: 0;
}

.registry-fields[hidden] {
  display: none;
}

.registry-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  min-width: 0;
}

@media (min-width: 720px) {
  .registry-inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s-4);
  }
}

.registry-fields.is-open {
  animation: registry-in 480ms var(--ease-out);
}

@keyframes registry-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to { opacity: 1; transform: none; }
}

/* Data-safety note above the consent checkbox. */
.form-privacy {
  display: grid;
  grid-template-columns: 1.375rem minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
  margin-top: var(--s-2);
  padding: var(--s-4);
  background: var(--c-mist);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.form-privacy svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: var(--c-success);
  stroke-width: 1.6;
}

.form-privacy strong {
  color: var(--c-ink);
  font-weight: 600;
}

.consent {
  display: grid;
  grid-template-columns: 1.375rem minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  border: 1px solid var(--c-field);
  border-radius: var(--radius);
  background: var(--c-white);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}

.consent input[type="checkbox"]::after {
  content: "";
  width: 0.375rem;
  height: 0.7rem;
  margin-top: -0.15rem;
  border: solid var(--c-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--t-fast) var(--ease-out);
}

.consent input[type="checkbox"]:hover {
  border-color: var(--c-ink);
}

.consent input[type="checkbox"]:checked {
  background: var(--c-ink);
  border-color: var(--c-ink);
}

.consent input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.consent input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}

.consent input.invalid {
  border-color: var(--c-error);
}

.consent a {
  color: var(--c-accent);
}

.consent a:hover {
  color: var(--c-accent-hover);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  margin-top: var(--s-3);
}

.form-row .button {
  width: 100%;
  min-height: var(--field-h);
  font-size: var(--fs-body);
}

@media (min-width: 720px) {
  .form-row .button {
    width: auto;
    min-width: 16rem;
  }
}

.form-status {
  max-width: var(--measure);
  min-height: 0;
  font-size: var(--fs-sm);
}

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

.form-status.error {
  display: flex;
  gap: var(--s-2);
  color: var(--c-error);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* site.css switches these off for reduced motion, but this file loads later, so repeat it here */
@media (prefers-reduced-motion: reduce) {
  .registry-fields.is-open,
  .debt-list {
    animation: none;
  }
}
