/* ============================================================
   richiesta.microcredito.bruschi.com — foglio di stile
   Palette: verde fiducia + crema caldo + ambra
   ============================================================ */

:root {
  --verde: #1a6b54;
  --verde-scuro: #10473a;
  --verde-chiaro: #e4f0eb;
  --ambra: #e8a13d;
  --ambra-scuro: #b97a1e;
  --crema: #faf7f2;
  --bianco: #ffffff;
  --testo: #24312d;
  --testo-tenue: #5c6b65;
  --linea: #e3ddd2;
  --rosso: #b3452f;
  --raggio: 14px;
  --ombra: 0 10px 30px rgba(16, 71, 58, 0.10);
  --font-titoli: Georgia, "Times New Roman", serif;
  --font-testo: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* L'attributo [hidden] deve SEMPRE vincere: senza questa riga una regola
   come ".wizard { display:flex }" lo scavalca e l'elemento resta visibile
   anche quando il JavaScript lo imposta come nascosto (era il motivo per
   cui il modale non si chiudeva con la X né col link). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-testo);
  color: var(--testo);
  background: var(--crema);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-titoli); font-weight: 700; line-height: 1.2; color: var(--verde-scuro); }
h1 { font-size: clamp(1.3rem, 5.6vw, 3.2rem); }
/* tiene insieme "Dare forma alla tua idea," su una sola riga, invece di
   lasciarla spezzare in un punto casuale in base alla larghezza schermo */
.h1-riga-unita { white-space: nowrap; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .6em; }
h3 { font-size: 1.15rem; margin-bottom: .35em; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.container-stretto { max-width: 780px; }
.centrato { text-align: center; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-block;
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-testo);
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.btn:hover { background: var(--verde-scuro); transform: translateY(-1px); }
.btn-grande { padding: 17px 38px; font-size: 1.15rem; }
.btn-small { padding: 9px 20px; font-size: .95rem; }
.btn-chiaro { background: var(--ambra); color: var(--verde-scuro); }
.btn-chiaro:hover { background: #f0b356; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--verde); color: #fff;
  font-family: var(--font-titoli); font-size: 1.05rem; font-weight: 700;
}
.brand-name { font-weight: 700; font-size: 1.05rem; color: var(--verde-scuro); }
.brand-name em { font-style: normal; font-weight: 400; color: var(--testo-tenue); }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--testo); text-decoration: none; font-weight: 500; font-size: .98rem; }
.topnav a:hover { color: var(--verde); }

