/* ─────────────────────────────────────────────────────────────
   ValutazioniOnline — Design System (stile VerificaTarga/RevisioniOnline)
   Colore accento: viola (#7C3AED / #A78BFA)
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-var-latin.woff2?v=20261019') format('woff2');
}

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

:root {
  /* Viola (accento principale) */
  --violet-50:  #F5F3FF;
  --violet-100: #EDE9FE;
  --violet-200: #DDD6FE;
  --violet-300: #C4B5FD;
  --violet-400: #A78BFA;
  --violet-500: #8B5CF6;
  --violet-600: #7C3AED;
  --violet-700: #6D28D9;
  --violet-800: #5B21B6;
  --violet-900: #4C1D95;

  /* Neutri */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Successo / Errore */
  --green-50:  #F0FDF4;
  --green-500: #22C55E;
  --green-600: #16A34A;
  --red-50:    #FFF1F2;
  --red-500:   #F43F5E;
  --amber-50:  #FFFBEB;

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(124,58,237,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700);
  background: #fff;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.page-share { background: linear-gradient(165deg, #FFFFFF 0%, var(--violet-50) 55%, var(--violet-100) 100%); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

a { color: var(--violet-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ──────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text { font-size: 1.15rem; font-weight: 400; color: var(--gray-700); letter-spacing: -.01em; }
.logo-text strong { color: var(--violet-600); font-weight: 700; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav-link { font-size: .875rem; font-weight: 600; color: var(--gray-700); text-decoration: none; transition: color .15s; }
.nav-link:hover { color: var(--violet-600); text-decoration: none; }

.login-btn {
  background: transparent;
  border: 1.5px solid rgba(124,58,237,.35);
  color: var(--violet-700);
  padding: .38rem .95rem;
  border-radius: 999px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  text-decoration: none;
}
.login-btn:hover { border-color: var(--violet-600); background: var(--violet-50); color: var(--violet-800); text-decoration: none; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main { flex: 1; }

/* ── HERO ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 64px;
  background: linear-gradient(160deg, #FFFFFF 0%, var(--violet-50) 50%, var(--violet-100) 100%);
}

.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; text-align: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--violet-200);
  font-size: .8rem;
  font-weight: 500;
  color: var(--violet-700);
  margin-bottom: 24px;
}

.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet-500); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--gray-900);
  letter-spacing: -.03em;
  margin-bottom: 16px;
}
.hero-title .accent { color: var(--violet-500); }

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.deco-circle { position: absolute; border-radius: 50%; pointer-events: none; }
.deco-1 { width: 420px; height: 420px; background: rgba(124,58,237,.06); top: -160px; right: -120px; }
.deco-2 { width: 320px; height: 320px; background: rgba(167,139,250,.08); bottom: -140px; left: -100px; }
.deco-3 { width: 160px; height: 160px; background: rgba(251,191,36,.07); top: 30%; left: 12%; }

/* ── FORM CARD ────────────────────────────────────────────────── */
.search-card {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
  max-width: 720px;
  margin: 0 auto;
}

.search-card h2 { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; margin-bottom: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

label { font-size: .78rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 6px; }

select, input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--gray-800);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
select:focus, input:focus {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
  background: #fff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 26px;
  border: none;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  color: #fff;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124,58,237,.3); text-decoration: none; }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border: 2px solid var(--violet-200);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--violet-700);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--violet-500); background: var(--violet-50); text-decoration: none; }

.msg { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-md); font-size: .85rem; display: none; }
.msg.err { background: var(--red-50); color: var(--red-500); }
.msg.ok { background: var(--green-50); color: var(--green-600); }
.msg.show { display: block; }

.result-card {
  margin-top: 18px;
  background: var(--violet-50);
  border: 1px solid var(--violet-200);
  border-radius: var(--r-lg);
  padding: 22px;
  text-align: center;
}
.result-price { font-size: 2rem; font-weight: 800; color: var(--violet-700); letter-spacing: -.02em; }
.result-range { font-size: .88rem; color: var(--gray-500); margin-top: 4px; }

.comp-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--violet-200); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.comp-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px;
  padding: 8px 12px; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--r-md);
  font-size: .82rem;
}
.comp-name { font-weight: 600; color: var(--gray-900); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-data { color: var(--gray-400); font-size: .78rem; white-space: nowrap; }
.comp-price { font-weight: 700; color: var(--violet-600); white-space: nowrap; }

.confronto-box, .proj-box { margin-top: 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--violet-200); border-radius: var(--r-lg); text-align: left; }
.confronto-box strong, .proj-box strong { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--violet-700); margin-bottom: 8px; }
.confronto-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 7px 0; font-size: .85rem; color: var(--gray-700); }
.confronto-row + .confronto-row { border-top: 1px solid var(--gray-100); }
.confronto-val { font-weight: 700; color: var(--violet-600); white-space: nowrap; }
.confronto-det { color: var(--gray-400); font-size: .78rem; }
.share-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .82rem; }
.share-table th { text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--violet-700); padding: 6px 8px; border-bottom: 1px solid var(--violet-200); }
.share-table td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.proj-note { margin: 10px 0 0; font-size: .75rem; color: var(--gray-400); }

