/* ==========================================================================
   comproauto.com — Design system
   ========================================================================== */

:root {
  --nero:          #0D0D0D;
  --verde:         #00C896;
  --verde-light:   rgba(0,200,150,0.10);
  --verde-dark:    #00875A;
  --bianco:        #FFFFFF;
  --grigio-bg:     #F8F8F8;
  --grigio-surface:#F2F2F2;
  --grigio-border: #E8E8E8;
  --grigio-testo:  #888888;
  --grigio-hint:   #BBBBBB;
  --rosso-err:     #E63946;
  --font-primary:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:     0 12px 32px rgba(0,0,0,0.10);
  --radius-sm:     6px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --max-width:     1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.65;
  color: var(--nero);
  background: var(--bianco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--verde-dark); }

/* Typography */
h1, h2, h3, h4, h5 {
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--nero);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p  { margin: 0 0 1em; }
strong { font-weight: 700; }

ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.3em; }

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* Accent bar (elemento decorativo brief) */
.accent-bar {
  width: 32px; height: 3px; background: var(--verde);
  border-radius: 2px; margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: inherit; font-weight: 800; font-size: 1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease, background .15s ease;
  text-decoration: none;
  min-height: 48px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--verde); color: var(--nero);
  border-color: var(--verde);
}
.btn-primary:hover { background: var(--verde-dark); color: var(--bianco); border-color: var(--verde-dark); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent; color: var(--nero);
  border-color: var(--nero);
}
.btn-secondary:hover { background: var(--nero); color: var(--bianco); }

.btn-ghost {
  background: var(--verde-light); color: var(--verde-dark);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--verde); color: var(--nero); }

.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; min-height: 40px; }
.btn-lg { padding: 18px 36px; font-size: 1.1rem; min-height: 56px; }

/* Cards */
.card {
  background: var(--bianco);
  border: 0.5px solid var(--grigio-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow .2s ease, transform .1s ease;
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Forms */
input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* anti-zoom iOS */
  padding: 12px 16px;
  background: var(--grigio-surface);
  border: 0.5px solid var(--grigio-border);
  border-radius: var(--radius-md);
  width: 100%;
  color: var(--nero);
  transition: border-color .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde);
  background: var(--bianco);
  box-shadow: 0 0 0 3px var(--verde-light);
}
textarea { resize: vertical; min-height: 100px; }
label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field-hint { color: var(--grigio-testo); font-size: 0.85rem; margin-top: 4px; }
.field-error { color: var(--rosso-err); font-size: 0.85rem; margin-top: 4px; display: none; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--rosso-err); }
.field.has-error .field-error { display: block; }

/* Radio/checkbox cards */
.opt-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.opt {
  display: block;
  padding: 14px 16px;
  background: var(--grigio-surface);
  border: 1.5px solid var(--grigio-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  transition: all .15s ease;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked),
.opt.checked { background: var(--verde-light); border-color: var(--verde); color: var(--verde-dark); }

/* =============== HEADER =============== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bianco);
  border-bottom: 0.5px solid var(--grigio-border);
  padding: 14px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-nav { display: flex; align-items: center; gap: 28px; }
.header-nav a { font-weight: 600; font-size: 0.95rem; }
.header-nav a.active { color: var(--verde-dark); }
.header-cta { }
.nav-mobile-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 8px; }
.nav-mobile-toggle svg { width: 24px; height: 24px; }

/* =============== LOGO =============== */
.logo {
  font-family: var(--font-primary);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-size: 1.4rem;
  display: inline-block;
  color: var(--nero);
  position: relative;
}
.logo-row { display: flex; align-items: flex-start; }
.logo-compro { position: relative; }
.logo-dot {
  position: absolute;
  top: -0.15em;
  right: -0.25em;
  color: var(--verde);
  font-size: 1.2em;
  line-height: 1;
  font-weight: 900;
}
.logo-auto { }
.logo-com { font-weight: 400; color: var(--grigio-testo); }
.logo-tld { color: var(--nero); font-weight: 900; }

/* =============== HERO =============== */
.hero {
  padding: clamp(60px, 9vw, 120px) 0 clamp(40px, 7vw, 80px);
  background: linear-gradient(180deg, var(--bianco) 0%, var(--grigio-bg) 100%);
}
.hero h1 { max-width: 14em; margin-bottom: 20px; }
.hero-sub { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--grigio-testo); max-width: 40em; margin-bottom: 32px; }
.hero-cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-microcopy { color: var(--grigio-testo); font-size: 0.9rem; }
.hero-microcopy::before { content: "●"; color: var(--verde); margin-right: 8px; font-size: 0.7em; vertical-align: middle; }

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  padding: 32px 0;
  border-top: 0.5px solid var(--grigio-border);
  border-bottom: 0.5px solid var(--grigio-border);
  margin-top: 40px;
}
.stat { text-align: left; }
.stat-number { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; line-height: 1; color: var(--nero); }
.stat-number .unit { color: var(--verde); }
.stat-label { color: var(--grigio-testo); font-size: 0.9rem; margin-top: 6px; }

/* =============== SECTIONS =============== */
.section { padding: clamp(48px, 8vw, 100px) 0; }
.section-alt { background: var(--grigio-bg); }
.section-dark { background: var(--nero); color: var(--bianco); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--bianco); }
.section-dark p { color: rgba(255,255,255,0.8); }