/* ---------- hero ---------- */
.hero { padding: 70px 0 80px; background: linear-gradient(180deg, var(--crema) 0%, #f3efe6 100%); }
.hero-inner { display: grid; grid-template-columns: 1.35fr .9fr; gap: 50px; align-items: center; }
.eyebrow {
  display: inline-block;
  background: var(--verde-chiaro); color: var(--verde-scuro);
  font-size: .85rem; font-weight: 600; letter-spacing: .02em;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-sub { font-size: 1.13rem; color: var(--testo); margin: 18px 0; max-width: 34em; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; }
.trust li { color: var(--testo-tenue); font-size: .95rem; }
.trust li::before { content: "✓ "; color: var(--verde); font-weight: 700; }

.hero-card {
  background: var(--bianco); border-radius: var(--raggio);
  box-shadow: var(--ombra); padding: 28px; border: 1px solid var(--linea);
}
.hc-riga { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px dashed var(--linea); }
.hc-riga:last-child { border-bottom: none; }
.hc-label { color: var(--testo-tenue); font-size: .95rem; }
.hc-val { font-family: var(--font-titoli); font-size: 1.15rem; font-weight: 700; color: var(--verde-scuro); }
.hc-no { color: var(--ambra-scuro); }
.hc-si { color: var(--verde); }

/* ---------- sezioni ---------- */
.sezione { padding: 72px 0; }
.sezione-alt { background: #f2ede4; }
.sezione-sub { max-width: 44em; color: var(--testo-tenue); font-size: 1.08rem; margin-bottom: 34px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--bianco); border: 1px solid var(--linea);
  border-radius: var(--raggio); padding: 26px 22px;
  box-shadow: 0 4px 14px rgba(16,71,58,.05);
}
.card-icona {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--verde-chiaro); color: var(--verde-scuro);
  font-size: 1.3rem; font-weight: 700; margin-bottom: 14px;
}
.card p { color: var(--testo-tenue); font-size: .95rem; }

/* card cliccabili (risorse esterne) */
.cards-risorse { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color .15s, transform .12s; }
.card-link:hover { border-color: var(--verde); transform: translateY(-2px); }
.card-dominio { margin-top: auto; padding-top: 12px; color: var(--verde); font-size: .82rem; font-weight: 600; }

/* ---------- per chi ---------- */
.perchi-inner { display: grid; grid-template-columns: 1.3fr .9fr; gap: 50px; align-items: center; }
.checklist { list-style: none; margin: 18px 0; }
.checklist li { padding: 9px 0 9px 34px; position: relative; font-size: 1.05rem; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--verde); color: #fff; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.nota-onesta {
  margin-top: 18px; padding: 16px 20px;
  background: #fdf3e3; border-left: 4px solid var(--ambra);
  border-radius: 0 10px 10px 0; color: var(--testo); font-size: .98rem;
}
.perchi-cta {
  background: var(--verde-scuro); color: #fff;
  border-radius: var(--raggio); padding: 34px 30px; text-align: center;
  box-shadow: var(--ombra);
}
.perchi-cta p { margin-bottom: 20px; font-size: 1.05rem; }
.perchi-cta .btn { background: var(--ambra); color: var(--verde-scuro); }
.perchi-cta .btn:hover { background: #f0b356; }

/* ---------- percorso ---------- */
.percorso {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 22px; margin: 40px 0;
  counter-reset: step;
}
.percorso li {
  background: var(--bianco); border: 1px solid var(--linea);
  border-radius: var(--raggio); padding: 26px 22px; position: relative;
}
.p-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ambra); color: var(--verde-scuro);
  font-family: var(--font-titoli); font-weight: 700; font-size: 1.15rem;
  margin-bottom: 14px;
}
.percorso p { color: var(--testo-tenue); font-size: .95rem; }

/* ---------- faq ---------- */
.faq {
  background: var(--bianco); border: 1px solid var(--linea);
  border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1.02rem;
  list-style: none; position: relative; padding-right: 46px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%); font-size: 1.4rem; color: var(--verde);
}
.faq[open] summary::after { content: "–"; }
.faq p { padding: 0 22px 18px; color: var(--testo-tenue); }