/* ── SEZIONI ──────────────────────────────────────────────────── */
.section { padding: 64px 24px; }
.section--alt { background: var(--gray-50); border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); }

.section-header { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section-badge {
  display: inline-block;
  background: var(--violet-50);
  color: var(--violet-700);
  border: 1px solid var(--violet-200);
  border-radius: 999px;
  padding: .3rem .95rem;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .8rem;
  letter-spacing: .01em;
}
.section-title { font-size: 1.9rem; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; line-height: 1.25; margin-bottom: .5rem; }
.section-sub { font-size: 1rem; color: var(--gray-500); }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 40px auto 0; max-width: 900px; }
.summary-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 20px 22px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.summary-value { font-size: 1.6rem; font-weight: 700; color: var(--violet-600); letter-spacing: -.02em; }
.summary-label { font-size: .78rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

.step-card {
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem;
  margin-bottom: 14px;
}
.step-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.step-card p { font-size: .88rem; color: var(--gray-500); }

.feature-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.feature-card:hover { border-color: var(--violet-400); box-shadow: var(--shadow-md); }
.feature-card h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.feature-card p { font-size: .86rem; color: var(--gray-500); margin-top: 6px; }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--violet-50);
  color: var(--violet-600);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-icon svg { width: 22px; height: 22px; }

.audience-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
}
.audience-card h3 { font-size: .95rem; font-weight: 700; color: var(--gray-900); }
.audience-card p { font-size: .83rem; color: var(--gray-500); margin-top: 6px; }

/* ── PRICING ──────────────────────────────────────────────────── */
.pricing-card {
  background: #fff;
  border: 1.5px solid var(--gray-300);
  border-radius: 16px;
  padding: 26px 22px;
  position: relative;
  box-shadow: var(--shadow-md);
  transition: box-shadow .2s, border-color .2s;
}
.pricing-card:hover { box-shadow: 0 8px 28px rgba(124,58,237,.15); border-color: var(--violet-400); }
.pricing-card--popular { border-color: var(--violet-500); box-shadow: 0 6px 24px rgba(124,58,237,.18); }

.pricing-popular-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--violet-600), var(--violet-400));
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .85rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .04em;
}

