/* ============================================================================
   SOLVO — stile. Dark istituzionale fintech, sobrio e credibile.
   ============================================================================ */
:root {
  --bg: #0a0e15;
  --bg-2: #0e1420;
  --surface: #121a28;
  --surface-2: #16202f;
  --line: #1e2a3c;
  --line-2: #27374d;
  --text: #e8edf5;
  --muted: #8a97ab;
  --faint: #5b6879;
  --accent: #4ea1ff;
  --accent-soft: rgba(78,161,255,.12);
  --ok: #37c98b;
  --good: #7ed957;
  --mid: #f4c542;
  --low: #f0883e;
  --bad: #e5484d;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(78,161,255,.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(55,201,139,.07), transparent 55%),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
header.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10,14,21,.72);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 14px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; font-size: 19px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7ed957);
  display: grid; place-items: center; color: #06202e; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 18px rgba(78,161,255,.35);
}
.brand small { color: var(--faint); font-weight: 500; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.top .spacer { flex: 1; }
.badge-priv {
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2);
  padding: 5px 10px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center;
}
.badge-priv b { color: var(--ok); }

main { padding: 34px 0 80px; }
.step { display: none; animation: fade .35s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1.title { font-size: clamp(26px, 4.4vw, 40px); letter-spacing: -.03em; margin: 6px 0 8px; }
.lead { color: var(--muted); font-size: 16px; max-width: 620px; margin: 0 0 26px; }

/* ---------- mode cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card.feature { border-color: var(--line-2); background: linear-gradient(180deg, rgba(78,161,255,.10), var(--bg-2)); }
.card.feature:hover { border-color: var(--accent); }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; cursor: pointer; text-align: left;
  transition: border-color .2s, transform .2s, box-shadow .2s; color: inherit;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ico { font-size: 26px; }
.card h3 { margin: 12px 0 4px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card .tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; }

/* ---------- form ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.panel-h { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 17px; }
.panel-h .n { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.panel-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--faint); }
.field .inp {
  display: flex; align-items: center; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px;
  transition: border-color .15s, box-shadow .15s;
}
.field .inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .inp .pre { color: var(--faint); font-size: 14px; padding-right: 6px; }
.field input, .field select {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--text);
  font-size: 15px; padding: 11px 0; font-family: var(--font); font-variant-numeric: tabular-nums; min-width: 0;
}
.field select { cursor: pointer; }
.field input::placeholder { color: var(--faint); }

/* ---------- selettore sorgente (banca/csv/demo) ---------- */
.src-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.src-tab {
  flex: 1; min-width: 120px; appearance: none; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted);
  font-family: var(--font); font-size: 13.5px; font-weight: 600; padding: 11px 12px; border-radius: 10px;
  transition: all .15s;
}
.src-tab:hover { border-color: var(--accent); color: var(--text); }
.src-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ob { }
.ob-lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.ob-hint { font-size: 12.5px; color: var(--faint); margin: 12px 0 0; }
.ob-off {
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
}
.ob-off code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.ob-off a { color: var(--accent); text-decoration: none; font-weight: 600; }
.ob-off a:hover { text-decoration: underline; }

/* ---------- CSV dropzone ---------- */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 20px;
  text-align: center; color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { color: var(--accent); }
.csv-note { margin-top: 12px; font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: none; }
.csv-note.show { display: block; }
.csv-note .k { color: var(--text); font-weight: 600; }

/* ---------- buttons ---------- */
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-size: 14.5px; font-weight: 600; font-family: var(--font);
  padding: 12px 20px; border-radius: 11px; cursor: pointer; transition: all .18s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #3f8ae0); border-color: transparent; color: #041423; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn .arw { opacity: .7; }

/* ---------- result ---------- */
.result-top { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: stretch; }
.gauge-card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.gauge-wrap { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.gauge-score { position: absolute; left: 0; right: 0; top: 52%; transform: translateY(-50%); }
.gauge-score .val { font-size: 58px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-score .out { font-size: 15px; color: var(--faint); }
.classe-pill { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 8px; padding: 7px 16px; border-radius: 999px; font-weight: 700; }
.classe-pill .c { font-size: 20px; }
.classe-pill .lb { font-size: 14px; }
.gauge-sub { color: var(--muted); font-size: 13.5px; margin-top: 12px; }

.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.summary-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.bank-line { font-size: 17px; line-height: 1.5; margin: 4px 0 16px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: auto; }
.meta { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.meta .k { font-size: 11.5px; color: var(--faint); }
.meta .v { font-size: 17px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.flags { margin-top: 18px; }
.flag { display: flex; gap: 10px; background: rgba(229,72,77,.09); border: 1px solid rgba(229,72,77,.35); color: #ffc9cb; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 8px; }
.flag .ico { flex: 0 0 auto; }

.section-h { font-size: 13px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin: 30px 0 12px; }

/* indicatori */
.indicators { display: grid; gap: 10px; }
.ind { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ind-top { display: flex; align-items: baseline; gap: 10px; }
.ind-top .lbl { font-weight: 600; font-size: 14.5px; }
.ind-top .val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14.5px; }
.ind-top .st { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.st.buono { background: rgba(55,201,139,.15); color: var(--ok); }
.st.medio { background: rgba(244,197,66,.15); color: var(--mid); }
.st.debole { background: rgba(229,72,77,.15); color: var(--bad); }
.bar { height: 7px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 10px 0 8px; }
.bar > span { display: block; height: 100%; border-radius: 999px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.ind-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.ind-foot .ideal { color: var(--faint); white-space: nowrap; }

/* driver + consigli */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.list-card h4 { margin: 0 0 12px; font-size: 14px; }
.list-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.list-card li { font-size: 13.5px; color: var(--text); display: flex; gap: 9px; align-items: flex-start; }
.list-card li .dot { flex: 0 0 auto; margin-top: 6px; width: 7px; height: 7px; border-radius: 50%; }
.dot.g { background: var(--ok); } .dot.b { background: var(--bad); } .dot.a { background: var(--accent); }
.advice li { color: var(--muted); }

.disclaimer { margin-top: 30px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 16px; }

footer.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; padding: 22px 0; }
footer .wrap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .brand small { display: none; }
  .priv-tail { display: none; }
  .badge-priv { white-space: nowrap; }
}
@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; }
  .result-top { grid-template-columns: 1fr; }
  .grid, .two-col, .meta-grid { grid-template-columns: 1fr; }
}
@media print {
  header.top, footer.foot, .row-actions, .badge-priv { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .card, .ind, .list-card, .gauge-card, .summary-card { box-shadow: none; }
}
