/* ============================================================
   TariffUp.it — Global Stylesheet
   Struttura/layout: porting 1:1 da amicoenergia.it
   Font: Poppins (come amicoenergia.it)
   Colore primario: #4e9974 (verde salvia — identità già assegnata a TariffUp)
   Colore secondario: #c8892a (amber — CTA)
   Testo: #0f1923 (ink navy — coerente col logo/favicon TariffUp)
   ============================================================ */

:root {
  --yellow:       #4e9974;   /* era il giallo amico → verde salvia TariffUp */
  --yellow-dark:  #3d7a5e;
  --yellow-light: #e8f4ef;
  --light-blue:   #EEECFF;
  --orange:       #c8892a;   /* era l'arancio amico → amber TariffUp (CTA) */
  --orange-dark:  #b5791f;
  --black:        #0f1923;   /* ink navy, come da logo/favicon TariffUp */
  --text:         #0f1923;
  --text-light:   #45535f;
  --white:        #ffffff;
  --off-white:    #f8fafc;
  --gray-light:   #e5e7eb;
  --gray:         #6b7280;
  --shadow-y:     0 4px 20px rgba(78,153,116,0.25);
  --shadow-o:     0 4px 20px rgba(200,137,42,0.25);
  --radius:       10px;
  --radius-lg:    18px;
  --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.3rem); }

