/* /apostas — layout only: wizard (steps + option cards), páreos table, guichê facts.
 * Colours, type and shapes come from tokens/components; option cards reuse the
 * gate box and the white card of .tbl (light section). */

/* hero: +18 plate */
.ap-age { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; font-size: var(--fs-small); color: var(--color-muted); }
.ap-age b { display: block; color: var(--color-text); font-weight: 600; }

/* ── progress ─────────────────────────────────────────────────────────── */
.ap-progress { --steps: 6; }
.ap-progress .step { gap: 10px; padding-block: 18px 20px; transition: opacity var(--dur-base); }
.ap-progress .step b { font-size: 1.0625rem; }
.ap-progress .step:not([aria-current]):not(.is-done) b { color: var(--color-muted-light); }
.ap-progress .step:not([aria-current]):not(.is-done) .box { border-color: var(--line-light-strong); color: var(--color-muted-light); }
.ap-progress .step[aria-current="step"] { box-shadow: inset 0 -3px 0 var(--color-brand); }
.ap-now { margin: 16px 0 0; font-size: var(--fs-label); color: var(--color-muted-light); letter-spacing: .04em; text-transform: uppercase; }

/* ── form ─────────────────────────────────────────────────────────────── */
.ap-form, .ap-resumo { margin-top: clamp(24px, 3vw, 36px); }
.ap-step { border: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
.ap-step legend {
  display: flex; align-items: center; gap: 16px; padding: 0; margin-bottom: 4px;
  font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: var(--fs-h3); line-height: 1.1; text-transform: uppercase;
}
.ap-step legend:focus { outline: none; }
.ap-step legend:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 4px; }
.ap-help { color: var(--color-muted-light); max-width: 72ch; }

.ap-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-opts--mods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  min-height: 76px; padding: 14px 16px; cursor: pointer;
  background: var(--color-surface-white); border: 1px solid var(--line-light); border-left: 3px solid var(--line-light-strong);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.opt:hover { border-color: var(--color-ink); background: var(--color-row-hover); }
.opt__in { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opt__main { display: grid; gap: 4px; min-width: 0; }
.opt__t { font-family: var(--font-display); font-stretch: 85%; font-weight: 800; font-size: 1.0625rem; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
.opt__d { font: var(--fs-small)/1.45 var(--font-mono); color: var(--color-muted-light); }
.ap-opts--mods .opt__d { font-family: var(--font-body); }
.opt__tag { justify-self: end; }
.opt__pos { min-width: 2.5em; text-align: right; font-weight: 600; font-size: 1.125rem; }
.opt:has(.opt__in:checked) { border-color: var(--color-ink); border-left-color: var(--color-brand); }
.opt:has(.opt__in:checked) .box { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-surface-light); }
.opt:has(.opt__in:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.opt.is-disabled { opacity: .5; cursor: not-allowed; }
.opt.is-disabled:hover { border-color: var(--line-light); background: var(--color-surface-white); }
.ap-opts.is-invalid .opt { border-color: var(--color-error-light); }
.ap-opts--mods .opt { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.ap-opts--mods .opt__tag { grid-column: 2; justify-self: start; }

.ap-comb { font-size: var(--fs-small); color: var(--color-ink); }
.sec--light .ap-step .field__error { margin: 0; font-weight: 600; }

.ap-valor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ap-money { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.ap-money > span { font-size: 1.25rem; font-weight: 600; }
.sec--light .ap-money input { font: 500 1.375rem var(--font-mono); max-width: 280px; }
.ap-valor .notice a { color: var(--color-ink); }

.ap-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-light); }
.ap-nav [data-ap-next] { margin-left: auto; }

/* ── summary ──────────────────────────────────────────────────────────── */
.ap-resumo { background: var(--color-surface-white); border: 1px solid var(--line-light); border-top: 3px solid var(--color-ink); }
.ap-resumo__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; padding: 22px 24px; border-bottom: 1px solid var(--line-light-strong); }
.ap-resumo__head .sec__eyebrow { margin-bottom: 8px; }
.ap-resumo__head h3 { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: var(--fs-h3); text-transform: uppercase; line-height: 1.05; }
.ap-resumo__head h3:focus { outline: none; }
.ap-resumo__head h3:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 4px; }
.ap-sum { margin: 0; }
.ap-sum__row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 24px; padding: 16px 24px; border-bottom: 1px solid var(--line-light); }
.ap-sum dt { font: 500 var(--fs-micro)/1.6 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted-light); }
.ap-sum dd { margin: 0; overflow-wrap: anywhere; }
.ap-sum__comb { display: block; font-size: 1.375rem; font-weight: 500; margin-bottom: 12px; }
.ap-sum__horses { display: grid; gap: 8px; }
.ap-sum__horses li { display: flex; align-items: center; gap: 12px; }
.ap-sum__h { font-family: var(--font-display); font-stretch: 85%; font-weight: 800; text-transform: uppercase; }
.ap-resumo__note { margin: 20px 24px 0; }
.ap-resumo__cta { padding: 20px 24px 0; }
.ap-resumo__links { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 14px 24px 22px; font-size: var(--fs-small); }
.ap-resumo__links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.ap-resumo__links a:hover { color: var(--color-data-light); }

