/* Cooling Defender: one column for the phone, light and dark like the phone, the same build as Electric Heat Defender
   and the apps before it (cards, line icons, soft shadows) with a sky blue. Every text keeps a contrast of 4.5:1. */
:root {
  --bg: #f6f4f2;
  --superficie: #ffffff;
  --superficie-2: #faf8f6;
  --testo: #13212a;
  --testo-2: #3c4c56;
  --tenue: #586973;
  --bordo: #dde6ea;
  --bordo-forte: #c3d1d8;
  --marca: #0369a1;
  --marca-2: #0284c7;
  --marca-tenue: #e0f2fe;
  --su-marca: #ffffff;
  --verde: #15803d;
  --giallo: #b45309;
  --rosso: #b91c1c;
  --grigio: #5b6672;
  --errore-testo: #8c1d13;
  --errore-sfondo: #fdecea;
  --ombra-1: 0 1px 2px rgba(16, 35, 42, 0.06), 0 1px 1px rgba(16, 35, 42, 0.04);
  --ombra-2: 0 10px 28px rgba(16, 35, 42, 0.12);
  --raggio: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c151a;
    --superficie: #13212a;
    --superficie-2: #0f1b22;
    --testo: #eaf2f5;
    --testo-2: #c3d2d9;
    --tenue: #98abb5;
    --bordo: #22343e;
    --bordo-forte: #2f4652;
    --marca: #7dd3fc;
    --marca-2: #bae6fd;
    --marca-tenue: #0c2a3d;
    --su-marca: #04212f;
    --verde: #4ade80;
    --giallo: #fbbf24;
    --rosso: #f87171;
    --grigio: #a3acbd;
    --errore-testo: #f4b8b0;
    --errore-sfondo: #3a1b17;
    --ombra-1: none;
    --ombra-2: 0 10px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--testo);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sprite { display: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icona { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.testata {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--marca); color: var(--su-marca);
}
.marchio { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.lingua { display: flex; align-items: center; gap: 6px; }
.lingua select {
  background: transparent; color: inherit; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 10px;
  padding: 6px 8px; font: inherit; font-size: 15px;
}
@media (prefers-color-scheme: dark) { .lingua select { border-color: rgba(4, 32, 43, 0.45); } }
/* The open list follows the theme: dark text on light in light mode, light text on dark in dark mode. */
.lingua option { background: var(--superficie); color: var(--testo); }

main { max-width: 560px; margin: 0 auto; padding: 20px 16px max(32px, env(safe-area-inset-bottom)); }
.schermata { display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 0; }
h2 { font-size: 19px; line-height: 1.3; margin: 0; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 16px; line-height: 1.3; margin: 0; display: flex; align-items: center; gap: 8px; }
p { margin: 0; }
.lead { font-size: 17px; color: var(--testo-2); }
.aiuto { font-size: 14px; color: var(--tenue); display: flex; gap: 8px; align-items: flex-start; }
.aiuto .icona { width: 18px; height: 18px; margin-top: 1px; }

.card { background: var(--superficie); border: 1px solid var(--bordo); border-radius: var(--raggio); box-shadow: var(--ombra-1); padding: 16px; }
.consigli ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--testo-2); }

.bottone {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px;
  border-radius: 14px; border: 1px solid transparent; font: inherit; font-weight: 650; font-size: 17px; cursor: pointer;
  text-align: center; text-decoration: none;
}
.bottone.primario { background: var(--marca); color: var(--su-marca); box-shadow: var(--ombra-2); }
.bottone.primario:disabled { opacity: 0.45; box-shadow: none; cursor: default; }
.bottone.secondario { background: var(--marca-tenue); color: var(--marca); border-color: var(--bordo-forte); }
.bottone.testo { background: none; color: var(--marca); min-height: 44px; }
.bottone.piccolo { min-height: 44px; font-size: 15.5px; padding: 8px 14px; }
.indietro { align-self: flex-start; padding-left: 0; }
.aggiungi input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bottone:focus-visible, .lingua select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--marca-2); outline-offset: 2px;
}

