/*
 * How it works page (public round 4, design approved 2026-11-28).
 * Shared parts: site-v3.css (top bar, buttons, closing band, footer) and site-r4.css (rows, app windows).
 * Design: docs/design/public-pages-round-4/01-how-it-works-*.png
 */

/* ---------- Heading (left-aligned, unlike Prices/Security) ---------- */
.hiw-hero { position: relative; padding: 80px 0 56px; }
.hiw-hero::before {
  content: ''; position: absolute; left: 0; top: -80px; width: 100%; height: 620px; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse 55% 60% at 22% 40%, rgba(29, 95, 214, 0.10), transparent 70%),
              radial-gradient(ellipse 40% 50% at 78% 30%, rgba(255, 122, 26, 0.07), transparent 70%);
}
.hiw-hero .h-page { margin: 22px 0 0; max-width: 760px; }
.hiw-hero .lead { margin-top: 20px; max-width: 560px; font-size: 18px; }
.hiw-hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- The yard line ---------- */
.yl {
  margin: 0; padding: 28px 36px 32px; background: var(--white); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-window);
}
.yl-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.yl-tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.yl-tab {
  padding: 7px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.yl-tab:hover { color: var(--ink); }
.yl-tab[aria-pressed='true'] { background: var(--ink); color: #fff; }
.yl-follow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: #EAF1FC; color: var(--blue); font-size: 13px; font-weight: 600;
}
.yl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }

.yl-line {
  --at: 3; --gap: calc(100% / 7);
  position: relative; list-style: none; margin: 44px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, 1fr);
}
/* The track and the part already travelled */
.yl-line::before, .yl-line::after {
  content: ''; position: absolute; top: 37px; left: calc(var(--gap) / 2); height: 3px; border-radius: 3px;
}
.yl-line::before { right: calc(var(--gap) / 2); background: var(--line); }
.yl-line::after {
  width: calc(var(--gap) * var(--at)); background: linear-gradient(90deg, var(--blue), var(--sky));
  transition: width 600ms var(--ease);
}
.yl-stop { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; z-index: 1; }
.yl-n { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.yl-pin {
  width: 22px; height: 22px; border-radius: 50%; background: var(--white);
  border: 3px solid var(--line); transition: border-color 300ms var(--ease), background-color 300ms var(--ease), transform 300ms var(--ease);
}
.yl-name { font-size: 14px; font-weight: 600; color: var(--ink-2); transition: color 300ms var(--ease); }

/* Steps already done, and the step the car is at */
.yl-line[data-at='1'] .yl-stop:nth-child(-n+1) .yl-pin,
.yl-line[data-at='2'] .yl-stop:nth-child(-n+2) .yl-pin,
.yl-line[data-at='3'] .yl-stop:nth-child(-n+3) .yl-pin,
.yl-line[data-at='4'] .yl-stop:nth-child(-n+4) .yl-pin,
.yl-line[data-at='5'] .yl-stop:nth-child(-n+5) .yl-pin,
.yl-line[data-at='6'] .yl-stop:nth-child(-n+6) .yl-pin { background: var(--blue); border-color: var(--blue); }
.yl-line[data-at='0'] .yl-stop:nth-child(1) .yl-pin,
.yl-line[data-at='1'] .yl-stop:nth-child(2) .yl-pin,
.yl-line[data-at='2'] .yl-stop:nth-child(3) .yl-pin,
.yl-line[data-at='3'] .yl-stop:nth-child(4) .yl-pin,
.yl-line[data-at='4'] .yl-stop:nth-child(5) .yl-pin,
.yl-line[data-at='5'] .yl-stop:nth-child(6) .yl-pin,
.yl-line[data-at='6'] .yl-stop:nth-child(7) .yl-pin {
  background: var(--white); border-color: var(--blue); transform: scale(1.35);
}
.yl-line[data-at='0'] .yl-stop:nth-child(1) .yl-name,
.yl-line[data-at='1'] .yl-stop:nth-child(2) .yl-name,
.yl-line[data-at='2'] .yl-stop:nth-child(3) .yl-name,
.yl-line[data-at='3'] .yl-stop:nth-child(4) .yl-name,
.yl-line[data-at='4'] .yl-stop:nth-child(5) .yl-name,
.yl-line[data-at='5'] .yl-stop:nth-child(6) .yl-name,
.yl-line[data-at='6'] .yl-stop:nth-child(7) .yl-name { color: var(--blue); }
.yl-caption { margin-top: 22px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* ---------- The eight steps ---------- */
.hiw-steps { padding: 120px 0 40px; }

/* ---------- Every car at its step ---------- */
.hiw-track { padding: 80px 0 128px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 900px) {
  .hiw-hero { padding: 56px 0 40px; }
  .hiw-steps { padding: 88px 0 24px; }
  .yl { padding: 22px 20px 24px; border-radius: 20px; }
  .hiw-track { padding: 56px 0 88px; }
}
@media (max-width: 700px) {
  /* The line keeps its 7 stops; only the caption names the step the car is at. */
  .yl-name { display: none; }
  .yl-line { margin-top: 32px; }
  .yl-caption { margin-top: 18px; font-size: 14px; color: var(--blue); }
  .yl-follow { font-size: 12px; }
}
@media (max-width: 520px) {
  .hiw-hero-btns .btn { flex: 1 1 100%; }
}
