/* ==========================================================================
   BRUSCO ASSICURAZIONI - PREMIUM DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Colors */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  
  --primary: #0f172a; /* Slate 900 */
  --brand: #2563eb; /* Blue 600 */
  --brand-hover: #1d4ed8;
  --brand-light: #eff6ff; /* Blue 50 */
  
  --accent: #f59e0b; /* Amber 500 */
  --accent-hover: #d97706;
  --accent-light: #fffbeb;
  
  --text-main: #334155; /* Slate 700 */
  --text-heading: #0f172a;
  --text-muted: #64748b; /* Slate 500 */
  
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  
  /* Typography */
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  
  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-glow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== RESET & BASE ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { color: var(--text-heading); font-weight: 700; line-height: 1.2; }
a { color: var(--brand); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-hover); }

/* ===================== TYPOGRAPHY ===================== */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* ===================== LAYOUT & UTILS ===================== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.flex-col { flex-direction: column; }
.gap-8 { gap: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.p-4 { padding: 1rem; }
.rounded { border-radius: var(--radius-sm); }
.border { border: 1px solid var(--border); }
.border-gray-200 { border-color: #e5e7eb; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-white { background-color: var(--bg-surface); }
.bg-body { background-color: var(--bg-body); }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
/* Colonne responsive: da 12 colonne su desktop a blocco pieno su mobile.
   !important perche' i markup usano anche style="grid-column: span N" inline. */
.md\:col-span-4 { grid-column: span 4; }

/* ===================== HEADER ===================== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.brand-logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
.brand-logo img { height: 32px; width: auto; object-fit: contain; }
.nav-menu { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-weight: 500; color: var(--text-muted); }
.nav-link:hover, .nav-link.active { color: var(--primary); }

.mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer; color: var(--primary); padding: 0.5rem;
}

/* ===================== HERO ===================== */
.hero {
  position: relative; overflow: hidden;
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-bottom: 1px solid var(--border);
}
.hero-content {
  max-width: 800px;
  text-align: center;
  margin: 0 auto;
}
.hero-tag {
  display: inline-block; padding: 0.5rem 1rem; background: var(--brand-light); color: var(--brand);
  border-radius: 50px; font-weight: 600; font-size: 0.875rem; margin-bottom: 1.5rem;
}
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.03em; color: var(--primary); margin-bottom: 1.5rem; line-height: 1.1; }
.hero-subtitle { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 600; font-family: inherit; font-size: 0.95rem;
  transition: var(--transition); border: none; cursor: pointer; outline: none;
}
.btn-primary { background-color: var(--brand); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background-color: var(--brand-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:focus-visible { box-shadow: var(--shadow-glow); }
.btn-secondary { background-color: white; color: var(--primary); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background-color: var(--bg-surface-hover); border-color: #cbd5e1; }
.btn-accent { background-color: var(--accent); color: white; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3); }
.btn-accent:hover { background-color: var(--accent-hover); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4); transform: translateY(-2px); }
.btn-full { width: 100%; }

/* ===================== BENTO CARDS ===================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.card-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand);
  border-radius: 12px; margin-bottom: 1.5rem;
}
.card-icon.accent { background: var(--accent-light); color: var(--accent); }
.card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.5; }

/* Grid specific spans */
.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 992px) {
  .bento-grid > .col-span-8, .bento-grid > .col-span-6, .bento-grid > .col-span-4 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .grid-cols-12 > * { grid-column: span 12 !important; }
  .md\:col-span-4 { grid-column: span 12; }
}

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }
.form-input, .form-select {
  width: 100%; padding: 0.75rem 1rem;
  font-family: inherit; font-size: 1rem; color: var(--primary);
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus { background: white; border-color: var(--brand); box-shadow: var(--shadow-glow); }
.form-input::placeholder { color: #94a3b8; }
.form-row { display: flex; gap: 1rem; }
.form-row > * { flex: 1; }

/* ===================== TABS ===================== */
.tabs { display: flex; gap: 0.5rem; padding: 0.25rem; background: #f1f5f9; border-radius: var(--radius-sm); margin-bottom: 1.5rem; }
.tab-btn {
  flex: 1; padding: 0.5rem; text-align: center;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  border: none; background: transparent; border-radius: 6px;
  cursor: pointer; transition: var(--transition);
}
.tab-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); border-bottom: 3px solid var(--brand); border-radius: 6px 6px 0 0; }

/* ===================== RESULTS & ALERT ===================== */
.result-box {
  margin-top: 1.5rem; padding: 1.25rem;
  background: var(--brand-light); border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm); color: var(--brand-hover);
  text-align: center; font-size: 1.1rem; font-weight: 500;
  display: none; animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== AUTOCOMPLETE ===================== */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 250px; overflow-y: auto; display: none;
}
.ac-list.show { display: block; }
.ac-item { padding: 0.75rem 1rem; font-size: 0.95rem; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--brand-light); color: var(--brand-hover); }