/* The home screen: the country of the policy, the files, the story. */
.paese { display: grid; gap: 8px; }
.paese > span { font-weight: 600; }
.file { display: grid; gap: 10px; }
.pagine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pagine:empty { display: none; }
.pagine li { position: relative; background: var(--superficie-2); border: 1px solid var(--bordo); border-radius: 12px; overflow: hidden; }
.pagine img, .pagine .pdf { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.pagine .pdf { display: flex; align-items: center; justify-content: center; color: var(--marca); background: var(--marca-tenue); }
.pagine .pdf .icona { width: 40px; height: 40px; }
.pagine .etichetta { display: block; padding: 4px 8px; font-size: 13px; color: var(--tenue); }
.pagine button {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(16, 35, 42, 0.72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pagine button .icona { width: 18px; height: 18px; }

.nota { display: grid; gap: 6px; font-weight: 600; }
textarea, .campo input {
  width: 100%; border: 1px solid var(--bordo-forte); border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 400;
  background: var(--superficie); color: var(--testo);
}
textarea { resize: vertical; }
.errore { background: var(--errore-sfondo); color: var(--errore-testo); border-radius: 12px; padding: 10px 12px; }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--tenue); }
/* The Mexican consent line's link (part C): the text's own colour, underlined, readable in light and dark. */
.privacy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.rotella {
  width: 48px; height: 48px; margin: 24px auto 4px; border-radius: 50%;
  border: 4px solid var(--marca-tenue); border-top-color: var(--marca); animation: gira 1s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rotella { animation-duration: 3s; } }
#attesa h2 { justify-content: center; text-align: center; }
.passi-attesa { margin: 0 auto; padding-left: 22px; color: var(--tenue); display: grid; gap: 6px; }
.passi-attesa li.fatto { color: var(--testo); }
.passi-attesa li.fatto::marker { color: var(--verde); }

/* Questions: on their own screen when the result needs them, inside the result when they only add a reason. */
.elenco-domande { display: grid; gap: 18px; }
.domanda { display: grid; gap: 10px; }
.domanda .testo { font-weight: 650; font-size: 17px; }
.domanda .aiuto { display: block; }
.scelte { display: flex; flex-wrap: wrap; gap: 8px; }
.scelte button {
  flex: 1 1 30%; min-height: 48px; border-radius: 12px; border: 1px solid var(--bordo-forte); background: var(--superficie);
  color: var(--testo); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 10px;
}
.scelte button[aria-pressed="true"] { background: var(--marca); color: var(--su-marca); border-color: var(--marca); }

/* The result. */
.risultato-card { display: grid; gap: 14px; }
.verdetto { display: flex; gap: 10px; align-items: center; padding: 14px 14px; border-radius: 12px; color: #fff; font-size: 19px; font-weight: 700; line-height: 1.3; }
.verdetto .icona { width: 28px; height: 28px; }
.verdetto.in_linea { background: #15803d; }
.verdetto.un_po_alto { background: #b45309; }
.verdetto.troppo_alto { background: #b91c1c; }
.verdetto.dati_da_completare { background: #5b6672; }
.verdetto.fuori_ambito { background: #9f1239; }
.verdetto.non_e_un_caso { background: #5b6672; }
.importi { display: grid; gap: 4px; margin: 6px 0 2px; }
.importi p { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.importi .chiesto { color: var(--testo-2); }
.importi .offerto { color: var(--testo-2); }
.importi .da_chiarire { color: var(--giallo); font-weight: 700; }
.importi .interessi { color: var(--verde); font-weight: 700; }
.importo-grande { font-size: 22px; font-weight: 750; }
.consiglio { font-size: 16.5px; font-weight: 600; }
.voci { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.voci li { display: flex; gap: 10px; align-items: flex-start; }
.voci li > .icona { margin-top: 2px; }
.voci li.forte > .icona { color: var(--verde); }
.voci li.ostacolo > .icona { color: var(--rosso); }
.voci li.info > .icona { color: var(--grigio); }
.voci .titolo { font-weight: 650; }
.voci .dettaglio { font-size: 14.5px; color: var(--testo-2); }
.passi { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--testo-2); }
.passi li:first-child { color: var(--testo); font-weight: 600; }
.sezione { display: grid; gap: 8px; }
.sezione > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tenue); }
.opzionali { display: grid; gap: 14px; border-top: 1px solid var(--bordo); padding-top: 14px; }
.documenti { display: grid; gap: 8px; }
.documenti .quando { font-size: 13.5px; color: var(--tenue); margin-top: -4px; }
.avviso { font-size: 13.5px; color: var(--tenue); }

/* The letter: the form for the person's data, then the text and the PDF. */
.modulo { display: grid; gap: 14px; }
.campi { display: grid; gap: 12px; }
.campo { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.campo .aiuto { font-weight: 400; display: block; }
/* The text's language: the same colours as the other fields, so it reads in light and in dark. */
.campo select {
  width: 100%; font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--bordo-forte);
  background: var(--superficie); color: var(--testo);
}
.campo select:disabled { opacity: 1; background: var(--superficie-2); color: var(--tenue); }
.campo select option { background: var(--superficie); color: var(--testo); }
.letto { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 15px; }
.letto dt { color: var(--tenue, #546870); }
.letto dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.istruzioni { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 8px; color: var(--testo-2); }
.testo-documento {
  margin: 0; white-space: pre-wrap; word-break: break-word; font: 15px/1.5 "Times New Roman", Times, "Noto Serif", serif; background: var(--superficie);
  border: 1px solid var(--bordo); border-radius: 12px; padding: 14px; max-height: 60vh; overflow: auto;
}
.pronto { display: grid; gap: 14px; }

/* The country of the policy: a list, with a guess from the phone's language. */
.paese > span { display: flex; align-items: center; gap: 6px; }
.campo select:focus-visible { outline: 3px solid var(--marca-2); outline-offset: 2px; }

/* The home step, the free result, the report with its chart (from Panel Defender). */
.etichetta-campo { display: flex; align-items: center; gap: 6px; }
.campo input[type="month"], .campo input[type="number"] { min-height: 48px; }
.luogo { display: grid; gap: 12px; }
.cerca { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.cerca .bottone { min-height: 48px; }
.trovato { display: flex; gap: 8px; align-items: center; color: var(--verde); font-weight: 650; }
.domanda .testo { display: flex; align-items: center; gap: 8px; }
.scelte button { flex: 1 1 28%; }
.domanda.card { gap: 12px; }
.controllare { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--superficie-2); border: 1px solid var(--bordo); }
.controllare .titolo { font-weight: 700; }
.controllare .dettaglio { font-size: 14.5px; color: var(--testo-2); }
.controllare.si > .icona { color: var(--giallo); }
.controllare.no > .icona { color: var(--verde); }
.offerta { display: grid; gap: 10px; border-top: 1px solid var(--bordo); padding-top: 14px; }
.offerta ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--testo-2); }
.piede { max-width: 560px; margin: 0 auto; padding: 0 16px max(24px, env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--tenue); }

.rapporto { display: grid; gap: 14px; }
.titolo-rapporto { font-size: 24px; }
.sezione-rapporto { display: grid; gap: 10px; }
.sezione-rapporto p { color: var(--testo-2); }
.grafico { width: 100%; height: auto; display: block; }
.grafico .griglia { stroke: var(--bordo); stroke-width: 1; }
.grafico .asse { fill: var(--tenue); font-size: 9px; }
.grafico .fascia { fill: var(--marca-tenue); stroke: var(--bordo-forte); stroke-width: 0.5; }
.grafico .vero { fill: var(--marca); }
.grafico .vero.fuori { fill: var(--rosso); }
.grafico .vero.estate { fill: var(--bordo-forte); }
.grafico .atteso { stroke: var(--testo); stroke-width: 1.6; }
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--tenue); }
.legenda .chiave { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legenda .chiave.vero { background: var(--marca); }
.legenda .chiave.fascia { background: var(--marca-tenue); border: 1px solid var(--bordo-forte); }
.legenda .chiave.atteso { height: 3px; border-radius: 0; background: var(--testo); }
.tabella { overflow-x: auto; }
.tabella table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tabella th, .tabella td { padding: 6px 6px; border-bottom: 1px solid var(--bordo); text-align: right; white-space: nowrap; }
.tabella th:first-child, .tabella td:first-child { text-align: left; }
.tabella th { color: var(--tenue); font-weight: 600; font-size: 12.5px; white-space: normal; }
.causa { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--superficie-2); border: 1px solid var(--bordo); }
.causa h3 { color: var(--testo); }
.causa .titolo-controlli { font-weight: 650; color: var(--testo); }
.causa ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--testo-2); }
.avvertenze { display: grid; gap: 10px; }
.avvertenze p { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.avvertenze .icona { color: var(--giallo); margin-top: 1px; }

@media print {
  .testata, .piede, .bottone, .prezzo, #casa, #schermate, #attesa, #domande, #risultato { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
/* The name stays on one line next to the language menu, also on a narrow phone. */
.marchio span { white-space: nowrap; }
.lingua select { max-width: 132px; }

/* The result's numbers under the verdict, the price of a kWh in the report (from Heat Pump Defender). */
.dettaglio-esito { color: var(--testo-2); }
.risultato-card .sezione .domanda .testo { font-size: 15.5px; }
.prezzo { display: grid; gap: 8px; border-top: 1px solid var(--bordo); padding-top: 12px; }
.prezzo .cerca input { min-height: 48px; }
/* Longer choices (the heating, the heaters, their controls, the house): two a row. */
.scelte.due button { flex: 1 1 40%; }
/* The report: one column that can shrink, so a wide table scrolls inside its box instead of widening the page. */
.rapporto, .sezione-rapporto { grid-template-columns: minmax(0, 1fr); }
/* What was read from the bills: label and value side by side, one under the other on a phone (the labels are long). */
.letto { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
@media (max-width: 520px) { .letto { grid-template-columns: minmax(0, 1fr); gap: 0 12px; } .letto dd { margin-bottom: 8px; } }

/* Safety first (a smell of burning, hot plugs or a tripping breaker), the optional details of the home. */
.sicurezza { display: grid; gap: 10px; border-color: var(--bordo-forte); }
.scelte button.allarme { border-color: var(--rosso); color: var(--rosso); }
/* The text takes the card's colour: white on the dark red of the light theme, dark on the light red of the dark one. */
.scelte button.allarme[aria-pressed="true"] { background: var(--rosso); border-color: var(--rosso); color: var(--superficie); }
.avviso-allarme, .allarme-card {
  background: var(--errore-sfondo); color: var(--errore-testo); border: 1px solid var(--rosso); border-radius: 12px;
  padding: 12px; font-weight: 600;
}
.allarme-card { display: flex; gap: 10px; align-items: flex-start; }
.allarme-card > .icona { color: var(--rosso); margin-top: 2px; }
.allarme-card .titolo { font-weight: 750; margin-bottom: 4px; }
.verdetto.emergenza { background: #b91c1c; }
.emergenza-card { display: grid; gap: 14px; }
.emergenza-card .passi li { color: var(--testo); font-weight: 600; }
.bottone.emergenza-numero { background: #b91c1c; color: #fff; font-size: 20px; box-shadow: var(--ombra-2); }
.dettagli { display: grid; gap: 14px; }
.dettagli summary { font-weight: 650; cursor: pointer; color: var(--marca); }
.dettagli[open] summary { margin-bottom: 4px; }
@media print { #emergenza { display: none !important; } }
/* The dark theme: the band up to the limit in the brand's deep blue, so it shows on the dark card. */
@media (prefers-color-scheme: dark) {
  .grafico .fascia { fill: #075985; }
  .legenda .chiave.fascia { background: #075985; }
}
/* Block 3: the list of checks on this phone, the code, the report to open (a code or the payment), the private link,
   the legal links (from Electric Heat Defender and Panel Defender). */
.piede .legale a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.avviso-info { background: var(--marca-tenue); color: var(--testo); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.storico { display: grid; gap: 8px; }
.storico ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.storico button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--bordo); background: var(--superficie); color: var(--testo); font: inherit; cursor: pointer;
}
.storico .testo { flex: 1; display: grid; gap: 2px; }
.storico .testo span { font-size: 14px; color: var(--tenue); }
.storico .v-in_linea > button > .icona:first-child { color: var(--verde); }
.storico .v-un_po_alto > button > .icona:first-child { color: var(--giallo); }
.storico .v-troppo_alto > button > .icona:first-child { color: var(--rosso); }
.sblocco { display: grid; gap: 12px; }
.testa-sblocco { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prezzo-rapporto { font-size: 20px; font-weight: 750; color: var(--marca); white-space: nowrap; }
.lead-sblocco { color: var(--testo-2); }
.elenco-rapporto { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--testo-2); }
.sblocco .errore:empty, .sblocco .stato:empty { display: none; }
.stato { color: var(--marca); font-weight: 600; }
.nota-pagamento { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--tenue); }
.nota-pagamento a { color: var(--marca); }
.sotto { font-size: 14.5px; color: var(--tenue); }
.modulo-codice { display: grid; gap: 6px; }
.modulo-codice label { font-weight: 600; font-size: 15px; }
.riga-codice { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.riga-codice input {
  width: 100%; border: 1px solid var(--bordo-forte); border-radius: 12px; padding: 10px 12px; font: inherit;
  background: var(--superficie); color: var(--testo); text-transform: uppercase; letter-spacing: 0.04em;
}
.link-privato { display: grid; gap: 10px; }
.link-privato p { color: var(--testo-2); font-size: 15px; }
.link-cancella {
  justify-self: start; display: flex; align-items: center; gap: 6px; background: none; border: none; padding: 6px 0;
  color: var(--rosso); font: inherit; font-size: 15px; cursor: pointer;
}
