/* =========================================================
   ImperPonti Confronto Investimenti — style.css
   Design style: monochrome_sophisticated (black/white/gray, high contrast, elegant type)
   Mobile-first • Only Flexbox • No CSS Grid/Columns
   Fonts: Trebuchet MS (display), Verdana (body)
   ========================================================= */

/* ---------------------------
   CSS Reset & Normalize
---------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }

/* ---------------------------
   Design Tokens (with fallbacks)
---------------------------- */
:root {
  --bg: #FFFFFF;
  --text: #111111;
  --muted: #6B6B6B;
  --ink: #0D0D0D;
  --surface: #F7F7F7;
  --surface-2: #EFEFEF;
  --border: #E6E6E6;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-strong: 0 10px 30px rgba(0,0,0,0.16);
  --brand-primary: #0B1F3A; /* deep navy (accent only) */
  --brand-secondary: #12A594; /* teal (focus/accessibility) */
  --brand-accent: #F6F8FC; /* very light gray-blue */
}

/* ---------------------------
   Base Typography & Layout
---------------------------- */
body {
  background: #FFFFFF; background: var(--bg);
  color: #111111; color: var(--text);
  font-family: Verdana, Segoe UI, Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  color: #0D0D0D; color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.35; }

p, li { color: #111111; color: var(--text); font-size: 16px; }
.subheadline { color: #333; color: var(--muted); font-size: 18px; }

strong { font-weight: 700; color: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mandatory spacing and alignment patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* ---------------------------
   Header & Navigation
---------------------------- */
header {
  position: sticky; top: 0; z-index: 100;
  background: #FFFFFF; background: var(--bg);
  border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid var(--border);
}
header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 28px; width: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a {
  padding: 8px 6px; border-radius: 4px; color: #111; color: var(--text);
  transition: color .2s ease, background-color .2s ease;
}
.main-nav a[aria-current="page"], .main-nav a:hover {
  background: #F1F1F1; background: var(--surface);
}

.header-cta { display: none; align-items: center; gap: 12px; }

/* Mobile menu controls */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: #111; color: #fff; transition: background .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: #000; transform: translateY(-1px); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.66);
  display: flex; justify-content: flex-end; align-items: stretch;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.mobile-menu .mobile-nav {
  width: 78%; max-width: 360px; height: 100%;
  background: #FFFFFF; background: var(--bg);
  border-left: 1px solid #E6E6E6; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; padding: 20px; transform: translateX(100%);
  transition: transform .35s ease;
}
.mobile-menu .mobile-nav a {
  padding: 14px 10px; border-radius: 6px; color: #0D0D0D; color: var(--ink);
}
.mobile-menu .mobile-nav a:hover { background: #F3F3F3; background: var(--surface); }
.mobile-menu .mobile-menu-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 8px;
  background: #111; color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
/* Open states supported */
.mobile-menu.open, .mobile-menu.is-open, body.menu-open .mobile-menu { opacity: 1; pointer-events: auto; }
.mobile-menu.open .mobile-nav, .mobile-menu.is-open .mobile-nav, body.menu-open .mobile-menu .mobile-nav { transform: translateX(0); }

/* Desktop nav visibility */
@media (min-width: 768px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* ---------------------------
   Hero Sections
---------------------------- */
.hero {
  background: #0F1113; /* deep near-black for dramatic contrast */
  color: #FFFFFF;
}
.hero .content-wrapper { padding: 40px 0; }
.hero h1 { color: #FFFFFF; font-size: 32px; }
.hero .subheadline { color: #D6D6D6; }
.hero .cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* Breadcrumbs */
[aria-label="breadcrumb"] { display: flex; flex-wrap: wrap; gap: 8px; color: #BBBBBB; font-size: 14px; }
[aria-label="breadcrumb"] span { opacity: .9; }

/* ---------------------------
   Buttons
---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px; border-radius: 8px; font-weight: 600; letter-spacing: .2px;
  border: 1px solid transparent; transition: all .2s ease, transform .08s ease;
}
.btn:focus-visible { outline: 3px solid #12A594; outline: 3px solid var(--brand-secondary); outline-offset: 2px; }
.btn.primary {
  background: #111111; color: #FFFFFF; box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.btn.primary:hover { background: #000000; transform: translateY(-1px); }
.btn.secondary {
  background: #FFFFFF; color: #111; border-color: #111; box-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.btn.secondary:hover { background: #111; color: #FFFFFF; }
.btn.link {
  padding: 8px 0; background: transparent; color: #111; border: none; border-bottom: 1px solid #111;
}
.btn.link:hover { color: #000; border-bottom-color: #000; }

/* ---------------------------
   Utilities & Elements
---------------------------- */
.text-section {
  background: #FFFFFF; border: 1px solid #E6E6E6; border: 1px solid var(--border);
  padding: 18px; border-radius: 10px; box-shadow: var(--shadow);
}
.text-section h3 { margin-bottom: 6px; }

.feature-grid, .filters, .platform-cards, .review-list, .category-grid {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch;
}
.feature-grid .text-section,
.filters .text-section,
.platform-cards .text-section,
.review-list .text-section,
.category-grid .text-section { flex: 1 1 260px; }

.proof-points, .preview-filtri, .rating-overview, .cta-inline, .note { color: #333; color: var(--muted); }
.disclaimer { font-size: 14px; color: #555; }

.kpi-stats ul, .trust-badges ul { display: flex; flex-wrap: wrap; gap: 14px; }
.kpi-stats li, .trust-badges li {
  display: flex; align-items: center; gap: 10px; background: #FFFFFF; border: 1px solid #E6E6E6;
  padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow);
}
.kpi-stats li strong { font-size: 24px; }
.trust-badges img { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid #DCDCDC; background: #FAFAFA; color: #111; width: fit-content; }
.badge img { width: 16px; height: 16px; }

.search-lite {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 10px; border: 1px solid #E6E6E6; background: #F7F7F7;
}

/* Stepper / Timeline */
.stepper, .timeline { display: flex; flex-wrap: wrap; gap: 12px; }
.stepper li, .timeline li {
  flex: 1 1 220px; background: #FFFFFF; border: 1px solid #E6E6E6; border-radius: 10px; padding: 14px; box-shadow: var(--shadow);
}

/* Pills */
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; 
  border: 1px solid #CFCFCF; background: #F5F5F5; color: #111; }

/* ---------------------------
   Tables (Confronto)
---------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
thead th {
  background: #111; color: #fff; text-align: left; padding: 12px 10px; font-weight: 700; position: sticky; top: 0;
}
tbody td { padding: 12px 10px; border-bottom: 1px solid #E6E6E6; }
tbody tr:nth-child(odd) { background: #FAFAFA; }
tbody a { color: #111; text-decoration: underline; }

/* ---------------------------
   Testimonials (light background, dark text for readability)
---------------------------- */
.testimonial-list { display: flex; flex-wrap: wrap; gap: 20px; }
.testimonial-card {
  background: #FFFFFF; border: 1px solid #E6E6E6; border-radius: 12px; box-shadow: var(--shadow);
  color: #111; max-width: 560px; flex: 1 1 280px;
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: #333; margin-top: 6px; }

/* ---------------------------
   CTA Final Sections
---------------------------- */
.cta-final {
  background: #111111; color: #FFFFFF;
}
.cta-final h2 { color: #FFFFFF; }
.cta-final .cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------
   Footer
---------------------------- */
footer { background: #0E0E0E; color: #EAEAEA; margin-top: 60px; }
footer .content-wrapper {
  display: flex; flex-wrap: wrap; gap: 24px; padding: 32px 0;
}
footer h3 { color: #FFFFFF; font-size: 16px; margin-bottom: 8px; }
footer nav { display: flex; flex-direction: column; gap: 6px; }
footer a { color: #EAEAEA; }
footer a:hover { color: #FFFFFF; text-decoration: underline; }
footer .contact-info p, footer .contact-info a { display: inline-flex; align-items: center; gap: 8px; }
footer img { width: 16px; height: 16px; }

/* ---------------------------
   Links, States & Focus
---------------------------- */
a, button { transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
a:focus-visible, button:focus-visible { outline: 3px solid #12A594; outline: 3px solid var(--brand-secondary); outline-offset: 2px; }

/* ---------------------------
   Layout helpers for sections
---------------------------- */
main > section { padding: 32px 0; border-bottom: 1px solid #F0F0F0; }
main > section:last-of-type { border-bottom: none; }

/* Text-image responsive alignment */
.text-image-section { align-items: center; }
@media (max-width: 768px) { .text-image-section { flex-direction: column; } }

/* Align content blocks */
.quick-links, .newsletter-signup, .contact-info, .legal-links, .social-links {
  flex: 1 1 220px; min-width: 220px; background: transparent; border: none; padding: 0;
}

/* ---------------------------
   Mobile Responsiveness
---------------------------- */
@media (min-width: 992px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 18px; }
  .hero .content-wrapper { padding: 56px 0; }
}

/* ---------------------------
   Breadcrumb subtle divider
---------------------------- */
[aria-label="breadcrumb"] span + span::before { content: "›"; margin: 0 8px; color: #888; }

/* ---------------------------
   Cards hover micro-interaction
---------------------------- */
.text-section:hover, .testimonial-card:hover, .stepper li:hover, .timeline li:hover {
  box-shadow: var(--shadow-strong); transform: translateY(-2px);
}
.text-section, .testimonial-card, .stepper li, .timeline li { transition: box-shadow .25s ease, transform .2s ease; }

/* ---------------------------
   Header states and active links
---------------------------- */
.main-nav a[aria-current="page"] { color: #0B1F3A; color: var(--brand-primary); font-weight: 700; }

/* ---------------------------
   Accessibility tweaks
---------------------------- */
::selection { background: #111; color: #fff; }

/* ---------------------------
   Cookie Consent Banner
---------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  background: #FFFFFF; color: #111; border-top: 1px solid #E6E6E6; box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px;
  transform: translateY(110%); opacity: 0; transition: transform .35s ease, opacity .35s ease;
}
.cookie-banner.show { transform: translateY(0); opacity: 1; }
.cookie-banner .cookie-text { flex: 1 1 240px; font-size: 14px; color: #333; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-btn { padding: 10px 14px; border-radius: 8px; border: 1px solid #111; background: #fff; color: #111; font-weight: 600; }
.cookie-btn:hover { background: #111; color: #fff; }
.cookie-btn.primary { background: #111; color: #fff; border-color: #111; }
.cookie-btn.primary:hover { background: #000; }
.cookie-btn.ghost { border-color: #CFCFCF; }

/* Cookie Preferences Modal */
.cookie-modal-backdrop {
  position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.cookie-modal-backdrop.open { opacity: 1; pointer-events: auto; }

.cookie-modal {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 1201; width: 100%; max-width: 520px;
  background: #FFFFFF; border-left: 1px solid #E6E6E6; display: flex; flex-direction: column; gap: 16px;
  padding: 20px; transform: translateX(100%); transition: transform .35s ease;
}
.cookie-modal.open { transform: translateX(0); }
.cookie-modal h3 { margin-bottom: 6px; }
.cookie-category { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #EFEFEF; }
.cookie-toggle { width: 42px; height: 26px; border-radius: 999px; background: #DADADA; position: relative; transition: background .2s ease; }
.cookie-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform .2s ease; }
.cookie-toggle.on { background: #111; }
.cookie-toggle.on::after { transform: translateX(16px); }
.cookie-actions-footer { margin-top: auto; display: flex; gap: 10px; }

/* ---------------------------
   Page-specific fine tuning
---------------------------- */
/* Index highlights */
.hero .kpi-stats ul { gap: 10px; }
.hero .kpi-stats li { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); color: #EEE; }
.hero .kpi-stats li strong { color: #fff; }
.hero .trust-badges li { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); color: #EDEDED; }
.hero .search-lite { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); color: #EDEDED; }
.hero .search-lite .btn.link { color: #FFFFFF; border-bottom-color: #FFFFFF; }

/* Confronto page */
.filters .text-section p, .platform-cards .text-section p { color: #333; }

/* Recensioni page */
.review-list .text-section a { color: #111; text-decoration: underline; }

/* Guide page */
.category-grid .text-section { background: #FFFFFF; }

/* Chi siamo */
.badge + .testimonial-list { margin-top: 10px; }

/* Contatti */
[aria-current="page"] { font-weight: 700; }

/* Legal pages hero contrast */
.hero + section .content-wrapper h2 { margin-top: 4px; }

/* ---------------------------
   Forms and Inputs (generic)
---------------------------- */
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  background: #FFFFFF; border: 1px solid #DADADA; border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,0.08); }

/* ---------------------------
   Gaps and spacing utilities
---------------------------- */
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-20 { margin-top: 20px; } .mb-20 { margin-bottom: 20px; } .mb-40 { margin-bottom: 40px; }

/* ---------------------------
   Print basics
---------------------------- */
@media print {
  header, .mobile-menu-toggle, .cookie-banner, .cookie-modal, footer { display: none !important; }
  a { text-decoration: underline; }
}

/* ---------------------------
   Safety: ensure flex for custom layout containers
---------------------------- */
.quick-links, .newsletter-signup, .contact-info, .legal-links, .social-links, .cta-group, .rating-overview, .proof-points, .preview-filtri, .cta-inline {
  display: flex; flex-direction: column; gap: 10px;
}

/* Ensure no overlapping and consistent spacing between blocks */
.content-wrapper > * { margin: 0; }
.content-wrapper > * + * { margin-top: 6px; }

/* --------------- End --------------- */