/* ===================== CTA BANNER ===================== */
.cta-banner {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  margin: 4rem 0;
}
.cta-title { color: white; font-size: 2rem; margin-bottom: 1rem; }
.cta-desc { color: #cbd5e1; max-width: 600px; margin: 0 auto 2rem; font-size: 1.1rem; }

/* ===================== FOOTER ===================== */
.footer { background: #020617; color: #94a3b8; padding: 4rem 0 2rem; font-size: 0.9rem; }
.footer-title { color: white; font-weight: 600; margin-bottom: 1rem; font-size: 1.1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: #cbd5e1; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #1e293b; text-align: center; }
/* Blocco informazioni obbligatorie RUI/IVASS e OAM: contrasto AA su fondo #020617 */
.footer-legal { margin-top: 1rem; font-size: 0.8rem; color: #93a4b5; line-height: 1.5; }
.footer-legal + .footer-legal { margin-top: 0.75rem; }
.footer-legal strong.footer-legal-title { color: #cbd5e1; }
.footer-legal a { color: #7cb2f5; }

/* ===================== FAQ ACCORDION ===================== */
.faq-section { margin-top: 4rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-section h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 1.5rem; text-align: center; }
details.faq-item {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 1rem; overflow: hidden; transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
details.faq-item:hover { box-shadow: var(--shadow-sm); }
details.faq-item summary {
  padding: 1.2rem; font-weight: 600; color: var(--primary); cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; user-select: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+"; font-size: 1.5rem; color: var(--brand); transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item p {
  padding: 0 1.2rem 1.2rem; color: var(--text-main); line-height: 1.6; margin: 0;
  border-top: 1px solid #f0f4f8; padding-top: 1rem; margin-top: 0.5rem;
}

/* ===================== COOKIE BANNER ===================== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; padding: 1.5rem;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.1); z-index: 9999;
  display: flex; justify-content: center;
  transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-content {
  max-width: 1200px; width: 100%;
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
}
.cookie-content p { margin: 0; font-size: 0.9rem; color: var(--text-main); flex: 1; min-width: 300px; }
.cookie-buttons { display: flex; gap: 0.5rem; }

/* ===================== SCROLL TO TOP ===================== */
.scroll-top-btn {
  position: fixed; bottom: 5.5rem; right: 1.5rem;
  background: var(--brand); color: white; border: none; border-radius: 50%;
  width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000;
}
.scroll-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { background: var(--primary); transform: translateY(-3px) scale(1.05); }

/* ===================== RESPONSIVE ===================== */
/* Il menu orizzontale a cinque voci va in overflow gia' sotto i ~950px:
   sotto i 992px si passa al menu a scomparsa. */
@media (max-width: 992px) {
  .mobile-menu-btn { display: block; }
  .nav-menu {
    display: none; flex-direction: column; width: 100%; position: absolute;
    top: 100%; left: 0; background: white; border-bottom: 1px solid var(--border);
    padding: 1rem; box-shadow: var(--shadow-md); gap: 1rem;
  }
  .nav-menu.show { display: flex; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.25rem; }
  .form-row { flex-direction: column; gap: 0; }
  .section { padding: 3rem 0; }
}


/* ===================== ACCESSIBILITA': MOVIMENTO RIDOTTO ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn-primary:hover, .btn-accent:hover, .scroll-top-btn:hover { transform: none; }
}

/* ===================== SEGNAPOSTO MAPPA (consenso cookie) ===================== */
.map-placeholder {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  min-height: 300px; padding: 2rem 1.5rem; text-align: center;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid var(--border);
}
.map-placeholder p { color: var(--text-muted); font-size: 0.9rem; max-width: 42ch; margin: 0; }
.map-placeholder .map-fallback { font-size: 0.85rem; }
