:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #13213a;
  background: #f3f6fb;
  font-synthesis: none;
  --blue: #0a4fd6;
  --blue-dark: #073a9d;
  --blue-soft: #eaf2ff;
  --cyan: #19c8bb;
  --border: #dbe3ef;
  --muted: #65738a;
  --danger: #c73333;
  --shadow: 0 16px 45px rgba(24, 43, 77, 0.1);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, #edf4ff 0, #f6f8fc 280px, #f3f6fb 100%); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.site-header { background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(213,223,238,.95); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.header-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-group { display: flex; align-items: center; gap: 18px; }
.brand-logo { width: 156px; height: auto; display: block; }
.cert-logo { width: 82px; height: auto; object-fit: contain; }
.brand-kicker { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h1 { font-size: 1.45rem; margin: 2px 0 0; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 28px auto 64px; }
.intro-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px 34px; border-radius: 24px; background: linear-gradient(135deg, #fff, #eef6ff); border: 1px solid #d5e4fb; box-shadow: var(--shadow); }
.intro-card h2 { margin: 6px 0 8px; font-size: clamp(1.55rem, 3vw, 2.35rem); letter-spacing: -.03em; }
.intro-card p { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.55; }
.eyebrow { color: var(--blue); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.security-note { min-width: 250px; background: rgba(255,255,255,.85); border: 1px solid #dce9f9; border-radius: 16px; padding: 15px; display: flex; gap: 12px; align-items: center; }
.security-icon { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; color: #06796e; background: #d9fbf5; font-weight: 900; }
.security-note small { color: var(--muted); line-height: 1.35; display: block; margin-top: 3px; }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 22px 0; padding: 10px; background: rgba(255,255,255,.7); border: 1px solid var(--border); border-radius: 18px; }
.step { border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 12px; font-size: .84rem; font-weight: 750; }
.step span { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #e6ebf2; font-size: .76rem; }
.step.is-active { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(10,79,214,.22); }
.step.is-active span { background: rgba(255,255,255,.2); }
.step.is-complete { color: var(--blue); }
.step.is-complete span { background: #dce9ff; color: var(--blue); }

#requestForm { background: #fff; border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.form-step { display: none; padding: 34px; min-height: 520px; }
.form-step.is-active { display: block; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid #edf0f5; }
.section-heading > div { display: flex; align-items: center; gap: 13px; }
.section-heading h3 { margin: 0; font-size: 1.35rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.section-number { width: 42px; height: 42px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 900; }

.field-grid { display: grid; gap: 19px; }
.field-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 7px; color: #42516a; font-size: .83rem; font-weight: 720; }
.field-label { display: block; min-height: 1.1rem; line-height: 1.1rem; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #ccd6e4; border-radius: 12px; padding: 12px 13px; background: #fbfcfe; color: #13213a; outline: none; transition: .16s ease; font-weight: 500; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #6f9df2; box-shadow: 0 0 0 4px rgba(10,79,214,.09); background: #fff; }
.field input.is-invalid, .field textarea.is-invalid, .field select.is-invalid { border-color: #df5a5a; box-shadow: 0 0 0 3px rgba(223,90,90,.08); }
.choice-field { border: 1px solid #ccd6e4; border-radius: 12px; padding: 10px 13px 12px; background: #fbfcfe; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 17px; }
.choice-field legend { width: 100%; padding: 0; margin-bottom: 2px; }
.choice-field label { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: #263650; }
.choice-field input, .check-row input { accent-color: var(--blue); }
.card-choice { padding: 16px 18px; }

.repeat-list { display: grid; gap: 12px; margin-bottom: 14px; }
.analysis-row { display: grid; grid-template-columns: 46px 1fr 1.3fr 44px; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #f9fbfe; }
.row-number { width: 36px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 900; }
.remove-analysis { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #fff0f0; color: #b93030; font-size: 1.25rem; }

.button { border: 0; border-radius: 12px; min-height: 45px; padding: 0 20px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: white; box-shadow: 0 9px 20px rgba(10,79,214,.22); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { background: #edf2f8; color: #23344f; }
.button.ghost { background: #fff; color: var(--blue); border: 1px solid #bcd0ef; }
.button.small { min-height: 38px; padding: 0 14px; font-size: .82rem; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

.notice { border-radius: 13px; padding: 14px 16px; margin: 0 0 20px; line-height: 1.45; font-size: .88rem; }
.notice.warning { background: #fff7da; color: #6c5210; border: 1px solid #f4d96c; }
.notice.info { background: #edf6ff; color: #234c7d; border: 1px solid #cbdff6; }
.urgency-box { margin-top: 25px; border: 1px solid #ffd64f; border-radius: 16px; background: #fffbea; padding: 18px; }
.switch-row { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.switch-row > input { position: absolute; opacity: 0; }
.switch { width: 52px; height: 29px; border-radius: 999px; background: #c8cfda; position: relative; flex: 0 0 auto; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 23px; height: 23px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch-row > input:checked + .switch { background: #f1b900; }
.switch-row > input:checked + .switch::after { transform: translateX(23px); }
.switch-row small, .pickup-toggle small, .signature-head small { display: block; color: var(--muted); margin-top: 3px; font-weight: 500; line-height: 1.35; }

.pickup-toggle { display: flex; align-items: center; gap: 16px; border: 2px dashed #b9cce8; background: #f4f8ff; border-radius: 17px; padding: 21px; cursor: pointer; }
.pickup-toggle input { width: 20px; height: 20px; accent-color: var(--blue); }
.pickup-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 900; }
.pickup-fields { margin-top: 20px; padding: 23px; border: 1px solid var(--border); border-radius: 17px; background: #fbfcfe; }
.inline-action { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.legal-box { display: grid; gap: 12px; border: 1px solid var(--border); border-radius: 16px; padding: 20px; background: #fafbfd; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: #34435c; line-height: 1.45; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.consent-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; margin-top: 18px; }
.signature-card { margin-top: 20px; border: 1px solid #cbd7e7; border-radius: 17px; overflow: hidden; background: white; }
.signature-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e5eaf1; background: #f7f9fc; }
#signatureCanvas { width: 100%; height: 220px; display: block; touch-action: none; cursor: crosshair; background-image: linear-gradient(to bottom, transparent 82%, #cbd4e0 82%, #cbd4e0 83%, transparent 83%); }
.turnstile-container { margin-top: 18px; display: flex; justify-content: center; }

.form-actions { display: flex; gap: 12px; padding: 20px 34px; border-top: 1px solid var(--border); background: #f8fafc; }
.action-spacer { flex: 1; }

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(7,22,48,.63); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.status-modal, .success-modal { width: min(470px, 100%); background: white; border-radius: 22px; padding: 34px; text-align: center; box-shadow: 0 25px 80px rgba(0,0,0,.25); }
.spinner { width: 50px; height: 50px; margin: 0 auto 20px; border: 5px solid #dfe8f7; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-modal h3, .success-modal h3 { margin: 0 0 8px; font-size: 1.45rem; }
.status-modal p, .success-modal p { color: var(--muted); line-height: 1.5; }
.success-check { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px; display: grid; place-items: center; background: #d9faf0; color: #057a5d; font-size: 2rem; font-weight: 900; }
.request-code { font: 900 1.3rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .07em; color: var(--blue); background: var(--blue-soft); border-radius: 12px; padding: 13px; margin: 10px 0; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.site-footer { text-align: center; padding: 25px 20px 42px; color: #6a778c; font-size: .82rem; line-height: 1.6; }

.error-banner { background: #fff0f0; color: #852d2d; border: 1px solid #edb5b5; border-radius: 12px; padding: 13px 15px; margin-bottom: 18px; font-size: .88rem; }

@media (max-width: 860px) {
  .cert-logo { display: none; }
  .intro-card { align-items: flex-start; flex-direction: column; }
  .security-note { min-width: 0; width: 100%; }
  .stepper { grid-template-columns: repeat(5, 1fr); overflow-x: auto; }
  .step { min-width: 52px; font-size: 0; }
  .step span { font-size: .76rem; }
  .field-grid.cols-3, .field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .analysis-row { grid-template-columns: 40px 1fr 42px; }
  .analysis-row .analysis-notes { grid-column: 2 / 3; }
}

@media (max-width: 620px) {
  .header-inner, .page-shell { width: min(100% - 20px, 1180px); }
  .header-inner { min-height: 72px; }
  .brand-logo { width: 115px; }
  .brand-kicker { display: none; }
  h1 { font-size: 1rem; }
  .page-shell { margin-top: 16px; }
  .intro-card { padding: 23px 20px; border-radius: 18px; }
  .intro-card h2 { font-size: 1.45rem; }
  .stepper { margin: 14px 0; padding: 7px; }
  #requestForm { border-radius: 18px; }
  .form-step { padding: 22px 17px; min-height: 0; }
  .section-heading { flex-direction: column; gap: 8px; margin-bottom: 22px; }
  .section-heading p { margin-left: 55px; }
  .field-grid.cols-3, .field-grid.cols-2 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .analysis-row { grid-template-columns: 36px 1fr 38px; padding: 11px; }
  .consent-grid { grid-template-columns: 1fr; }
  .form-actions { padding: 15px 17px; position: sticky; bottom: 0; z-index: 10; }
  .form-actions .button { flex: 1; padding: 0 12px; }
  #signatureCanvas { height: 180px; }
  .pickup-fields { padding: 16px; }
}

/* Catalogo analisi sincronizzato con il gestionale */
.catalog-product-notice {
  margin: 17px 0;
  padding: 16px 18px;
  border: 1px dashed #aebed3;
  border-radius: 14px;
  background: #f8fafc;
  color: #52627a;
  font-size: .9rem;
}
.catalog-browser { margin: 18px 0 22px; }
.catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}
.catalog-search { flex: 1 1 360px; margin: 0; }
.catalog-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #f2f5f9;
}
.catalog-tab {
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: #4e5f79;
  font-size: .82rem;
  font-weight: 760;
  cursor: pointer;
  white-space: nowrap;
}
.catalog-tab span {
  display: inline-flex;
  min-width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  border-radius: 999px;
  background: #dde5f0;
  color: #34445e;
  font-size: .7rem;
}
.catalog-tab.is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(19, 45, 82, .10);
}
.catalog-tab.is-active span { background: #e7efff; color: var(--blue); }
.catalog-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow-y: auto;
  padding: 2px 5px 5px 2px;
  scrollbar-gutter: stable;
}
.catalog-option {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 68px;
  padding: 12px 13px;
  border: 1px solid #d5dfeb;
  border-radius: 13px;
  background: #fbfcfe;
  cursor: pointer;
  transition: .15s ease;
}
.catalog-option:hover { border-color: #9eb7dc; background: #fff; transform: translateY(-1px); }
.catalog-option.is-selected { border-color: #75a0ed; background: #f1f6ff; box-shadow: 0 0 0 2px rgba(10,79,214,.07); }
.catalog-option input { margin: 3px 0 0; accent-color: var(--blue); width: 17px; height: 17px; }
.catalog-option-main { min-width: 0; }
.catalog-option-title { display: block; color: #15243b; font-size: .88rem; font-weight: 760; line-height: 1.27; }
.catalog-option-meta { display: block; margin-top: 5px; color: #65748a; font-size: .73rem; line-height: 1.32; }
.catalog-option-type {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8eef7;
  color: #465a76;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.catalog-no-results {
  padding: 27px;
  border: 1px dashed #c4cfdd;
  border-radius: 13px;
  color: #66758a;
  text-align: center;
  background: #fafbfd;
}
.selected-analysis-card {
  margin-top: 19px;
  border: 1px solid #cfdbea;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.selected-analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
  border-bottom: 1px solid #dce4ee;
  background: #f6f9fd;
}
.selected-analysis-head strong { display: block; color: #17263e; font-size: .91rem; }
.selected-analysis-head small { display: block; margin-top: 3px; color: #69778c; font-size: .72rem; font-weight: 500; }
.selected-count {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}
.selected-analysis-list { display: grid; gap: 0; }
.selected-analysis-empty { padding: 20px 16px; color: #78869a; text-align: center; font-size: .84rem; }
.selected-analysis-row {
  display: grid;
  grid-template-columns: 30px 94px minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
  padding: 11px 13px;
  border-top: 1px solid #e5ebf2;
}
.selected-analysis-row:first-child { border-top: 0; }
.selected-analysis-number { color: #75839a; font-size: .74rem; font-weight: 800; text-align: center; }
.selected-analysis-kind {
  display: inline-flex;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f8;
  color: #4f617c;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
}
.selected-analysis-name { min-width: 0; color: #1c2d47; font-size: .84rem; font-weight: 720; }
.selected-analysis-name small { display: block; margin-top: 3px; color: #718096; font-size: .7rem; font-weight: 500; }
.selected-analysis-remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: #fff0f0;
  color: #b53d3d;
  font-size: 1.1rem;
  cursor: pointer;
}
.analysis-general-notes { margin-top: 18px; }

@media (max-width: 840px) {
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-search { flex-basis: auto; width: 100%; }
  .catalog-tabs { width: 100%; }
  .catalog-tab { flex: 1; }
  .catalog-options { grid-template-columns: 1fr; max-height: 470px; }
}
@media (max-width: 560px) {
  .selected-analysis-row { grid-template-columns: 27px minmax(0, 1fr) 36px; }
  .selected-analysis-kind { grid-column: 2; justify-self: start; margin-top: -2px; }
  .selected-analysis-name { grid-column: 2; }
  .selected-analysis-remove { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 680px) {
  .catalog-options { grid-template-columns: 1fr; max-height: none; }
  .catalog-toolbar { align-items: stretch; }
  .catalog-tabs { width: 100%; }
  .catalog-tab { flex: 1; }
  .selected-analysis-row { grid-template-columns: 28px minmax(0, 1fr) 36px; }
  .selected-analysis-kind { display: none; }
}

/* Prezzi catalogo online e riepilogo modificabile */
.catalog-option-price {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f6ed;
  color: #087a52;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}
.selected-analysis-row {
  grid-template-columns: 30px 94px minmax(0, 1fr) 138px 38px;
}
.selected-analysis-price {
  display: grid;
  gap: 4px;
}
.selected-analysis-price label {
  color: #69778c;
  font-size: .64rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.selected-analysis-price-control {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #cbd7e6;
  border-radius: 10px;
  background: #fff;
}
.selected-analysis-price-control span {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #dce4ee;
  background: #f4f7fb;
  color: #526177;
  font-size: .78rem;
  font-weight: 850;
}
.selected-analysis-price-input {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 0;
  padding: 0 8px;
  background: #fff;
  color: #17263e;
  font-size: .82rem;
  font-weight: 750;
  text-align: right;
  outline: none;
}
.selected-analysis-price-control:focus-within {
  border-color: #6f9ce8;
  box-shadow: 0 0 0 3px rgba(10,79,214,.10);
}
.selected-analysis-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-top: 1px solid #dce4ee;
  background: #f6f9fd;
}
.selected-analysis-total span {
  display: block;
  color: #263a58;
  font-size: .8rem;
  font-weight: 850;
}
.selected-analysis-total small {
  display: block;
  margin-top: 2px;
  color: #718096;
  font-size: .68rem;
}
.selected-analysis-total strong {
  color: #0a4fd6;
  font-size: 1.05rem;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .selected-analysis-row {
    grid-template-columns: 28px minmax(0, 1fr) 120px 36px;
  }
  .selected-analysis-kind {
    display: none;
  }
  .selected-analysis-price {
    grid-column: 3;
  }
  .selected-analysis-remove {
    grid-column: 4;
  }
}

@media (max-width: 560px) {
  .selected-analysis-row {
    grid-template-columns: 27px minmax(0, 1fr) 36px;
    align-items: start;
  }
  .selected-analysis-name {
    grid-column: 2;
  }
  .selected-analysis-price {
    grid-column: 2;
    width: min(180px, 100%);
    margin-top: 3px;
  }
  .selected-analysis-remove {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
  .selected-analysis-total {
    align-items: flex-start;
  }
}

/* Voce economica separata per l'urgenza H24 */
.selected-analysis-urgency {
  border-top: 1px solid #f2c66d;
  background: linear-gradient(90deg, #fff9e8 0%, #fffdf7 100%);
}
.selected-analysis-urgency[hidden] {
  display: none !important;
}
.selected-analysis-urgency .selected-analysis-number {
  font-size: .92rem;
}
.selected-analysis-urgency .selected-analysis-kind {
  background: #fff0bd;
  color: #8a5a00;
}
.selected-analysis-urgency-lock {
  display: inline-flex;
  width: 34px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #fff0bd;
  color: #8a5a00;
  font-size: .62rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .selected-analysis-urgency-lock {
    grid-column: 4;
  }
}

@media (max-width: 560px) {
  .selected-analysis-urgency-lock {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
}

/* Prezzo ritiro importato dal catalogo e modificabile */
.pickup-price-field small {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 500;
  line-height: 1.35;
}
.pickup-price-control {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #b9d7c6;
  border-radius: 12px;
  background: #fff;
}
.pickup-price-control > span {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d7e8de;
  background: #edf8f1;
  color: #12643f;
  font-weight: 900;
}
.pickup-price-control input {
  height: 44px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  text-align: right;
  font-weight: 800;
}
.pickup-price-control:focus-within {
  border-color: #53a978;
  box-shadow: 0 0 0 4px rgba(34, 139, 83, .09);
}

/* Pulsanti informativi e popup legale/privacy */
.legal-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8edf3;
}
.legal-check-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.legal-info-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #9eb9e5;
  border-radius: 50%;
  background: #eef5ff;
  color: #0a4fd6;
  font-family: Georgia, serif;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: .15s ease;
}
.legal-info-button:hover,
.legal-info-button:focus-visible {
  border-color: #0a4fd6;
  background: #0a4fd6;
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 79, 214, .12);
}
.legal-info-button.compact {
  width: 28px;
  height: 28px;
  font-size: .82rem;
}
.card-choice legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-choice legend > span {
  min-width: 0;
}
.legal-info-overlay {
  z-index: 140;
}
.legal-info-modal {
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .3);
}
.legal-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 25px 18px;
  border-bottom: 1px solid #e4eaf2;
  background: linear-gradient(135deg, #fff, #edf5ff);
}
.legal-info-head h3 {
  margin: 5px 0 0;
  color: #17263e;
  font-size: 1.35rem;
}
.legal-info-close {
  width: 38px;
  height: 38px;
  border: 1px solid #cbd7e6;
  border-radius: 11px;
  background: #fff;
  color: #526177;
  font-size: 1.45rem;
  line-height: 1;
}
.legal-info-content {
  overflow-y: auto;
  padding: 22px 25px;
  color: #34435c;
  font-size: .91rem;
  line-height: 1.62;
}
.legal-info-content h4 {
  margin: 19px 0 7px;
  color: #183b73;
  font-size: .98rem;
}
.legal-info-content h4:first-child {
  margin-top: 0;
}
.legal-info-content p {
  margin: 0 0 12px;
}
.legal-info-content ol,
.legal-info-content ul {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.legal-info-content li {
  margin-bottom: 5px;
}
.legal-info-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #cbdff6;
  border-radius: 12px;
  background: #edf6ff;
  color: #234c7d;
}
.legal-info-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 25px 20px;
  border-top: 1px solid #e4eaf2;
  background: #f8fafc;
}

@media (max-width: 620px) {
  .legal-check-row {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 8px;
  }
  .legal-info-modal {
    max-height: 92vh;
    border-radius: 18px;
  }
  .legal-info-head,
  .legal-info-content,
  .legal-info-actions {
    padding-left: 17px;
    padding-right: 17px;
  }
}


/* V5 mobile: compilazione più leggibile e comoda da smartphone */
.field-help {
  display: inline;
  margin-left: .3rem;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 550;
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 76px;
  }

  body {
    overflow-x: hidden;
    background: #f3f6fb;
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    width: calc(100% - 20px);
    min-height: 64px;
    gap: 10px;
  }

  .brand-group {
    min-width: 0;
    gap: 10px;
  }

  .brand-logo {
    width: 102px;
    flex: 0 0 auto;
  }

  .brand-group > div {
    min-width: 0;
  }

  .brand-group h1 {
    overflow: hidden;
    font-size: .96rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-shell {
    width: calc(100% - 12px);
    margin: 10px auto 34px;
  }

  .intro-card {
    gap: 14px;
    padding: 18px 15px;
    border-radius: 17px;
  }

  .intro-card h2 {
    margin-top: 4px;
    font-size: 1.28rem;
    line-height: 1.16;
  }

  .intro-card p {
    font-size: .83rem;
    line-height: 1.45;
  }

  .security-note {
    gap: 10px;
    padding: 12px;
    border-radius: 13px;
    font-size: .82rem;
  }

  .security-icon {
    width: 31px;
    height: 31px;
  }

  .stepper {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    padding: 6px;
    overflow-x: auto;
    border-radius: 14px;
    scrollbar-width: none;
  }

  .stepper::-webkit-scrollbar {
    display: none;
  }

  .step {
    flex: 1 0 44px;
    min-width: 44px;
    min-height: 42px;
    padding: 0;
    scroll-snap-align: center;
  }

  .step span {
    width: 27px;
    height: 27px;
  }

  #requestForm {
    border-radius: 17px;
  }

  .form-step {
    padding: 18px 13px;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .section-heading > div {
    align-items: flex-start;
    gap: 10px;
  }

  .section-heading h3 {
    padding-top: 5px;
    font-size: 1.06rem;
    line-height: 1.2;
  }

  .section-number {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 11px;
    font-size: .82rem;
  }

  .section-heading p {
    margin: 0 0 0 46px;
    font-size: .78rem;
    line-height: 1.35;
  }

  .field-grid,
  .field-grid.cols-2,
  .field-grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .field.span-2 {
    grid-column: auto;
  }

  .field {
    min-width: 0;
    gap: 6px;
    font-size: .79rem;
  }

  .field-label {
    min-height: 1.05rem;
    line-height: 1.05rem;
  }

  .field input,
  .field textarea,
  .field select,
  .selected-analysis-price-input {
    min-width: 0;
    font-size: 16px;
  }

  .field input,
  .field textarea,
  .field select {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 11px;
  }

  .field textarea {
    min-height: 96px;
  }

  .notice {
    padding: 12px 13px;
    font-size: .8rem;
  }

  .catalog-product-notice {
    padding: 13px;
    font-size: .81rem;
  }

  .catalog-toolbar {
    gap: 12px;
  }

  .catalog-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    padding: 4px;
  }

  .catalog-tab {
    min-width: 0;
    padding: 9px 6px;
    font-size: .73rem;
    white-space: normal;
  }

  .catalog-options {
    max-height: none;
    padding-right: 0;
  }

  .catalog-option {
    min-height: 0;
    padding: 12px;
  }

  .selected-analysis-card {
    border-radius: 14px;
  }

  .selected-analysis-head {
    align-items: flex-start;
    padding: 13px;
  }

  .selected-analysis-head small {
    padding-right: 4px;
    line-height: 1.35;
  }

  .selected-count {
    min-width: 30px;
    height: 30px;
  }

  .selected-analysis-row {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px 10px;
    align-items: start;
    padding: 13px;
  }

  .selected-analysis-number {
    display: none;
  }

  .selected-analysis-kind {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: max-content;
    max-width: 100%;
    justify-self: start;
  }

  .selected-analysis-name {
    grid-column: 1;
    grid-row: 2;
    font-size: .88rem;
    overflow-wrap: anywhere;
  }

  .selected-analysis-price {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    margin-top: 3px;
  }

  .selected-analysis-price-control {
    grid-template-columns: 36px minmax(0, 1fr);
    border-radius: 11px;
  }

  .selected-analysis-price-control span,
  .selected-analysis-price-input {
    height: 42px;
  }

  .selected-analysis-remove,
  .selected-analysis-urgency-lock {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    justify-self: end;
    width: 38px;
    height: 38px;
  }

  .selected-analysis-total {
    gap: 10px;
    padding: 13px;
  }

  .selected-analysis-total strong {
    font-size: 1rem;
  }

  .urgency-box {
    margin-top: 18px;
    padding: 14px;
  }

  .switch-row {
    align-items: flex-start;
  }

  .switch-row > span:last-child {
    min-width: 0;
    font-size: .84rem;
  }

  .pickup-toggle {
    display: grid;
    grid-template-columns: 22px 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 15px 13px;
    border-radius: 14px;
  }

  .pickup-toggle input {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .pickup-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .pickup-toggle > span:last-child {
    min-width: 0;
    font-size: .84rem;
  }

  .pickup-fields {
    margin-top: 14px;
    padding: 13px;
    border-radius: 14px;
  }

  .inline-action {
    margin-bottom: 13px;
  }

  .inline-action .button {
    width: 100%;
  }

  .legal-box {
    gap: 13px;
    padding: 14px;
    border-radius: 14px;
  }

  .legal-check-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 9px;
  }

  .check-row {
    font-size: .81rem;
    line-height: 1.4;
  }

  .check-row input {
    width: 20px;
    height: 20px;
  }

  .consent-grid {
    gap: 12px;
  }

  .card-choice {
    padding: 14px;
  }

  .card-choice legend {
    align-items: flex-start;
    font-size: .8rem;
    line-height: 1.3;
  }

  .choice-field label {
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    background: #fff;
  }

  .choice-field label input {
    width: 19px;
    height: 19px;
  }

  .signature-card {
    border-radius: 14px;
  }

  .signature-head {
    display: grid;
    gap: 11px;
    padding: 13px;
  }

  .signature-head .button {
    width: 100%;
  }

  #signatureCanvas {
    height: 155px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 9px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(24, 43, 77, .10);
  }

  .action-spacer {
    display: none;
  }

  .form-actions .button {
    width: 100%;
    min-height: 48px;
    padding: 0 10px;
    font-size: .82rem;
  }

  #prevButton:not([hidden]) {
    grid-column: 1;
  }

  #prevButton[hidden] + .action-spacer + #nextButton:not([hidden]) {
    grid-column: 1 / -1;
  }

  #prevButton:not([hidden]) ~ #nextButton:not([hidden]),
  #prevButton:not([hidden]) ~ #submitButton:not([hidden]) {
    grid-column: 2;
  }

  .overlay {
    align-items: end;
    padding: 8px;
  }

  .status-modal,
  .success-modal {
    width: 100%;
    max-height: 94dvh;
    overflow-y: auto;
    padding: 23px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 12px 12px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .button {
    width: 100%;
    min-height: 48px;
  }

  .legal-info-modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 12px 12px;
  }

  .legal-info-head {
    gap: 10px;
    padding-top: 17px;
    padding-bottom: 14px;
  }

  .legal-info-head h3 {
    font-size: 1.08rem;
    line-height: 1.25;
  }

  .legal-info-close {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  .legal-info-content {
    font-size: .84rem;
    line-height: 1.52;
  }

  .legal-info-actions {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .legal-info-actions .button {
    width: 100%;
  }

  .site-footer {
    padding: 18px 14px 28px;
    font-size: .72rem;
  }
}

@media (max-width: 380px) {
  .page-shell {
    width: calc(100% - 8px);
  }

  .form-step {
    padding-left: 10px;
    padding-right: 10px;
  }

  .selected-analysis-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-analysis-total strong {
    align-self: flex-end;
  }
}
