/* ── Fiora — the configurator's own identity ───────────────────────────────
   Modelled on a real Italian car maker's online configurator: Poppins, a warm red,
   black-and-white pill buttons, a gallery beside a column of steps and a price bar
   that never leaves the screen. Its own tokens, so the studio's design system
   reaches only the frame at the top. */

:root {
  --f-red: #d13640;
  --f-accent: #e21246;
  --f-accent-hover: #a5151d;
  --f-ink: #000;
  --f-body: #5d5e65;
  --f-line: #dedede;
  --f-soft: #f4f4f4;
  --f-mid: #c4c4c4;
  --f-dark: #1c1f2a;
  --f-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-pill: 4.375rem;
  --f-bar-h: 84px;
}

body { margin: 0; background: #fff; color: var(--f-body); font: 400 15px/1.5 var(--f-font); }
h1, h2, h3 { color: var(--f-ink); font-family: var(--f-font); font-weight: 700; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.narrow-only { display: none; }

/* ── Buttons ── */
.btn { font: 600 14px/1 var(--f-font); border-radius: var(--f-pill); padding: 14px 26px; border: 1.5px solid var(--f-ink);
  background: #fff; color: var(--f-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--f-soft); }
.btn--dark { background: var(--f-ink); color: #fff; }
.btn--dark:hover { background: #2a2b31; }
.btn--accent { background: var(--f-accent); border-color: var(--f-accent); color: #fff; }
.btn--accent:hover { background: var(--f-accent-hover); border-color: var(--f-accent-hover); }
.btn--ghost { border-color: var(--f-mid); }
.link { background: none; border: 0; padding: 0; font: 600 14px var(--f-font); color: var(--f-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button:focus-visible, a:focus-visible, label:has(:focus-visible) { outline: 2px solid var(--f-accent); outline-offset: 2px; }

/* ── Header ── */
.fh { border-bottom: 1px solid var(--f-line); background: #fff; position: sticky; top: var(--is-topbar-h, 0); z-index: 20; }
.fh__row { max-width: 1440px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 40px; }
.fh__brand { color: var(--f-ink); display: flex; }
.fh__nav { display: flex; gap: 28px; flex: 1; }
.fh__nav a { color: var(--f-ink); text-decoration: none; font-weight: 500; padding: 20px 0; border-bottom: 3px solid transparent; }
.fh__nav a[aria-current] { border-color: var(--f-red); }
.fh__dealer { font: 500 14px var(--f-font); background: none; border: 0; color: var(--f-ink); cursor: pointer; }

/* ── Hub ──
   As fiat.it lays it out: filters in a white column, the range on a grey ground, one
   section per model and one white card per powertrain. */
.hub { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 64px); background: #f2f2f2; }
.hub__filters { background: #fff; padding: 36px 28px 120px; }
.hub__filters h2 { font-size: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--f-line); }
.chips { border: 0; margin: 0; padding: 22px 0; border-bottom: 1px solid var(--f-line); display: flex; gap: 10px; flex-wrap: wrap; }
.chips legend { float: left; width: 100%; font-weight: 600; color: var(--f-ink); margin-bottom: 14px; padding: 0; }
.chip { border: 1px solid var(--f-ink); border-radius: var(--f-pill); padding: 8px 16px; cursor: pointer; font-size: 13px; color: var(--f-ink); display: inline-flex; align-items: center; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(:checked) { background: var(--f-ink); color: #fff; }
.chip:has(:focus-visible) { outline: 2px solid var(--f-accent); outline-offset: 2px; }
.hub__main { padding: 36px 32px 140px; }
.hub__main h1 { font-size: 36px; margin-bottom: 8px; }
/* One grid for the whole range: a model with one card takes one cell, so a filtered few sit
   side by side; one with several takes the row, its cards on the same columns. */
.hub__grid, .family__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 24px; }
.hub__grid { margin-top: 28px; }
.hub__grid > .hub__empty, .family--many { grid-column: 1 / -1; }
.family__name { font-size: 26px; margin-bottom: 18px; }
.variant { position: relative; display: block; background: #fff; padding: 24px; text-decoration: none; color: inherit; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: box-shadow .2s; }
.variant:hover { box-shadow: 0 8px 26px rgba(0,0,0,.12); }
.variant__name { font-size: 24px; line-height: 1.2; padding-right: 40px; min-height: 58px; }
.variant__arrow { position: absolute; top: 24px; right: 22px; color: var(--f-ink); }
.variant__badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: #fff; background: var(--f-red); border-radius: var(--f-pill); padding: 3px 10px; }
.variant__art svg { width: 100%; height: auto; display: block; margin: 8px 0; }
.variant__label { font-size: 11px; margin: 0 0 6px; }
.variant__row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.variant__fuel { display: flex; align-items: center; gap: 10px; color: var(--f-ink); font-weight: 500; white-space: nowrap; }
.variant__what { display: grid; font-size: 12px; text-align: right; }
.variant__offer { margin: 16px 0 0; font-size: 12px; }
.variant__offer b { font-size: 17px; color: var(--f-ink); margin-left: 4px; }
.variant__list { margin: 6px 0 0; font-size: 12px; }
.variant__list b { color: var(--f-ink); }
.variant__offer + .variant__list { margin-top: 4px; }
.variant__row + .variant__list { margin-top: 16px; }
.hub__empty { padding: 40px 0; }

/* ── Pronta consegna ──
   The hub's frame, with one white card per car: what it is, where it is, what it costs. */
.stk__filters { padding-top: 22px; }
.stk__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.stk__head h1 { font-size: 36px; }
.stk__sort { margin: 0; font-size: 13px; }
.stk__sub { margin: 6px 0 18px; }
.stk__criteria { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.stk__criteria:empty { display: none; }
.stk__chip { font: 500 13px var(--f-font); border: 1px solid var(--f-ink); background: var(--f-ink); color: #fff; border-radius: var(--f-pill); padding: 7px 14px; cursor: pointer; }
.stk__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.stkcar { background: #fff; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.05); display: flex; flex-direction: column; }
.stkcar__art svg, .stkcar__art .car-photo { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.stkcar__name { font-size: 20px; line-height: 1.25; }
.stkcar__engine { margin: 4px 0 0; color: var(--f-ink); font-weight: 500; font-size: 13px; }
.stkcar__extras { margin: 4px 0 0; font-size: 12px; }
.stkcar__where { margin: 14px 0 0; font-size: 12px; }
.stkcar__where b { color: var(--f-ink); font-weight: 600; }
.stkcar__price { margin: 14px 0 0; font-size: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stkcar__price b { font-size: 20px; color: var(--f-ink); }
.stkcar__cta { margin-top: auto; align-self: flex-start; }
.stkcar__price + .stkcar__cta { margin-top: 16px; }
.stk__more { display: flex; margin: 32px auto 0; }
/* One stock car, laid out like the summary: what it is on the left, what it costs and where on the right. */
.det__back { display: inline-block; margin-bottom: 18px; font-size: 13px; }
.det__sub { margin: 6px 0 0; color: var(--f-ink); font-weight: 500; }
.det__items { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; }
.det__items li { margin-bottom: 6px; break-inside: avoid; }
.det__pack { margin-bottom: 14px; }
.det__pack h3 { font-size: 15px; margin-bottom: 6px; }
.det__pack .det__items { columns: 1; }
.det__where { margin: 0; color: var(--f-ink); }
.det__where b { display: block; font-size: 17px; }
.det__note { font-size: 13px; margin: 18px 0 14px; }
/* The price and the button stay in view while the build is read below the car. */
[data-view="auto"] .sum__side { position: sticky; top: calc(64px + var(--is-topbar-h, 0px) + 24px); }

/* ── Configurator ── */
.cfg { display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: calc(100vh - 64px - var(--f-bar-h)); }
.cfg__stage { background: linear-gradient(180deg, #fafafa 0%, var(--f-soft) 60%, #e9e9ea 100%); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 40px 190px; position: sticky; top: calc(64px + var(--is-topbar-h, 0px)); height: calc(100vh - 64px - var(--f-bar-h) - var(--is-topbar-h, 0px)); }
/* The bottom of the stage is kept clear: the voice dock and its transcript live there. */
.cfg__car { width: min(100%, 860px); }
.cfg__car svg, .car-photo { width: 100%; height: auto; display: block; }
/* Generated shots are framed on white; multiply lets that ground melt into the stage. */
.car-photo { mix-blend-mode: multiply; }
.cfg__caption { font-weight: 600; color: var(--f-ink); margin-top: 12px; }
.cfg__side { border-left: 1px solid var(--f-line); padding: 24px 28px calc(var(--f-bar-h) + 40px); }
.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.steps__btn { flex: 1; font: 600 13px var(--f-font); padding: 12px 10px; border: 0; border-bottom: 3px solid var(--f-line); background: none; color: var(--f-body); cursor: pointer; text-align: left; }
.steps__btn[aria-current="true"] { color: var(--f-ink); border-color: var(--f-red); }
.cfg__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cfg__model { margin: 0; font: 700 18px var(--f-font); color: var(--f-ink); }
.cfg__model .variant__badge { margin: 0 0 0 6px; vertical-align: middle; }
.cfg__links { display: flex; gap: 16px; }
.cfg__links .link { font-size: 13px; }
.panel__title { font-size: 26px; margin-bottom: 18px; }
.group { border: 0; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.group legend, .group__legend { font: 700 16px var(--f-font); color: var(--f-ink); margin-bottom: 10px; padding: 0; }
.group__empty { margin: 0; }
/* Colours as fiat.it shows them: a row of swatches, the chosen one spelled out underneath. */
.group--swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.group--swatches legend { width: 100%; }
.sw { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.sw__dot { width: 38px; height: 38px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.sw:hover .sw__dot { transform: scale(1.05); }
.sw:has(:checked) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--f-ink); }
.sw__picked { margin: -14px 0 26px; color: var(--f-body); }
.sw__picked b { color: var(--f-ink); }
.opt { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; border: 1.5px solid var(--f-line);
  border-radius: 12px; padding: 14px 16px; cursor: pointer; background: #fff; }
.opt:not(.opt--swatch):not(.opt--static) { grid-template-columns: 1fr; }
.opt:has(:checked) { border-color: var(--f-ink); box-shadow: inset 0 0 0 1px var(--f-ink); }
.opt.is-off { opacity: .45; cursor: not-allowed; }
.opt--static { cursor: default; }
.opt__name { font-weight: 600; color: var(--f-ink); }
.opt__detail { font-size: 13px; grid-column: 1 / -1; }
.opt--swatch .opt__detail, .opt--static .opt__detail { grid-column: 2; }
.opt__swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); grid-row: span 2; }
.more { margin: -10px 0 22px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--f-ink); text-decoration: underline; text-underline-offset: 3px; }
.more ul { margin: 10px 0 0; padding-left: 18px; }
.pack { border: 1.5px solid var(--f-line); border-radius: 12px; padding: 14px 16px; }
.pack:has(:checked) { border-color: var(--f-ink); }
.pack__row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pack__box { width: 20px; height: 20px; accent-color: var(--f-red); }
.pack__name { font-weight: 600; color: var(--f-ink); flex: 1; }
.pack .more { margin: 10px 0 0; }

/* ── Summary ── */
.sum { max-width: 1280px; margin: 0 auto; padding: 40px 32px calc(var(--f-bar-h) + 60px); display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; }
.sum h1 { font-size: 36px; }
.sum h2 { font-size: 20px; margin: 28px 0 12px; }
.sum__car { background: var(--f-soft); border-radius: 16px; padding: 24px; margin-top: 20px; }
.sum__car svg { width: 100%; height: auto; display: block; }
.sum__list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 20px; margin: 0 0 16px; }
.sum__list dt { font-weight: 600; color: var(--f-ink); }
.sum__list dd { margin: 0; }
.sum__side { background: var(--f-soft); border-radius: 16px; padding: 8px 28px 28px; align-self: start; }
.prices { width: 100%; border-collapse: collapse; }
.prices td { padding: 8px 0; border-bottom: 1px solid var(--f-line); }
.prices td:last-child { text-align: right; white-space: nowrap; color: var(--f-ink); }
.prices__total td { font-weight: 700; color: var(--f-ink); border-bottom: 0; font-size: 17px; }
.pay { margin: 0; color: var(--f-ink); font-size: 18px; }
.pay__small { margin: 4px 0 14px; font-size: 13px; }
.sum__code { margin: 22px 0 14px; }
.sum__ctas { display: grid; gap: 10px; }

/* ── Price bar ── */
.bar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--f-bar-h); background: #fff; border-top: 1px solid var(--f-line);
  box-shadow: 0 -6px 24px rgba(0,0,0,.06); display: flex; align-items: center; gap: 28px; padding: 0 32px; z-index: 30; }
.bar__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bar__label { font-size: 13px; }
.bar__price > b { font-size: 24px; color: var(--f-ink); }
.bar__rata b { color: var(--f-ink); }
.bar__list { font-size: 13px; text-decoration: line-through; }
.bar__eta { font-size: 13px; flex: 1; }
.bar__ctas { display: flex; gap: 10px; }

/* ── Dialogs ── */
.dlg.dlg--wide { width: min(980px, calc(100vw - 32px)); }
.cmp { overflow-x: auto; }
.cmp table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--f-line); }
.cmp thead th { font: 700 16px var(--f-font); color: var(--f-ink); }
.cmp tbody th { color: var(--f-ink); white-space: nowrap; }
.cmp ul { margin: 0; padding-left: 16px; }
.cmp__price, .cmp__now { color: var(--f-body); font-size: 12px; font-weight: 400; }
.cmp tbody tr:last-child td, .cmp tbody tr:last-child th { border-bottom: 0; }
.dlg { border: 0; border-radius: 18px; padding: 32px; width: min(520px, calc(100vw - 32px)); font-family: var(--f-font); color: var(--f-body); }
.dlg::backdrop { background: rgba(20, 22, 30, .55); }
.dlg h2 { font-size: 22px; margin-bottom: 14px; }
.dlg h3 { font-size: 15px; margin: 14px 0 6px; }
.dlg fieldset { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.dlg legend { font-weight: 600; color: var(--f-ink); margin-bottom: 8px; width: 100%; }
.dlg__sub { margin: -6px 0 16px; }
.dlg__code { font: 700 26px var(--f-font); color: var(--f-ink); letter-spacing: 2px; }
.dlg__ctas { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.field { display: grid; gap: 6px; font-weight: 600; color: var(--f-ink); margin-bottom: 14px; }
.field input:not([type=range]), .field select { font: 400 15px var(--f-font); padding: 12px 14px; border: 1.5px solid var(--f-mid); border-radius: 10px; }
.field input[type=range] { accent-color: var(--f-red); }
.check, .radio { display: flex; gap: 10px; align-items: center; color: var(--f-ink); }
.check input, .radio input { accent-color: var(--f-red); }
.fin__out { background: var(--f-soft); border-radius: 12px; padding: 14px 16px; }

/* ── Footer ── */
.ff { background: var(--f-dark); color: #b8bac2; font-size: 13px; padding: 28px 32px calc(var(--f-bar-h) + 28px); }
.ff p { max-width: 1100px; margin: 0 auto 8px; }
.ff b { color: #fff; }

/* The voice dock sits above the price bar, and never over the column of choices: in the
   configurator it moves onto the car's stage, in the summary beside the price panel.
   Its transcript grows upward from it, so where the dock is, the transcript is. */
.aui-dock { --aui-bottom: calc(var(--f-bar-h) + 16px); --aui-live: #1f7a4d; --aui-font: var(--f-font); }
body[data-view="configura"] .aui-dock { --aui-right: calc(440px + 24px); }
body[data-view="riepilogo"] .aui-dock, body[data-view="auto"] .aui-dock { --aui-right: calc(max(0px, (100vw - 1344px) / 2) + 32px + 420px + 24px); }

@media (max-width: 980px) {
  body[data-view] .aui-dock { --aui-right: 16px; }
  .fh__row { padding: 0 16px; gap: 18px; height: 56px; }
  .fh__nav { gap: 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .fh__nav a { font-size: 14px; padding: 17px 0; white-space: nowrap; }
  .fh__dealer { display: none; }
  .cfg { min-height: 0; }
  .cfg__stage { padding: 12px 16px 16px; }
  .cfg__caption { font-size: 13px; margin-top: 4px; }
  .cfg__side { padding: 18px 16px calc(var(--f-bar-h) + 40px); }
  .steps__btn { font-size: 12px; }
  .bar__price > b { font-size: 19px; }
  .bar__list { display: none; }
  .sum { padding: 24px 16px calc(var(--f-bar-h) + 40px); gap: 24px; }
  .sum__list { grid-template-columns: 120px 1fr; }
  .det__items { columns: 1; }
  [data-view="auto"] .sum__side { position: static; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .bar { height: 72px; --f-bar-h: 72px; }
  .bar__label, .bar__rata { display: none; }
  .bar__ctas .btn { padding: 12px 18px; }
  /* The shots carry wide white margins; on a phone the stage keeps only the car's band. */
  .cfg__car .car-photo, .sum__car .car-photo { aspect-ratio: 2 / 1; object-fit: cover; }
  /* On a phone the voice pill is the mic alone, so it does not sit on the choices. */
  .aui-dock .aui-pill { width: 48px; height: 48px; padding: 0; }
  .aui-dock .aui-pill .aui-label, .aui-dock .aui-pill .aui-dot { display: none; }
  .aui-dock .aui-pill .aui-mic { display: block; }
  .cfg, .sum { grid-template-columns: 1fr; }
  .cfg__stage { position: static; height: auto; padding-bottom: 40px; }
  .cfg__side { border-left: 0; }
  .bar { gap: 12px; padding: 0 16px; }
  .bar__eta, .bar__fin { display: none; }
  .bar__ctas { margin-right: 0; }
  .hub { grid-template-columns: 1fr; }
  .hub__filters { padding-bottom: 20px; }
}
@media (max-width: 420px) {
  .fh__row, .fh__nav { gap: 10px; }
  .fh__brand svg { width: 80px; height: auto; }
  .fh__nav a { font-size: 12px; }
}
