/* ===========================================================================
   Artego Energia — stile on-brand.
   Palette: verde petrolio #0D4D4F, avorio/sabbia, inchiostro #2B2B2B.
   Font: Manrope (titoli) + Inter (testi). Niente nero di sfondo. Testi giustificati.
   =========================================================================== */
:root {
  --petrolio: #0D4D4F;
  --petrolio-dark: #093637;
  --ink: #2B2B2B;
  --sand: #F6F3EC;
  --sand-2: #EFE9DC;
  --line: #E3DECF;
  --amber: #E0A800;
  --amber-ink: #6b5200;
  --white: #FFFFFF;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Inter', system-ui, sans-serif; color: var(--ink);
  background: var(--sand); line-height: 1.55;
}
h1, h2, h3 { font-family: 'Manrope', system-ui, sans-serif; color: var(--petrolio); margin: 0 0 .4em; }
p { text-align: justify; hyphens: auto; }
a { color: var(--petrolio); }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--petrolio); color: #fff; padding: 12px 22px; flex-wrap: wrap; gap: 10px;
}
.brand { font-family: 'Manrope'; font-weight: 800; font-size: 21px; letter-spacing: .3px; }
.brand span { font-weight: 600; opacity: .9; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.navlink { color: #dfeeee; text-decoration: none; font-weight: 600; font-size: 14px; padding: 4px 2px; border-bottom: 2px solid transparent; }
.navlink.active, .navlink:hover { color: #fff; border-bottom-color: var(--amber); }
.plan-badge {
  background: rgba(255,255,255,.16); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px;
}

/* Banner trial "Prova: N giorni rimasti" */
.trial-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: #FFF8E8; color: var(--amber-ink); border-bottom: 1px solid #EAD9A6;
  padding: 8px 18px; font-size: 14px; font-weight: 600;
}
.trial-banner.urgent { background: #FCEFE6; color: #8a3d1f; border-bottom-color: #E8C3A8; }

/* Buttons */
.btn { font-family: 'Manrope'; font-weight: 700; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--petrolio); color: #fff; }
.btn-primary:hover { background: var(--petrolio-dark); }
.btn-amber { background: var(--amber); color: var(--amber-ink); }
.btn-ghost { background: transparent; color: var(--petrolio); border: 1px solid var(--line); }
.btn-outline { background: #fff; color: var(--petrolio); border: 1.5px solid var(--petrolio); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }

.container { max-width: 1000px; margin: 0 auto; padding: 26px 20px 60px; }
.view { animation: fade .25s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Hero */
.hero { background: linear-gradient(135deg, #fff, var(--sand-2)); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; margin-bottom: 22px; }
.hero h1 { font-size: 28px; max-width: 640px; }
.hero p { max-width: 660px; color: #4a4a44; }
.hero-cta { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.prelim-note { margin-top: 14px; background: #FFF6E5; color: #8a6d1f; border: 1px solid #E8D9A8; border-radius: 10px; padding: 10px 14px; font-size: 13px; text-align: left; }

.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.info-card h3 { font-size: 16px; }
.info-card p { font-size: 13px; color: #555; }

.bundle-box { margin-top: 22px; background: #FFF8E8; border: 1px solid #EAD9A6; border-radius: 12px; padding: 18px 20px; }
.bundle-box h3 { color: var(--amber-ink); }

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; background: #fff; padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.form-grid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #444; gap: 5px; }
.form-grid label.check-inline { flex-direction: row; align-items: center; gap: 8px; }
.form-grid input, .form-grid select {
  font-family: 'Inter'; font-size: 14px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.form-grid label.check-inline input { width: auto; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--petrolio); border-color: var(--petrolio); }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.hint { font-size: 12px; color: #777; text-align: left; }

/* Risultati */
.result-head { display: flex; justify-content: space-between; align-items: center; }
.cards-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.metric .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #8a8a80; }
.metric .v { font-family: 'Manrope'; font-weight: 800; font-size: 26px; color: var(--petrolio); margin: 4px 0; }
.metric .u { font-size: 12px; color: #555; }
.classbadge { display:inline-block; font-family:'Manrope'; font-weight:800; color:#fff; background:var(--petrolio); border-radius:8px; padding:2px 12px; }

.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
@media (max-width: 640px) { .result-cols { grid-template-columns: 1fr; } }

.bar { margin: 10px 0; }
.bar .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.bar .lbl small { color: #777; font-weight: 400; }
.bar .track { height: 14px; background: var(--sand-2); border-radius: 8px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 8px; background: var(--petrolio); }
.bar .meta { font-size: 11px; color: #777; margin-top: 3px; }

table.detail { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.detail td { padding: 8px 12px; border-bottom: 1px solid var(--sand-2); }
table.detail td:last-child { text-align: right; font-weight: 600; }

.incentive-note { margin-top: 18px; font-size: 12px; color: #6a6a62; background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; }
.badge-verify { background: #FFF6E5; color: #8a6d1f; border: 1px solid #E8D9A8; font-size: 10px; padding: 1px 6px; border-radius: 5px; }

.result-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.result-actions input { flex: 1 1 240px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.msg { font-size: 13px; margin-top: 8px; }
.msg.ok { color: #1d6b3a; }
.msg.err { color: #a33; }

/* Lista */
.quotes-list { display: grid; gap: 12px; }
.quote-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.quote-item .qt { font-family: 'Manrope'; font-weight: 700; color: var(--petrolio); }
.quote-item .qmeta { font-size: 12px; color: #777; }
.quote-item .qactions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(13,77,79,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; padding: 26px; max-width: 460px; width: 100%; position: relative; }
.modal-x { position: absolute; top: 12px; right: 16px; background: none; border: 0; font-size: 24px; cursor: pointer; color: #999; }
.plan-row { display: flex; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.plan-opt { flex: 1 1 130px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.plan-opt.sel { border-color: var(--petrolio); background: var(--sand); }
.plan-opt b { display: block; font-family: 'Manrope'; color: var(--petrolio); }
.plan-opt .price { font-size: 22px; font-weight: 800; font-family: 'Manrope'; }
.cycle-toggle { display: flex; gap: 8px; margin: 10px 0; }
.cycle-toggle button { flex: 1; }

/* ===========================================================================
   APPROFONDIMENTO — campi opzionali nel form + nuovi output nel risultato.
   Stessa palette/brand del resto dell'app.
   =========================================================================== */

/* Gruppi opzionali del form (Edificio/Involucro/Impianti/ACS) */
.deep-group { grid-column: 1 / -1; background: var(--sand-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.deep-group > summary { cursor: pointer; font-family: 'Manrope'; font-weight: 700; color: var(--petrolio); padding: 10px 4px; list-style: none; }
.deep-group > summary::-webkit-details-marker { display: none; }
.deep-group > summary::before { content: '▸ '; color: var(--amber-ink); }
.deep-group[open] > summary::before { content: '▾ '; }
.deep-group > summary small { font-weight: 500; color: #8a8a80; }
.deep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding: 6px 0 14px; }
.deep-grid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #444; gap: 5px; }
.deep-grid label.check-inline { flex-direction: row; align-items: center; gap: 8px; }
.deep-grid input, .deep-grid select {
  font-family: 'Inter'; font-size: 14px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.deep-grid label.check-inline input { width: auto; }
.fh { font-weight: 400; font-size: 11px; color: #8a8a80; }

/* Indicatore APE onesto */
.ape-box { margin: 16px 0; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 14px 16px; }
.ape-band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ape-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #8a8a80; }
.ape-value { font-family: 'Manrope'; font-weight: 800; font-size: 22px; color: var(--petrolio); }
.ape-text { font-size: 12px; color: #6a6a62; margin: 8px 0 0; }

/* Energy Score multi-asse */
.axes-box { margin: 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.axes-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.axes-head h3 { margin: 0; }
.axes-overall { display: flex; align-items: center; gap: 10px; }
.axes-num { font-family: 'Manrope'; font-weight: 800; font-size: 22px; color: var(--petrolio); }
.axes-conf { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; }
.conf-alta { background: #E4F2E8; color: #1d6b3a; }
.conf-media { background: #FFF6E5; color: #8a6d1f; }
.conf-bassa { background: #FCEFE6; color: #8a3d1f; }
.axes-bars { margin: 12px 0; }
.axis { margin: 9px 0; }
.axis-lbl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.axis-lbl small { color: #777; }
.axis-track { height: 12px; background: var(--sand-2); border-radius: 7px; overflow: hidden; }
.axis-fill { height: 100%; border-radius: 7px; background: var(--petrolio); }
.axis-fill.na { background: repeating-linear-gradient(45deg, #e7e2d4, #e7e2d4 6px, #efe9dc 6px, #efe9dc 12px); }
.axis-na { font-size: 11px; color: #999; margin-top: 2px; }
.axes-top3, .axes-hints { font-size: 12px; color: #555; margin-top: 8px; }
.axes-top3 ol, .axes-hints ul { margin: 4px 0 0; padding-left: 20px; }

/* Matrice interventi (card) */
.matrix-title { margin: 24px 0 10px; }
.matrix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mcard { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--petrolio); border-radius: 12px; padding: 14px 16px; }
.mcard.conf-bassa { border-top-color: #c98a3d; }
.mcard.conf-media { border-top-color: var(--amber); }
.mcard.conf-alta { border-top-color: #2f8f55; }
.mcard-head { display: flex; flex-direction: column; }
.mcard-title { font-family: 'Manrope'; font-weight: 800; color: var(--petrolio); font-size: 15px; }
.mcard-sub { font-size: 11px; color: #8a8a80; text-transform: uppercase; letter-spacing: .4px; }
.mcard-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.mtag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--sand-2); color: #6a6a62; }
.mtag.conf { background: #FFF6E5; color: #8a6d1f; }
.mtag.tech { background: #E9EEF0; color: var(--petrolio); }
.mcard-reason { font-size: 12px; color: #555; margin: 6px 0; text-align: left; }
.mcard-num { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.mcard-num td { padding: 4px 0; border-bottom: 1px solid var(--sand-2); }
.mcard-num td:first-child { color: #8a8a80; }
.mcard-num td:last-child { text-align: right; }
.mcard-num small { color: #999; font-weight: 400; }
.mcard-foot { font-size: 11px; color: #6a6a62; margin-top: 8px; display: grid; gap: 4px; }
.mcard-inc { color: #8a6d1f; }
.mcard-src { color: #aaa; font-style: italic; }

/* Liste incentivi / ipotesi */
.inc-list { margin: 6px 0; padding-left: 18px; }
.inc-list li { margin-bottom: 8px; }
.assumptions-box { margin-top: 14px; background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 14px; }
.assumptions-box > summary { cursor: pointer; font-weight: 600; color: var(--petrolio); font-size: 13px; }
.assum-list { list-style: none; padding: 8px 0 4px; margin: 0; font-size: 12px; display: grid; gap: 5px; }
.assum-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-right: 6px; }
.assum-proxy .assum-tag { background: #FFF6E5; color: #8a6d1f; }
.assum-dichiarato .assum-tag { background: #E4F2E8; color: #1d6b3a; }

.footer { text-align: center; font-size: 12px; color: #7a7a72; padding: 18px; border-top: 1px solid var(--line); }

/* --- B1 02/12/2026: norme, comuni, diagnosi approfondita, simulazione --- */
.norme-bar { font-size: 13px; padding: 7px 16px; text-align: center; background: #E7F2EE; color: #0D4D4F; border-bottom: 1px solid #cfe3dc; }
.norme-bar.giallo { background: #FFF6E0; color: #7a5a10; }
.norme-bar.rosso { background: #FBE9E6; color: #9b2c1f; }
.norme-bar button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.comune-field small.ok { color: #0D4D4F; font-weight: 600; }
.comune-field small.warn { color: #7a5a10; }
.deep-section { margin-top: 22px; padding: 16px; border: 1px solid #E3DECF; border-radius: 12px; background: #FBFAF6; }
.env-row { display: grid; grid-template-columns: 1.1fr 1.6fr .8fr .8fr 1.2fr auto; gap: 8px; align-items: end; margin-bottom: 6px; }
.env-row label { font-size: 12px; }
.deep-sys { margin: 12px 0; }
.disp-bar { margin: 4px 0; font-size: 13px; }
.disp-bar .tr { background: #ECE7DA; border-radius: 4px; height: 12px; }
.disp-bar .fl { background: #0D4D4F; height: 12px; border-radius: 4px; }
.ulim td.over { color: #9b2c1f; font-weight: 600; }
.ulim td.ok { color: #0D4D4F; }
.sim-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; margin: 8px 0 12px; }
.sim-choices label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.ap-bars .row { margin: 6px 0; }
.ap-bars .tr { background: #ECE7DA; border-radius: 4px; height: 18px; }
.ap-bars .fl { height: 18px; border-radius: 4px; }
.ap-bars .ante { background: #B54A3A; }
.ap-bars .post { background: #0D4D4F; }
.tag-dv { display: inline-block; background: #FFF6E0; color: #7a5a10; border: 1px solid #E8D9A8; font-size: 11px; padding: 0 6px; border-radius: 5px; }
.tag-ok { display: inline-block; background: #E7F2EE; color: #0D4D4F; font-size: 11px; padding: 0 6px; border-radius: 5px; }
@media (max-width: 640px) { .env-row { grid-template-columns: 1fr 1fr; } }

/* wizard 03/12/2026 */
.wiz-box { border: 1px solid #E3DECF; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: #fff; }
.wiz-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wiz-steps span { border: 1px solid #cfe3dc; color: #0D4D4F; border-radius: 16px; padding: 3px 12px; font-size: 13px; }
.wiz-steps span.on { background: #0D4D4F; color: #fff; }
.tipo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.tipo { border: 1px solid #E3DECF; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tipo:has(input:checked) { border-color: #0D4D4F; background: #E7F2EE; }
.esempi { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