.container  { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.text-center { text-align: center; }
.bg-off-white { background: var(--off-white); }
.bg-yellow-soft { background: var(--yellow-light); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px;
  font-weight: 700; font-size: 0.95rem; font-family: inherit;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: var(--shadow-o); }
.btn-yellow { background: var(--yellow); color: #fff; }
.btn-yellow:hover { background: var(--yellow-dark); transform: translateY(-1px); box-shadow: var(--shadow-y); }
.btn-outline { background: transparent; color: var(--orange); border: 2px solid var(--orange); }
.btn-outline:hover { background: var(--orange); color: #fff; }
.btn-white { background: #fff; color: var(--black); }
.btn-white:hover { background: var(--off-white); }

/* HEADER */
#site-header {
  position: sticky; top: -88px; z-index: 1000;
  background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.topbar { background: var(--black); color: rgba(255,255,255,.55); font-size:.7rem; letter-spacing:.8px; text-transform:uppercase; padding:.45rem 5%; display:flex; justify-content:space-between; align-items:center; }
.topbar strong { color: var(--orange); }
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px; height: 88px;
}
.header-logo img { height: 56px; width: auto; display: block; }

.nav-menu { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block; padding: 8px 14px;
  font-weight: 600; font-size: 0.87rem; color: var(--text);
  border-radius: 6px; transition: var(--transition); white-space: nowrap;
}
.nav-menu > li > a:hover { color: var(--yellow-dark); background: var(--yellow-light); }

.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid var(--gray-light);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 220px; padding: 8px 0; list-style: none; z-index: 200;
}
.nav-menu > li > a::after {
  content: ''; position: absolute;
  top: 100%; left: 0; width: 100%; height: 10px;
}
.nav-menu > li:hover .nav-dropdown { display: block; }
.nav-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; font-size: 0.87rem; font-weight: 500;
  color: var(--text); transition: var(--transition);
}
.nav-dropdown a:hover { background: var(--yellow-light); color: var(--yellow-dark); }
.nav-dropdown a img { width: 20px; height: 20px; flex-shrink: 0; }

/* Dropdown "ricco" (icona + titolo + sottotitolo) — es. Prezzi e Tariffe */
.nav-dropdown-rich { min-width: 260px; padding: 10px; }
.nav-dropdown-rich a { align-items: flex-start; padding: 10px 10px; border-radius: 8px; }
.nav-dropdown-rich a:hover { background: var(--yellow-light); }
.ndr-icon { width: 26px; height: 26px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.ndr-icon img { width: 22px; height: 22px; object-fit: contain; }
.ndr-text { display: flex; flex-direction: column; gap: 2px; }
.ndr-text strong { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.ndr-text span { font-size: 0.78rem; font-weight: 400; color: var(--gray); }

/* Fascia alta (logo + telefono) e barra menu */
.header-top { background: #fff; }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-nav-bar { background: var(--black); }
.header-nav-bar .nav-menu { gap: 2px; }
.header-nav-bar .nav-menu > li > a { color: #fff; padding: 14px 16px; border-radius: 0; font-size: 0.9rem; white-space: nowrap; }
.header-nav-bar .nav-menu > li > a:hover { background: rgba(255,255,255,.12); color: #fff; }
.header-phone { display: flex; align-items: center; gap: 12px; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.hp-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); color: #fff; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.hp-icon svg { width: 20px; height: 20px; }
.hp-text { display: flex; flex-direction: column; line-height: 1.15; }
.hp-label { font-size: 0.72rem; font-weight: 500; color: var(--gray); }
.hp-num { font-size: 1.3rem; font-weight: 800; letter-spacing: .2px; }
.header-phone:hover .hp-icon { background: var(--yellow-dark); }


.hamburger {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--yellow); border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 10px;
}
.hamburger span { display: block; width: 22px; height: 2.5px; background: #fff; border-radius: 2px; transition: var(--transition); }

@media (max-width: 960px) {
  #site-header { top: 0; }
  .hamburger { display: flex; }
  .header-nav-bar { display: none; }
  .header-inner { height: 68px; }
  .header-logo img { height: 44px; }
  .hp-label { display: none; }
  .hp-icon { width: 36px; height: 36px; }
  .hp-num { font-size: 1rem; }
}

/* FOOTER */
#site-footer { background: var(--black); color: rgba(255,255,255,0.8); padding: 56px 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px;
}
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { height: 34px; margin-bottom: 16px; background: #fff; padding: 8px 14px; border-radius: 8px; display: inline-block; }
.footer-info p { font-size: 0.85rem; line-height: 1.7; margin-bottom: 2px; color: rgba(255,255,255,.55); }
.footer-info a { color: rgba(255,255,255,0.7); }
.footer-info a:hover { color: #fff; }
.footer-col h4 {
  color: var(--yellow); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li+li { margin-top: 8px; }
.footer-col ul a { font-size: 0.85rem; color: rgba(255,255,255,0.55); transition: var(--transition); }
.footer-col ul a:hover { color: #fff; padding-left: 4px; }
.footer-diritti-link { color: var(--yellow) !important; font-weight: 600; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding: 18px 0 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  font-size: 0.72rem; color: rgba(255,255,255,0.35);
}
@media (max-width: 700px) { .footer-bottom { flex-direction: column; align-items: flex-start; } }

/* STICKY WIDGET */
#sticky-widget { position: fixed; bottom: 24px; right: 24px; z-index: 500; }
.sticky-trigger, .sticky-toggle {
  display: flex; align-items: center; gap: 10px;
  background: var(--orange); color: #fff;
  padding: 13px 20px; border-radius: 50px;
  font-weight: 700; font-size: 0.88rem;
  box-shadow: 0 4px 24px rgba(200,137,42,0.4);
  cursor: pointer; border: none; transition: var(--transition); font-family: inherit;
}
.sticky-trigger:hover, .sticky-toggle:hover { background: var(--orange-dark); transform: translateY(-2px); }
.sticky-trigger svg, .sticky-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.sticky-chevron { transition: transform 0.3s; }
#sticky-widget.open .sticky-chevron { transform: rotate(180deg); }
.sticky-popup {
  display: none; position: fixed; bottom: 80px; right: 24px; top: 80px;
  width: 340px; max-height: calc(100vh - 160px);
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  flex-direction: column; z-index: 499; overflow: hidden;
}
.sticky-popup.open { display: flex; }
.sticky-header {
  background: var(--orange); color: #fff; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0; font-size: 0.9rem; font-weight: 700;
}
.sticky-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 0; margin-left: 10px; flex-shrink: 0; }
.sticky-form { padding: 16px; overflow-y: auto; flex: 1; }
.sticky-form .form-group { margin-bottom: 10px; }
.sticky-form input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--gray-light);
  border-radius: 8px; font-size: 0.88rem; font-family: inherit; transition: var(--transition); box-sizing: border-box;
}
.sticky-form input:focus { outline: none; border-color: var(--orange); }
.sticky-consensi { background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 10px; padding: 10px 12px; margin: 10px 0 12px; }
.sticky-form .form-check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: 0.73rem; color: var(--gray); line-height: 1.5; }
.sticky-form .form-check input[type=checkbox] { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; accent-color: var(--orange); }
.sticky-form .form-check span { flex: 1; min-width: 0; word-wrap: break-word; }
.sticky-form .btn { width: 100%; justify-content: center; font-size: 0.88rem; padding: 11px; margin-top: 4px; }
@media (max-width: 480px) {
  .sticky-popup { width: calc(100vw - 32px); right: 16px; bottom: 72px; max-height: calc(100vh - 90px); }
}

/* PAGE HERO (pagine interne) */
.page-hero {
  background: var(--yellow);
  color: #fff; padding: 64px 0 72px;
}
.page-hero h1 { margin-bottom: 12px; }
.page-hero p { font-size: 1.05rem; opacity: 0.9; max-width: 580px; }

/* SECTION TITLE */
.section-title { margin-bottom: 44px; }
.section-title h2 { margin-bottom: 8px; }
.section-title p { font-size: 1rem; color: var(--text-light); max-width: 560px; }
.section-title.center { text-align: center; }
.section-title.center p { margin: 0 auto; }
.divider { width: 52px; height: 4px; background: var(--yellow); border-radius: 2px; margin: 10px 0 18px; }
.section-title.center .divider { margin: 10px auto 18px; }

/* CARD */
.card { background: #fff; border: 1px solid var(--gray-light); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-y); transform: translateY(-2px); }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--gray-light);
  border-radius: 8px; font-size: 0.95rem; font-family: inherit; color: var(--text); transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(200,137,42,0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; font-size: 0.82rem; color: var(--gray); }
.form-check input[type=checkbox] { flex-shrink: 0; margin-top: 2px; accent-color: var(--orange); }
.form-check a { color: var(--orange); text-decoration: underline; }

/* NEWS CARDS */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.news-card { border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 1px solid var(--gray-light); transition: var(--transition); display: block; }
.news-card:hover { box-shadow: var(--shadow-y); transform: translateY(-3px); }
.news-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--gray-light); }
.news-card-body { padding: 20px; }
.news-card-date { font-size: 0.78rem; color: var(--gray); margin-bottom: 6px; }
.news-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); line-height: 1.35; }
.news-card-excerpt { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; margin-bottom: 14px; }
.news-card-link { font-size: 0.85rem; font-weight: 700; color: var(--orange); }

/* REVIEWS */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.review-card { background: #fff; border: 1px solid var(--gray-light); border-radius: var(--radius-lg); padding: 22px; transition: var(--transition); }
.review-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.review-stars { color: #f9a825; font-size: 1.1rem; margin-bottom: 8px; }
.review-text { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; margin-bottom: 10px; font-style: italic; }
.review-author { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.review-ago { font-size: 0.75rem; color: var(--gray); }

/* AWARDS / TRUST STRIP */
.awards-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.award-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 150px; text-align: center; padding: 18px 10px;
  border-radius: var(--radius); background: var(--off-white);
  font-size: 0.75rem; color: var(--gray); line-height: 1.4;
}
.award-item img { width: 72px; height: 72px; object-fit: contain; }
.award-year { font-size: 0.68rem; font-weight: 700; color: var(--orange); letter-spacing: 1px; text-transform: uppercase; }

/* ANIMATIONS */
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px);} to{opacity:1;transform:translateY(0);} }
.fade-in { animation: fadeInUp 0.5s ease forwards; }
@media (max-width: 480px) { .hp-text { display: none; } .header-right { gap: 10px; } }

/* Pulsante Accedi (area riservata) */
.header-login { display: inline-flex; align-items: center; padding: 9px 20px; border: 2px solid var(--yellow); border-radius: 50px; font-weight: 700; font-size: 0.88rem; color: var(--yellow-dark); background: #fff; transition: var(--transition); white-space: nowrap; }
.header-login:hover { background: var(--yellow); color: #fff; }
@media (max-width: 640px) { .header-login { display: none; } }