/* ---------- cta finale ---------- */
.cta-finale { background: var(--verde-scuro); color: #fff; padding: 70px 0; }
.cta-finale h2 { color: #fff; }
.cta-finale p { margin: 14px 0 26px; color: #cfe0d9; }

/* ---------- footer ---------- */
.footer { background: #0c332a; color: #9db8ae; padding: 40px 0; font-size: .88rem; }
.footer-brand { color: #fff; font-weight: 700; margin-bottom: 10px; }
.footer-disclaimer { max-width: 56em; margin-bottom: 14px; }
.footer-links a { color: #cfe0d9; }

/* ============================================================
   CTA FLOTTANTE — sempre presente, riapre il funnel
   ============================================================ */
.cta-flottante {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  background: var(--ambra); color: var(--verde-scuro);
  border: none; border-radius: 999px;
  padding: 15px 26px; font-size: 1.05rem; font-weight: 700;
  font-family: var(--font-testo); cursor: pointer;
  box-shadow: 0 8px 26px rgba(16, 71, 58, .28);
  transition: transform .16s, box-shadow .16s, background .16s;
  animation: cta-entra .4s ease both;
}
.cta-flottante:hover { background: #f0b356; transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 32px rgba(16,71,58,.34); }
.cta-flottante span[aria-hidden] { font-size: 1.2rem; line-height: 1; }
.cta-flottante.pulsa { animation: cta-entra .4s ease both, cta-pulsa 2.4s ease-in-out 1s infinite; }
@keyframes cta-entra { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes cta-pulsa { 0%, 100% { box-shadow: 0 8px 26px rgba(16,71,58,.28); } 50% { box-shadow: 0 8px 26px rgba(232,161,61,.55), 0 0 0 6px rgba(232,161,61,.14); } }
@media (max-width: 560px) {
  .cta-flottante { right: 14px; bottom: 14px; padding: 13px 20px; font-size: .98rem; }
}

/* ============================================================
   WIZARD
   ============================================================ */
.wizard {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 51, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.wizard-box {
  position: relative; /* ancora per l'overlay .panel-continua */
  background: var(--crema); border-radius: 20px;
  width: 100%; max-width: 680px; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  overflow: hidden;
}

/* Pannello "continua più tardi": copre l'intero box quando attivo.
   Visibilità controllata SOLO via style.display inline da JS (mai via
   attributo hidden né classi) — stessa tecnica bulletproof del wizard. */
.panel-continua {
  position: absolute; inset: 0; z-index: 10;
  background: var(--crema);
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 34px 28px;
}
.panel-continua-chiudi {
  background: none; border: none; color: var(--testo-tenue);
  font-size: .95rem; cursor: pointer; padding: 6px 0; margin-bottom: 10px;
  align-self: flex-start;
}
.panel-continua-chiudi:hover { color: var(--verde); }
.panel-continua-corpo { flex: 1; }
.wizard-testata { display: flex; align-items: center; gap: 14px; padding: 16px 16px 0 20px; flex-shrink: 0; }
.wizard-progress { flex: 1; height: 8px; background: var(--linea); border-radius: 999px; overflow: hidden; }
.wizard-progress-bar { height: 100%; width: 0%; background: var(--verde); border-radius: 999px; transition: width .3s; }
.wizard-chiudi {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -6px -6px 0 0;
  background: none; border: none; font-size: 1.9rem; line-height: 1;
  color: var(--testo-tenue); cursor: pointer; border-radius: 50%;
  transition: background .15s, color .15s;
}
.wizard-chiudi:hover { color: var(--testo); background: rgba(0,0,0,.06); }
/* il corpo è l'unica parte che scorre: min-height:0 evita il bug flexbox
   per cui su finestre basse non comparirebbe lo scroll e gli estremi
   (X in alto, link in basso) diventerebbero irraggiungibili */
.wizard-corpo { padding: 22px 34px 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.wizard-piede {
  padding: 8px 34px 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.windietro {
  background: none; border: none; color: var(--testo-tenue);
  font-size: .95rem; cursor: pointer; padding: 6px 0;
}
.windietro:hover { color: var(--verde); }
.wcontinua-tardi {
  background: none; border: none; color: var(--testo-tenue);
  font-size: .88rem; text-decoration: underline; cursor: pointer;
  padding: 6px 0; margin-left: auto;
}
.wcontinua-tardi:hover { color: var(--verde); }

.wlink-piccolo {
  display: block; background: none; border: none; color: var(--testo-tenue);
  font-size: .85rem; text-decoration: underline; cursor: pointer;
  margin: 10px auto 0; padding: 4px 0; text-align: center;
}
.wlink-piccolo:hover { color: var(--verde); }

.wstep h2 { font-size: 1.45rem; margin-bottom: 8px; }
.wsub { color: var(--testo-tenue); margin-bottom: 20px; font-size: .98rem; }

.choices { display: grid; gap: 12px; margin: 22px 0 12px; }
.choice {
  text-align: left; background: var(--bianco);
  border: 2px solid var(--linea); border-radius: 12px;
  padding: 16px 20px; cursor: pointer; font-family: var(--font-testo);
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 2px;
}
.choice:hover { border-color: var(--verde); }
.choice.scelto { border-color: var(--verde); background: var(--verde-chiaro); }
.choice strong { font-size: 1.05rem; color: var(--verde-scuro); }
.choice span { color: var(--testo-tenue); font-size: .9rem; }

.wform { display: grid; gap: 10px; margin-top: 10px; }
.wform label { font-weight: 600; font-size: .95rem; margin-top: 8px; }
.wform input, .wform select, .wform textarea {
  width: 100%; padding: 13px 15px; font-size: 1rem;
  border: 2px solid var(--linea); border-radius: 10px;
  background: var(--bianco); font-family: var(--font-testo); color: var(--testo);
}
.wform input:focus, .wform select:focus, .wform textarea:focus {
  outline: none; border-color: var(--verde);
}
.wform .btn, .wavanti { margin-top: 16px; justify-self: start; }
.wform-2col { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.wform-2col > div { display: grid; gap: 6px; }

.campo-password { position: relative; }
.campo-password input { padding-right: 46px; }
.mostra-password {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  padding: 8px; line-height: 1; color: var(--testo-tenue);
}
.mostra-password:hover { color: var(--verde); }

.checks { display: grid; gap: 10px; margin: 18px 0 8px; }
.checks label {
  display: flex; align-items: center; gap: 12px;
  background: var(--bianco); border: 2px solid var(--linea);
  border-radius: 10px; padding: 13px 16px; cursor: pointer; font-size: .98rem;
}
.checks label:has(input:checked) { border-color: var(--verde); background: var(--verde-chiaro); }
.checks input { width: 18px; height: 18px; accent-color: var(--verde); }

.consenso {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 18px 0 8px; font-size: .9rem; color: var(--testo-tenue);
  cursor: pointer;
}
.consenso input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--verde); flex-shrink: 0; }
.consenso a { color: var(--verde); }

.werrore { color: var(--rosso); font-size: .92rem; margin-top: 10px; font-weight: 600; }

.wnota { margin-top: 16px; font-size: .88rem; color: var(--testo-tenue); }
.wnota a { color: var(--verde); }
.wnota-verde {
  background: var(--verde-chiaro); border-left: 4px solid var(--verde);
  padding: 12px 16px; border-radius: 0 10px 10px 0;
}
.wnota-verde a { color: var(--verde-scuro); font-weight: 600; }

.wsalta {
  background: none; border: none; color: var(--testo-tenue);
  text-decoration: underline; cursor: pointer; margin-top: 14px;
  font-size: .9rem; font-family: var(--font-testo);
}
.wsalta:hover { color: var(--verde); }

.fine-risorse { margin: 4px 0 18px 20px; display: grid; gap: 6px; font-size: .95rem; }
.fine-risorse a { color: var(--verde); }

.esito-icona {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 700; margin-bottom: 18px;
}
.esito-ok { background: var(--verde-chiaro); color: var(--verde); }
.esito-warn { background: #fdf3e3; color: var(--ambra-scuro); font-family: var(--font-titoli); font-style: italic; }

.dopo-invio { margin: 6px 0 18px 20px; display: grid; gap: 8px; }

/* honeypot: invisibile agli umani */
.hp-wrap { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

#btn-vai-contatti, #btn-invia { margin-top: 10px; }
#btn-invia[disabled] { opacity: .6; cursor: wait; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner, .perchi-inner { grid-template-columns: 1fr; gap: 34px; }
  .cards, .percorso { grid-template-columns: repeat(2, 1fr); }
  .topnav a { display: none; }
}
@media (max-width: 560px) {
  .cards, .percorso { grid-template-columns: 1fr; }
  .wform-2col { grid-template-columns: 1fr; }
  .hero { padding: 46px 0 54px; }
  .sezione { padding: 50px 0; }
  .wizard { padding: 0; }
  .wizard-box { max-height: 100vh; height: 100%; border-radius: 0; }
  .wizard-corpo { padding: 22px 20px 10px; }
  .wizard-piede { padding: 8px 20px 18px; }
  .panel-continua { padding: 18px 20px 24px; }
  .account-box { padding: 26px 22px; }
}

/* ============================================================
   AREA ACCOUNT — registrazione, login, reset, dashboard
   (riusa .wform, .werrore, .btn, .consenso, .esito-icona già definiti sopra)
   ============================================================ */
.account-pagina {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--crema);
}
.account-box {
  background: var(--bianco); border: 1px solid var(--linea);
  border-radius: var(--raggio); box-shadow: var(--ombra);
  padding: 34px 36px; width: 100%; max-width: 440px;
}
.account-box h1 { font-size: 1.5rem; margin-bottom: 8px; }
.account-box .wform { margin-top: 6px; }
.account-box .btn { width: 100%; margin-top: 16px; }
.account-links { margin-top: 18px; text-align: center; font-size: .92rem; color: var(--testo-tenue); }
.account-links a { color: var(--verde); }
.account-nota-email { font-size: .85rem; color: var(--testo-tenue); margin-top: -4px; }
.account-tabella { width: 100%; border-collapse: collapse; font-size: .92rem; }
.account-tabella th, .account-tabella td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea); }
.account-tabella th { color: var(--testo-tenue); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
