/* «Configura il tuo Custodo» and the request band (configurator-page.mjs),
   owner 2026-11-10: the filters as chips on top, the configuration with its
   two actions in view, the films uncropped, the request form centred. The top
   bar lies over the charcoal tops (header.css). Colours are tokens only. */

/* ── Configurator ─────────────────────────────────────────────────────────── */
.configurator { background: var(--wash); color: var(--teal); }
.config-top { padding: var(--topbar-clearance) 0 76px; background: var(--brand-on-primary); color: var(--brand-on-dark); }
.config-intro { max-width: 760px; }
.config-eyebrow { margin: 0 0 12px; color: var(--brand-primary); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.config-intro h1 { margin: 0; color: var(--brand-on-dark); font-size: clamp(36px, 4.4vw, 64px); font-weight: 800; line-height: 1.02; letter-spacing: -.05em; }
.config-intro > p:last-child { max-width: 620px; margin: 16px 0 0; color: color-mix(in srgb, var(--brand-on-dark) 80%, transparent); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.55; }
/* The quick filters, a column on the left (owner, 2026-11-10: «tieni i filtri in scopri nel menù di sinistra»). */
.config-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; gap: 28px; margin-top: 28px; }
.config-filters { position: sticky; top: 168px; display: grid; gap: 22px; max-height: calc(100vh - 188px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.config-chip-group { display: grid; gap: 10px; }
.config-chip-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.config-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.config-chip { position: relative; display: inline-flex; flex: none; }
.config-chip input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.config-chip span { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--teal); font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.config-chip:hover span { border-color: var(--teal); }
.config-chip input:checked + span { border-color: var(--brand-primary); background: var(--brand-primary); color: var(--brand-on-primary); }
.config-chip input:checked + span::before { content: ''; width: 5px; height: 9px; margin: -3px 2px 0 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.config-chip input:focus-visible + span { outline: 3px solid var(--brand-primary); outline-offset: 3px; }

.config-body { position: relative; padding-bottom: 72px; }
/* The configuration: what is in the visitor's Custodo and its two actions. */
.config-bar { position: sticky; top: 84px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: -36px; padding: 14px 14px 14px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 44px color-mix(in srgb, var(--brand-on-primary) 16%, transparent); }
.config-bar-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.config-bar-title { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; }
.config-selection-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.config-selection-list button { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 10px 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--wash); color: var(--teal); font: 600 12px/1 var(--font); cursor: pointer; animation: config-pop .25s ease; }
.config-selection-list button::after { content: '×'; font-size: 15px; line-height: 1; }
.config-selection-list button:hover { border-color: var(--teal); }
.config-selection-more { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.config-bar-actions { display: flex; flex-shrink: 0; gap: 8px; }
.config-bar-actions .button { min-height: 46px; padding: 11px 20px; border-radius: var(--r-pill); font-size: 14px; white-space: nowrap; }
.config-users { display: flex; flex-shrink: 0; align-items: center; gap: 10px; margin-left: auto; }
.config-users label { color: var(--teal); font-size: 14px; font-weight: 700; white-space: nowrap; }
.config-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--wash); }
.config-stepper button { width: 36px; height: 40px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--teal); font: 700 18px/1 var(--font); cursor: pointer; }
.config-stepper button:hover:not(:disabled) { background: var(--surface); }
.config-stepper button:disabled { color: var(--muted); cursor: default; opacity: .55; }
.config-stepper input { width: 54px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--teal); font: 700 15px/1 var(--font); text-align: center; -moz-appearance: textfield; appearance: textfield; }
.config-stepper input::-webkit-outer-spin-button, .config-stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.config-stepper input::placeholder { color: var(--muted); }
.config-stepper input:focus-visible, .config-stepper button:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.config-users { position: relative; }
.config-users.is-alert .config-stepper { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.config-users-alert { position: absolute; top: calc(100% + 8px); right: 0; z-index: 2; margin: 0; padding: 7px 12px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: 700; white-space: nowrap; }
.config-bar-actions .button[aria-disabled="true"] { opacity: .55; }
.config-bar-actions .button[aria-disabled="true"]:hover { transform: none; }
@keyframes config-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.config-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 16px; }
.config-search { flex: 1 1 300px; margin: 0; }
.config-search input { width: 100%; min-height: 46px; padding: 11px 18px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--teal); font: inherit; font-size: 15px; transition: border-color .2s ease, box-shadow .2s ease; }
.config-search input:focus { border-color: var(--brand-on-primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 55%, transparent); }
.config-result-count { color: var(--muted); font-size: 14px; }
.config-toggle { position: relative; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; cursor: pointer; }
.config-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.config-toggle span { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.config-toggle span::before { content: ''; width: 40px; height: 24px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--teal) 22%, transparent); transition: background-color .2s ease; }
.config-toggle span::after { content: ''; position: absolute; top: 50%; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transform: translateY(-50%); transition: transform .2s ease; }
.config-toggle input:checked + span::before { background: var(--brand-on-primary); }
.config-toggle input:checked + span::after { transform: translate(16px, -50%); }
.config-toggle input:focus-visible + span::before { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.config-reset { justify-self: start; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--teal); font: 600 14px/1 var(--font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
/* A card: the film's photograph whole on the left, what the module does on the
   right. A press anywhere adds it (configurator.js); only ▶ plays the film. */
.config-card { position: relative; display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; scroll-margin-top: 170px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.config-card:hover { box-shadow: 0 18px 40px color-mix(in srgb, var(--brand-on-primary) 14%, transparent); transform: translateY(-3px); }
.config-card:has(.config-add :checked) { border-color: var(--brand-primary); box-shadow: 0 0 0 2px var(--brand-primary); }
.config-card-media { --film-accent: var(--brand-campaign-red); position: relative; isolation: isolate; flex: none; align-self: flex-start; width: clamp(150px, 36%, 230px); aspect-ratio: 2 / 3; overflow: hidden; background: var(--brand-on-primary); color: var(--brand-on-dark); }
.config-card:nth-child(4n + 2) .config-card-media { --film-accent: var(--brand-campaign-blue); }
.config-card:nth-child(4n + 3) .config-card-media { --film-accent: var(--brand-campaign-purple); }
.config-card:nth-child(4n + 4) .config-card-media { --film-accent: var(--brand-primary); }
/* The photograph at its own 2:3: nothing is cut. */
.config-card-media img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.config-card:hover .config-card-media img { transform: scale(1.04); }
.config-card-media::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--brand-on-primary) 40%, transparent), transparent 24%, transparent 50%, color-mix(in srgb, var(--brand-on-primary) 92%, transparent) 94%); }
.config-card .campaign-film-title { right: 14px; bottom: 16px; left: 14px; font-size: clamp(20px, 1.6vw, 27px); }
.config-card .config-play { position: absolute; top: 10px; right: 10px; z-index: 2; display: block; flex: none; width: 46px; height: 46px; aspect-ratio: auto; overflow: visible; border-radius: 50%; background: none; box-shadow: none; }
.config-card .config-play::after { display: none; }
.config-card .config-play:hover { box-shadow: none; transform: none; }
.config-card .config-play .campaign-film-play { top: 0; right: 0; }
.config-card-body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 20px 22px 18px; }
.config-card-area { align-self: flex-start; margin: 0 0 10px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--wash); color: var(--teal); font-size: 11px; font-weight: 700; }
.config-card h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.config-card-body > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.config-card-body > ul { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; color: var(--muted); font-size: 13px; line-height: 1.45; list-style: none; }
.config-card-body > ul li { position: relative; padding-left: 16px; }
.config-card-body > ul li::before { content: ''; position: absolute; top: .5em; left: 0; width: 7px; height: 7px; border-radius: 2px; background: var(--brand-primary); }
/* «Aggiungi»: a pill like the shop's «add to cart», lime once added. */
.config-add { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin-top: auto; border: 1px solid var(--brand-on-primary); border-radius: var(--r-pill); color: var(--brand-on-primary); font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.config-add input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.config-add:hover { background: var(--brand-on-primary); color: var(--brand-on-dark); }
.config-add:has(:checked) { border-color: var(--brand-primary); background: var(--brand-primary); color: var(--brand-on-primary); }
.config-add:has(:focus-visible) { outline: 3px solid var(--brand-primary); outline-offset: 3px; }
.config-add-mark { position: relative; width: 14px; height: 14px; }
.config-add-mark::before, .config-add-mark::after { content: ''; position: absolute; border-radius: 1px; background: currentColor; }
.config-add-mark::before { top: 1px; left: 6px; width: 2px; height: 12px; }
.config-add-mark::after { top: 6px; left: 1px; width: 12px; height: 2px; }
.config-add:has(:checked) .config-add-mark::before { top: -1px; left: 4px; width: 5px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; background: none; transform: rotate(45deg); }
.config-add:has(:checked) .config-add-mark::after { display: none; }
.config-no-results { padding: 56px 20px; color: var(--muted); text-align: center; }
.config-included { margin: 28px 0 0; color: var(--muted); font-size: 12px; }
.configurator [hidden], .contact-band [hidden] { display: none !important; }
.configurator :focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 3px; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

/* ── Request band: the dedicated page and the homepage's closing ──────────── */
/* «Meno dubbi / Più risposte» on the left, the form on the right, the pair centred. */
.contact-band { padding: clamp(72px, 10vw, 128px) 0; background: var(--brand-on-primary); color: var(--brand-on-dark); }
.contact-band.is-page { display: flex; align-items: center; min-height: 100svh; padding: var(--topbar-clearance) 0 64px; }
.contact-band.is-page > .wrap { width: calc(100% - 2 * var(--site-gutter)); }
.contact-band-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 680px); align-items: center; gap: clamp(32px, 5vw, 80px); max-width: 1240px; margin: 0 auto; }
.contact-band-copy { min-width: 0; }
.contact-band .campaign-display { margin: 0; color: var(--brand-on-dark); font-size: clamp(44px, 5vw, 80px); }
.contact-band .contact-card { width: 100%; max-width: none; margin: 0; padding: 26px 28px 22px; border: 0; border-radius: 22px; background: var(--surface); box-shadow: 0 30px 80px color-mix(in srgb, var(--brand-on-primary) 70%, transparent); color: var(--teal); text-align: left; }
.request-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; gap: 14px; }
.request-fields:has([data-request-message][hidden]) { grid-template-columns: minmax(0, 1fr); }
.request-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.request-field input, .request-field textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--teal); font: inherit; font-size: 15px; font-weight: 400; transition: border-color .2s ease, box-shadow .2s ease; }
.request-field input:focus, .request-field textarea:focus { border-color: var(--brand-on-primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 55%, transparent); }
.request-field textarea { height: 50px; min-height: 50px; max-height: 220px; line-height: 1.45; resize: vertical; }
.request-note { margin: -2px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.request-submit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.contact-band .verification-block { min-width: 0; margin: 0; }
.contact-band .verification-status { margin: 6px 0 0; }
/* The check's words only when the visitor has to act; screen readers hear them all. */
.contact-band .verification-status:not(.is-alert) { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contact-band .submit-button { justify-content: center; width: 100%; min-height: 54px; margin: 0; border-radius: var(--r-pill); font-size: 16px; }
.contact-band .form-privacy { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.contact-band .contact-success { padding: 18px 0 6px; text-align: center; }
.contact-band .contact-success h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.contact-band .contact-success p { margin: 12px 0 20px; }
.contact-band :focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 3px; }

@media (max-width: 1000px) {
  .config-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .config-filters { position: static; max-height: none; overflow: visible; padding: 16px; }
}
@media (max-width: 900px) {
  .config-bar { top: 70px; }
  .contact-band-grid { grid-template-columns: minmax(0, 1fr); max-width: 600px; }
}
@media (max-width: 719px) {
  .config-top { padding-bottom: 60px; }
  /* On a phone the filters are rows that scroll sideways, edge to edge, with no box around them. */
  .config-filters { gap: 14px; padding: 0; border: 0; border-radius: 0; background: none; }
  .config-chip-row { flex-wrap: nowrap; margin-inline: calc(-1 * var(--site-gutter)); padding: 0 var(--site-gutter) 2px; overflow-x: auto; scrollbar-width: none; }
  .config-chip-row::-webkit-scrollbar { display: none; }
  /* Not on a phone (owner, 2026-11-10: «rimuovi da mobile»): the two actions are pinned at the bottom and a chosen card shows it is chosen. */
  .config-bar { display: none; }
  .config-layout { margin-top: 24px; }
  .config-grid { gap: 12px; }
  .config-card { border-radius: 14px; }
  .config-card-media { width: 128px; }
  .config-card .campaign-film-title { right: 10px; bottom: 10px; left: 10px; font-size: 16px; }
  .config-card .config-play { top: 6px; right: 6px; width: 36px; height: 36px; }
  .config-card .config-play .campaign-film-play { width: 36px; height: 36px; }
  .config-card-body { padding: 12px 14px; }
  .config-card-area { margin-bottom: 6px; font-size: 10px; }
  .config-card h2 { font-size: 16px; }
  .config-card-body > p { margin-bottom: 10px; font-size: 13px; }
  .config-card-body > ul { display: none; }
  .config-add { min-height: 40px; font-size: 13px; }
  .contact-band .contact-card { padding: 20px; }
  .request-fields, .request-submit { grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .config-card, .config-chip span, .config-add, .config-toggle span::before, .config-toggle span::after { transition: none; }
  .config-card:hover { transform: none; }
  .config-selection-list button { animation: none; }
}