.section-head { margin-bottom: 40px; max-width: 42em; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--grigio-testo); font-size: 1.1rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.step { position: relative; padding-left: 60px; }
.step-num {
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px;
  background: var(--verde); color: var(--nero);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.2rem;
}
.step h3 { margin-bottom: 8px; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature { padding: 24px; }
.feature-icon { width: 40px; height: 40px; background: var(--verde-light); color: var(--verde-dark); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 1.4rem; font-weight: 900; }
.feature h3 { margin-bottom: 8px; font-size: 1.1rem; }
.feature p { color: var(--grigio-testo); font-size: 0.95rem; margin: 0; }

/* Brand grid */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.brand-tile {
  background: var(--bianco); border: 0.5px solid var(--grigio-border);
  padding: 20px 12px; text-align: center;
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 0.95rem;
  transition: all .15s ease;
}
.brand-tile:hover { background: var(--verde-light); border-color: var(--verde); color: var(--verde-dark); }

/* Reviews */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.review .stars { color: var(--verde); margin-bottom: 8px; font-size: 1.1rem; }
.review-text { margin: 12px 0; }
.review-author { font-size: 0.9rem; color: var(--grigio-testo); }
.review-author strong { color: var(--nero); }

/* Guides list */
.guide-card { transition: all .15s ease; }
.guide-card .cat {
  display: inline-block;
  background: var(--verde-light); color: var(--verde-dark);
  padding: 4px 10px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.guide-card h3 { font-size: 1.15rem; line-height: 1.3; margin-bottom: 8px; }
.guide-card .meta { color: var(--grigio-hint); font-size: 0.85rem; }

/* CTA banner */
.cta-banner {
  background: var(--nero); color: var(--bianco);
  padding: 60px 0;
  text-align: center;
}
.cta-banner h2 { color: var(--bianco); margin-bottom: 16px; }
.cta-banner p { color: rgba(255,255,255,0.7); margin-bottom: 28px; font-size: 1.1rem; }

/* FOOTER */
.footer { background: var(--nero); color: rgba(255,255,255,0.7); padding: 60px 0 30px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { color: var(--bianco); font-size: 0.95rem; margin-bottom: 16px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.footer ul { list-style: none; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: var(--verde); }
.footer-bottom { border-top: 0.5px solid rgba(255,255,255,0.15); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq-item { border-bottom: 0.5px solid var(--grigio-border); padding: 20px 0; }
.faq-domanda { font-size: 1.1rem; margin-bottom: 10px; font-weight: 700; }
.faq-risposta { color: var(--grigio-testo); margin: 0; }

/* Form multi-step */
.form-wizard { max-width: 720px; margin: 0 auto; }
.wizard-progress { display: flex; gap: 6px; margin-bottom: 40px; }
.wizard-progress .dot { flex: 1; height: 4px; background: var(--grigio-border); border-radius: 2px; transition: background .2s ease; }
.wizard-progress .dot.active { background: var(--verde); }
.wizard-progress .dot.done { background: var(--verde-dark); }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn .25s ease; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 32px; gap: 12px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--grigio-testo); margin-bottom: 20px; padding-top: 20px; }
.breadcrumb a { color: var(--grigio-testo); }
.breadcrumb a:hover { color: var(--verde-dark); }
.breadcrumb .sep { margin: 0 8px; color: var(--grigio-hint); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 0.5px solid var(--grigio-border); }
th { font-weight: 700; background: var(--grigio-bg); color: var(--nero); }
tr:hover td { background: var(--grigio-bg); }

/* Content block (testo generato dall'AI) */
.content-block h2 { margin: 40px 0 16px; }
.content-block h3 { margin: 28px 0 12px; }
.content-block p, .content-block li { font-size: 1.02rem; line-height: 1.75; }
.content-block ul, .content-block ol { margin: 0 0 1.5em 1.4em; }

/* Related links */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.related-tile {
  padding: 14px 18px;
  background: var(--grigio-surface);
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.92rem;
  transition: all .15s ease;
}
.related-tile:hover { background: var(--verde-light); color: var(--verde-dark); }

/* Alert / info box */
.info-box {
  background: var(--verde-light);
  border-left: 3px solid var(--verde);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--grigio-testo); }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.hidden { display: none !important; }

/* =============== MOBILE =============== */
@media (max-width: 820px) {
  .nav-mobile-toggle { display: inline-flex; }
  .header-nav { position: fixed; top: 62px; left: 0; right: 0; bottom: 0; background: var(--bianco); flex-direction: column; align-items: stretch; padding: 20px; gap: 4px; transform: translateX(100%); transition: transform .25s ease; }
  .header-nav.open { transform: translateX(0); }
  .header-nav a { padding: 14px 0; border-bottom: 0.5px solid var(--grigio-border); font-size: 1.05rem; }
  .header-nav .btn { margin-top: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .wizard-actions { flex-direction: column-reverse; }
  .wizard-actions .btn { width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .hero-cta-row .btn { max-width: none; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .opt-group { grid-template-columns: repeat(2, 1fr); }
}

/* ==== COOKIE BANNER ==== */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  max-width: 520px;
  background: var(--nero); color: var(--bianco);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}
.cookie-banner.show { display: block; animation: slideUp .3s ease; }
.cookie-banner h3 { color: var(--bianco); font-size: 1rem; margin-bottom: 8px; }
.cookie-banner p { color: rgba(255,255,255,0.85); margin-bottom: 16px; font-size: 0.85rem; }
.cookie-banner a { color: var(--verde); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-actions .btn { flex: 1; padding: 10px 14px; min-height: 40px; font-size: 0.85rem; }
.cookie-actions .btn-primary { flex: 2; }
@keyframes slideUp { from { transform: translateY(110%); } to { transform: translateY(0); } }

/* Print */
@media print {
  .header, .footer, .cta-banner, .cookie-banner, .btn { display: none !important; }
  body { color: #000; }
}
