/* Configuratore guidato: regole proprie (componenti comuni in strumenti.css). */

.cg [data-panel][hidden], .cg [hidden] { display: none !important; }

/* passi cliccabili */
.cg-steps { margin-bottom: 24px; }
.cg-steps .wizard-steps li { padding: 0; }
.cg-steps button {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px 6px 0;
  background: none; border: 0; border-radius: 0; color: inherit; font: inherit; font-weight: inherit;
  text-align: start; cursor: pointer;
}
.cg-steps button:hover { color: var(--text); }
.cg-steps button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.cg-steps li.is-current { color: var(--text); font-weight: 620; box-shadow: inset 0 3px 0 var(--accent); }
.cg-steps li.is-done { color: var(--text-secondary); }

/* salvataggio automatico */
.cg-saved {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  margin-bottom: 28px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
}
.cg-saved p { font-size: .9375rem; color: var(--text-secondary); max-width: 80ch; }
.cg-saved strong { color: var(--text); font-weight: 640; }

/* griglia: wizard a sinistra, riepilogo a destra */
.cg-main { grid-column: 1 / span 8; display: grid; gap: 24px; min-width: 0; }
.cg-aside { grid-column: 9 / span 4; min-width: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.cg-step5 { display: grid; gap: 24px; min-width: 0; }
.cg .panel-title:focus { outline: none; }
.cg .panel-title:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }

.cg-callout { padding: 14px 16px; background: var(--bg); border-inline-start: 3px solid var(--accent); color: var(--text); font-size: .9688rem; display: grid; gap: 8px; }
.cg .choice { align-content: start; }
.cg .choice strong { line-height: 1.3; }
.cg-goals { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.cg-list { grid-template-columns: minmax(0, 1fr); }
.cg-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* moduli del perimetro: casella visibile */
.cg-check { grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.cg-check input { position: static; opacity: 1; width: 20px; height: 20px; margin: 2px 0 0; grid-row: span 2; accent-color: var(--accent-ink); }
.cg-check strong, .cg-check small { grid-column: 2; }

/* proposta tecnica */
.cg-step5 .kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cg-step5 .kpi-value { font-size: clamp(1.2rem, 1.9vw, 1.6rem); }
.cg-headline { color: var(--accent-ink); font-weight: 640; font-size: 1.0625rem; margin-top: -8px; }
.cg-h3 { font-size: 1.0625rem; font-weight: 640; padding-top: 16px; border-top: 1px solid var(--border); }
.cg-callout .cg-h3 { border-top: 0; padding-top: 0; }
.cg-scope { display: grid; gap: 10px; margin-top: -6px; }
.cg-scope-item { position: relative; padding: 2px 0 2px 26px; display: grid; gap: 2px; }
.cg-scope-item::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 12px; height: 12px; border: 2px solid var(--border-hover); }
.cg-scope-item.is-in::before { background: var(--accent); border-color: var(--accent); }
.cg-scope-item p:first-child { font-size: .9688rem; }
.cg-scope-state { color: var(--text-tertiary); font-weight: 450; }
.cg-phases { display: grid; margin-top: -6px; }
.cg-phases li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9688rem; }
.cg-phases strong { font-weight: 640; font-variant-numeric: tabular-nums; }
.cg-callout .ticks li { font-size: .9375rem; }
.cg-inputs { display: grid; gap: 10px; counter-reset: cg; }
.cg-inputs li { counter-increment: cg; display: grid; gap: 4px; padding: 14px 16px 14px 52px; position: relative; background: var(--bg); border: 1px solid var(--border); }
.cg-inputs li::before { content: counter(cg); position: absolute; inset-inline-start: 16px; top: 13px; font-weight: 680; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.cg-inputs strong { font-weight: 620; }

/* riepilogo */
.cg-summary { display: grid; border-top: 2px solid var(--border-strong); }
.cg-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.cg-summary dt { color: var(--text-secondary); }
.cg-summary dd { text-align: end; font-weight: 620; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cg-actions { display: grid; gap: 10px; }
.cg-actions .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.cg-aside .tool-disclaimer { padding-top: 0; border-top: 0; }

.wizard-nav .btn[hidden] { display: none; }

@media (max-width: 1023px) {
  .cg-main, .cg-aside { grid-column: 1 / -1; }
  .cg-aside { position: static; }
}
@media (max-width: 767px) {
  .cg-steps .wizard-steps li { min-width: 50%; flex-basis: 50%; }
  .cg-inputs li { padding-inline-start: 44px; }
}