.ap-nojs a { color: var(--color-ink); }

/* ── páreos table (dark section) ──────────────────────────────────────── */
.ap-tbl__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; margin-bottom: 16px; }
.ap-tbl__head h3 { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; line-height: 1.1; }
.ap-tbl__head h3 span { color: var(--color-muted); font-weight: 600; }
.ap-tbl + .ap-tbl__head { margin-top: 32px; }
.ap-mods { justify-content: flex-start; max-width: none; }
.ap-mods .ap-mods__remate { border-color: var(--color-data-light); color: var(--color-data-light); }
.ap-note-dark { color: var(--color-muted); }

/* ── guichê facts ─────────────────────────────────────────────────────── */
.ap-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ap-facts .notice { background: var(--color-bg); }
.ap-facts .notice a { color: var(--color-text); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ap-progress { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ap-progress .step:nth-child(3n+1) { padding-left: 20px; border-left: 1px solid var(--line-light); }
  .ap-progress .step:first-child { padding-left: 0; border-left: 0; }
  .ap-progress .step p { display: none; }
  .ap-opts--mods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .ap-progress .step { padding: 14px 0 16px; border-left: 0; }
  .ap-progress .step + .step, .ap-progress .step:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .ap-progress .step b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ap-progress .step { justify-items: start; }
  .ap-opts, .ap-opts--mods { grid-template-columns: minmax(0, 1fr); }
  .ap-valor { grid-template-columns: minmax(0, 1fr); }
  .ap-sum__row { grid-template-columns: minmax(0, 1fr); padding: 14px 18px; }
  .ap-resumo__head { padding: 18px; }
  .ap-resumo__note { margin: 18px 18px 0; }
  .ap-resumo__cta { padding: 18px 18px 0; }
  .ap-resumo__links { padding: 12px 18px 18px; }
}
@media (max-width: 600px) {
  .ap-progress { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ap-progress .box--sm { width: 36px; height: 36px; font-size: .9375rem; }
  .opt { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; }
  .opt__tag, .opt__pos { grid-column: 2; justify-self: start; }
  .opt__pos { text-align: left; min-width: 0; }
  .opt__pos:empty { display: none; }
  .ap-nav .btn { flex: 1 1 0; padding-inline: 14px; }
  .ap-nav [data-ap-next] { margin-left: 0; }
  .ap-sum__comb { font-size: 1.125rem; }
  .ap-age .rg__age { width: 52px; height: 52px; font-size: 1.125rem; }
}

/* ── print: only the summary ──────────────────────────────────────────── */
@media print {
  .site-header, .raceday, .skip-link, .page-hero, .site-footer, .to-top, .cookiebar, .overlay,
  #paros, #guiche, #selecao .sec__head, .ap-progress, .ap-now, .ap-form, .ap-resumo__cta, .ap-resumo__links { display: none !important; }
  body, .sec, .sec--light { background: #fff !important; color: #000 !important; }
  .sec { padding: 0; }
  .container { max-width: none; padding: 0; }
  .ap-resumo { border: 1px solid #000; margin: 0; }
  .ap-resumo .tag, .ap-sum dt, .ap-resumo .notice p, .ap-resumo .sec__eyebrow { color: #000 !important; }
  .ap-resumo .notice { background: #fff; border-color: #000; }
  .ap-sum__row { break-inside: avoid; }
}