.pricing-card-name { font-size: .82rem; font-weight: 700; color: var(--violet-700); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.pricing-card-price { font-size: 1.7rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; margin-bottom: .2rem; }
.pricing-card-price small { font-size: .82rem; color: var(--gray-400); font-weight: 600; }
.pricing-card ul { list-style: none; margin: 12px 0 0; }
.pricing-card ul li { padding: 6px 0 6px 24px; position: relative; font-size: .84rem; color: var(--gray-600); }
.pricing-card ul li::before { content: '\2713'; position: absolute; left: 0; top: 6px; color: var(--violet-500); font-weight: 800; }

/* ── FOOTER ────────────────────────────────────────────────────── */
.footer { background: #fff; border-top: 1px solid var(--gray-100); padding: 40px 24px 28px; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer-col { display: flex; flex-direction: column; gap: 7px; min-width: 150px; }
.footer-col h4 { color: var(--gray-900); font-size: .78rem; margin-bottom: 4px; letter-spacing: .06em; text-transform: uppercase; }
.footer-col a { color: var(--gray-600); font-size: .87rem; font-weight: 500; text-decoration: none; }
.footer-col a:hover { color: var(--violet-700); text-decoration: underline; }
.footer-tagline { color: var(--gray-500); font-size: .82rem; max-width: 300px; }

/* ── UTILITIES ─────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.muted { color: var(--gray-400); }
.small { font-size: .8rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th { text-align: left; padding: 10px 12px; color: var(--gray-400); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--gray-100); }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
table.tbl tr:last-child td { border-bottom: none; }

@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeSlideUp .4s ease-out forwards; }

@media (max-width: 640px) {
  .hero { padding: 48px 16px 40px; }
  .section { padding: 48px 16px; }
  .nav-link--hide-mobile { display: none; }
}

/* ── Banner avviso sito (toggle admin /idra) ────────────────────── */
.site-banner {
  display:         flex;
  align-items:     flex-start;
  gap:             12px;
  max-width:       680px;
  margin:          20px auto 0;
  padding:         12px 18px;
  border-radius:   var(--r-sm);
  font-size:       .88rem;
  line-height:     1.5;
  text-align:      left;
}

.site-banner[hidden] { display: none; }

.site-banner__icon {
  font-size:   1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.site-banner__text {
  margin:      0;
  font-weight: 500;
}

.site-banner--warning {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border:     1.5px solid #FCD34D;
  color:      #92400E;
}

.site-banner--error {
  background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
  border:     1.5px solid #FCA5A5;
  color:      #991B1B;
}

/* ── DASHBOARD: valutatore web + storico ────────────────────────── */
.check-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; }
.check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--gray-600);
  text-transform: none; letter-spacing: 0; cursor: pointer; margin-bottom: 0;
}
.check-label input { width: 16px; height: 16px; accent-color: #7C3AED; flex-shrink: 0; }

.shap-list {
  margin-top: 14px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--gray-100); border-radius: var(--r-md);
  text-align: left; font-size: .8rem; color: var(--gray-700);
  display: flex; flex-direction: column; gap: 6px;
}
.shap-list strong { color: var(--gray-900); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.shap-row { display: flex; justify-content: space-between; gap: 10px; }
.shap-row span:last-child { font-weight: 700; color: var(--violet-700); white-space: nowrap; }

.confronto-box, .proj-box {
  margin-top: 12px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--violet-200); border-radius: var(--r-md);
  text-align: left; font-size: .84rem; color: var(--gray-700);
}
.proj-box table.tbl { margin-top: 10px; }

.val-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.src-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--gray-100); color: var(--gray-600);
}
.src-api { background: var(--violet-50); color: var(--violet-700); }
.src-web { background: #ECFDF5; color: #047857; }
.src-playground { background: #FEF3C7; color: #B45309; }
.src-batch { background: #EFF6FF; color: #1D4ED8; }

.vo-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 12px 20px;
  border-radius: var(--r-md); font-size: .85rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 999; max-width: 90vw;
}
.vo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.vo-toast.err { background: #DC2626; }

.batch-summary {
  margin-top: 14px; padding: 10px 14px;
  background: var(--violet-50); border: 1px solid var(--violet-200);
  border-radius: var(--r-md); font-size: .85rem; color: var(--gray-700);
  text-align: center;
}
.batch-summary strong { color: var(--violet-700); }
.src-widget { background: #FDF2F8; color: #BE185D; }

.mode-toggle { display: flex; gap: 4px; background: var(--gray-100, #f1f5f9); border: 1px solid var(--gray-200, #e2e8f0); border-radius: 999px; padding: 4px; margin-bottom: 14px; width: fit-content; }
.mode-pill { border: none; background: transparent; color: var(--gray-500, #64748b); font-family: var(--font); font-size: .82rem; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.mode-pill.active { background: var(--violet-600); color: #fff; }
.mode-pill:not(.active):hover { color: var(--violet-700); }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--r-lg); padding: 22px; width: 100%; max-width: 480px; box-shadow: 0 24px 64px rgba(15, 23, 42, .35); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-close { border: none; background: var(--gray-100, #f1f5f9); color: var(--gray-500, #64748b); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .9rem; font-family: var(--font); }
.modal-close:hover { background: var(--violet-100); color: var(--violet-700); }

.targa-chip { border: 1.5px solid var(--violet-200); background: var(--violet-50); color: var(--violet-700); font-family: var(--font); font-size: .8rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.targa-chip.chip-selected { background: var(--violet-600); color: #fff; border-color: var(--violet-600); }
