/* ════════════════════════════════════════════════════════════════
   ICCOM Energia — Shared Design System  v1.0.0
   Extends: ICCOM Platform portal-shared.css

   Load order:
     1. This file (all tokens + all components)
   ════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Nunito+Sans:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* ICCOM Brandbook 2026 — Core Palette */
  --navy:           #13263F;
  --navy-light:     #1E3A5F;
  --navy-dark:      #0C1A2E;
  --blue:           #299BD5;
  --iccom-blue:     #299BD5;
  --iccom-blue-light: #E3F2FD;

  /* Energia accent — green used for SECONDARY highlights only */
  --energia:        #27AE60;
  --energia-light:  #D1FAE5;
  --green:          #27AE60;
  --green-light:    #D1FAE5;

  /* Semantic / UI */
  --red:            #E74C3C;
  --red-light:      #FEE2E2;
  --orange:         #F39C12;
  --orange-light:   #FEF3C7;
  --purple:         #8E44AD;
  --purple-light:   #E0E7FF;

  /* Neutrals */
  --white:          #FFFFFF;
  --light:          #F4F7FA;
  --border:         #E0E6ED;
  --mid:            #7F8C8D;
  --dark:           #2C3E50;

  /* Elevation */
  --shadow:         0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl:      0 16px 48px rgba(0,0,0,0.16);

  /* Radii */
  --radius:         6px;
  --radius-lg:      10px;
  --radius-xl:      16px;

  /* Typography */
  --font:           'Nunito Sans', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:   'Quicksand', 'Nunito Sans', sans-serif;
  --font-mono:      'JetBrains Mono', 'Menlo', 'Courier New', ui-monospace, monospace;

  /* Motion */
  --transition:     0.2s ease;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html   { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body   { font-family: var(--font); color: var(--dark); line-height: 1.6; background: var(--white); }
img    { max-width: 100%; height: auto; display: block; }
a      { color: inherit; }
button { font-family: var(--font); }

/* ── Skip link (a11y) ──────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--blue); color: var(--white);
  padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700; font-size: 14px; z-index: 10000;
  text-decoration: none; transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ── Focus styles (a11y) ───────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px;
}

/* ── Layout ────────────────────────────────────────────────────── */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px;  margin: 0 auto; padding: 0 24px; }
.section      { padding: 64px 0; }
.section-alt  { background: var(--light); }

.section-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--navy); text-align: center; margin-bottom: 12px;
}
.section-subtitle {
  font-size: 16px; color: var(--mid); text-align: center;
  max-width: 700px; margin: 0 auto 48px;
}

/* ══════════════════════════════════════════════════════════════
   SITE HEADER
   ══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.site-header__back {
  font-size: 12px; font-weight: 600; color: #8BA5BE;
  text-decoration: none; white-space: nowrap;
  transition: color var(--transition);
}
.site-header__back:hover { color: var(--white); }

.site-header__logo {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--white); text-decoration: none; white-space: nowrap;
  letter-spacing: 0.3px;
}
.site-header__logo span { color: var(--energia); }

.site-header__nav {
  display: flex; gap: 4px; align-items: center;
  margin-left: auto;
}
.site-header__nav a {
  font-size: 13px; font-weight: 600; color: #B0C4D8;
  text-decoration: none; padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.site-header__nav a:hover { color: var(--white); background: rgba(255,255,255,0.08); }

/* Hamburger (mobile) */
.site-header__hamburger {
  display: none; background: none; border: none;
  color: var(--white); font-size: 22px; cursor: pointer;
  padding: 4px; margin-left: auto;
}

@media (max-width: 900px) {
  .site-header__nav { display: none; }
  .site-header__nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--navy); padding: 8px 0 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }
  .site-header__nav.open a { padding: 12px 24px; border-radius: 0; }
  .site-header__hamburger { display: block; }
  .site-header__inner { position: relative; }
  /* CTA button hidden on mobile nav */
  .site-header__inner > .btn { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   SITE FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  color: #B0C4D8;
  padding: 48px 0 32px;
  margin-top: auto;
}

.site-footer__links {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin-bottom: 24px;
}
.site-footer__links a {
  font-size: 13px; font-weight: 600; color: #B0C4D8;
  text-decoration: none; transition: color var(--transition);
}
.site-footer__links a:hover { color: var(--white); }

.site-footer p {
  font-size: 12px; color: #6B86A0;
  line-height: 1.7;
}
.site-footer p + p { margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1a3a2a 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600'%3E%3Cdefs%3E%3Cpattern id='dots' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%23ffffff' opacity='0.06'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='1200' height='600' fill='url(%23dots)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: rgba(39,174,96,0.2); color: #6EE7A0;
  border: 1px solid rgba(39,174,96,0.3);
  padding: 6px 16px; border-radius: 100px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700; line-height: 1.15;
  margin-bottom: 16px; letter-spacing: -0.5px;
}

.hero p {
  font-size: 18px; color: #C0D4E8;
  margin-bottom: 32px; line-height: 1.7;
}

.hero-ctas {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero { padding: 56px 0; }
  .hero p { font-size: 16px; }
  .hero-ctas { flex-direction: column; align-items: center; }
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn, .iccom-btn {
  display: inline-block; padding: 12px 24px;
  border-radius: var(--radius); font-weight: 700; font-size: 14px;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: all var(--transition); text-align: center; line-height: 1.4;
  font-family: var(--font); white-space: nowrap;
}

/* Primary — ALWAYS blue, never green */
.btn-primary, .iccom-btn.btn-primary {
  background: var(--blue); color: var(--white); border-color: var(--blue);
}
.btn-primary:hover {
  background: #1d87c0; border-color: #1d87c0; transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(41,155,213,0.3);
}

.btn-secondary {
  background: var(--light); color: var(--navy); border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent; color: var(--blue); border-color: var(--blue);
}
.btn-ghost:hover { background: var(--blue); color: var(--white); }

.btn-ghost-white {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6);
}
.btn-ghost-white:hover { background: var(--white); color: var(--navy); }

.btn-danger {
  background: var(--red); color: var(--white); border-color: var(--red);
}
.btn-danger:hover { background: #c0392b; border-color: #c0392b; }

/* Energia accent button — only for non-primary secondary actions */
.btn-energia {
  background: var(--energia); color: var(--white); border-color: var(--energia);
}
.btn-energia:hover { background: #1e8449; border-color: #1e8449; }

.btn-sm  { padding: 7px 14px;  font-size: 12px; }
.btn-lg  { padding: 14px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

.btn:disabled, button:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card, .iccom-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-accent { border-top: 3px solid var(--blue); }
.card-accent-energia { border-top: 3px solid var(--energia); }
.card-lg { padding: 32px; }

.card-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--iccom-blue-light); display: flex;
  align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ══════════════════════════════════════════════════════════════
   PRICING CARDS
   ══════════════════════════════════════════════════════════════ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

.price-card {
  background: var(--white); border-radius: var(--radius-xl);
  border: 2px solid var(--border); padding: 32px;
  position: relative; transition: all var(--transition);
}
.price-card:hover {
  border-color: var(--blue); box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.price-card.featured {
  border-color: var(--blue);
  box-shadow: 0 12px 32px rgba(41,155,213,0.2);
  transform: scale(1.02);
}

.price-badge {
  position: absolute; top: -14px; left: 24px;
  background: var(--blue); color: var(--white);
  padding: 5px 14px; border-radius: 100px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}

.price-header { margin-bottom: 20px; }
.price-header h3 {
  font-family: var(--font-display); font-size: 20px;
  font-weight: 700; color: var(--navy); margin-bottom: 4px;
}

.price-amount {
  font-size: 36px; font-weight: 800; color: var(--navy);
  line-height: 1;
}
.price-amount small { font-size: 14px; font-weight: 500; color: var(--mid); }
.price-period { font-size: 13px; color: var(--mid); margin-top: 4px; }

.price-body { padding-top: 20px; border-top: 1px solid var(--border); }

.price-feature {
  font-size: 14px; color: var(--dark);
  padding: 8px 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.price-feature:last-child { border-bottom: none; }
.price-feature::before {
  content: '✓'; color: var(--energia); font-weight: 700;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   CHECKOUT STEPS
   ══════════════════════════════════════════════════════════════ */
.checkout-steps {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 40px;
  position: relative;
}
.checkout-steps::before {
  content: '';
  position: absolute; top: 24px; left: 0; right: 0;
  height: 2px; background: var(--border); z-index: 0;
}

.checkout-step {
  display: flex; flex-direction: column;
  align-items: center; flex: 1; position: relative; z-index: 1;
}

.step-number {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--light); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--mid);
  margin-bottom: 8px; transition: all var(--transition);
}

.step-label {
  font-size: 12px; font-weight: 600; color: var(--mid); text-align: center;
}

.checkout-step.active .step-number {
  background: var(--blue); border-color: var(--blue); color: var(--white);
}
.checkout-step.active .step-label { color: var(--navy); font-weight: 700; }

.checkout-step.completed .step-number {
  background: var(--energia); border-color: var(--energia); color: var(--white);
}
.checkout-step.completed .step-label { color: var(--dark); }

@media (max-width: 600px) {
  .checkout-steps { gap: 8px; }
  .step-number { width: 36px; height: 36px; font-size: 13px; }
  .step-label { font-size: 10px; }
}

/* ══════════════════════════════════════════════════════════════
   FAQ ACCORDION
   ══════════════════════════════════════════════════════════════ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.faq-item:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.faq-question {
  padding: 18px 20px; font-weight: 600; color: var(--navy);
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; user-select: none;
}
.faq-question::after {
  content: '+';
  width: 24px; height: 24px; flex-shrink: 0;
  background: var(--blue); color: var(--white);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; font-weight: 700;
  transition: transform var(--transition);
  line-height: 1;
  padding-top: 1px;
}
details[open] .faq-question::after {
  content: '−'; transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 18px; color: var(--mid);
  font-size: 15px; line-height: 1.8;
  border-top: 1px solid rgba(41,155,213,0.15);
}
.faq-answer p + p { margin-top: 8px; }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group   { margin-bottom: 16px; }
.form-label   {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--navy); margin-bottom: 6px;
}

.form-input {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color var(--transition); background: var(--white); color: var(--dark);
}
.form-input:focus       { border-color: var(--blue); }
.form-input.error       { border-color: var(--red); }
.form-input::placeholder { color: #9CA3AF; }

.form-select {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color var(--transition); background: var(--white); color: var(--dark);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23555' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-size: 16px; padding-right: 36px;
}
.form-select:focus { border-color: var(--blue); }

textarea.form-input { resize: vertical; min-height: 100px; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; display: none; }
.form-error.visible { display: block; }

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

/* Dark form variant */
.form-dark .form-input,
.form-dark .form-select {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: var(--white);
}
.form-dark .form-input::placeholder { color: #8899AA; }
.form-dark .form-input:focus,
.form-dark .form-select:focus  { border-color: var(--blue); }
.form-dark .form-label        { color: #B0C4D8; }

/* Checkbox */
.checkbox-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.checkbox-group input[type="checkbox"] { margin-top: 3px; cursor: pointer; width: 16px; height: 16px; flex-shrink: 0; }
.checkbox-group label { font-size: 13px; color: var(--mid); cursor: pointer; }
.checkbox-group a { color: var(--blue); text-decoration: none; }
.checkbox-group a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-critical { background: var(--red-light);    color: #991B1B; }
.badge-high     { background: var(--orange-light);  color: #92400E; }
.badge-medium   { background: var(--iccom-blue-light); color: #1E40AF; }
.badge-low      { background: var(--green-light);   color: #065F46; }
.badge-ok       { background: var(--green-light);   color: #065F46; }
.badge-info     { background: var(--purple-light);  color: #3730A3; }

/* Bill / practice status badges */
.badge.pagata     { background: #D1FAE5; color: #166534; }
.badge.emessa     { background: #DBEAFE; color: #1E40AF; }
.badge.scaduta    { background: var(--red-light); color: #991B1B; }
.badge.annullata  { background: #F3F4F6; color: #4B5563; }
.badge.creata     { background: #F3F4F6; color: #4B5563; }
.badge.inviata    { background: #DBEAFE; color: #1E40AF; }
.badge.inlavorazione { background: var(--orange-light); color: #92400E; }
.badge.completata { background: #D1FAE5; color: #166534; }
.badge.rifiutata  { background: var(--red-light); color: #991B1B; }
.badge.active     { background: #D1FAE5; color: #166534; }
.badge.pending    { background: var(--orange-light); color: #92400E; }
.badge.error      { background: var(--red-light); color: #991B1B; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; border-left: 4px solid transparent;
  margin-bottom: 12px;
}
.alert-error   { background: var(--red-light);    border-color: var(--red);    color: #7F1D1D; }
.alert-success { background: var(--green-light);  border-color: var(--energia); color: #064E3B; }
.alert-info    { background: var(--iccom-blue-light); border-color: var(--blue); color: #1E3A5F; }
.alert-warning { background: var(--orange-light); border-color: var(--orange); color: #78350F; }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table            { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th         { background: var(--navy); color: var(--white); padding: 10px 14px; text-align: left; font-weight: 600; white-space: nowrap; }
.table td         { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--dark); }
.table tr:hover   { background: var(--light); }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin: 20px 0;
}
.kpi-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; text-align: center;
  border-top: 4px solid var(--blue); box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.kpi-val   { font-size: 32px; font-weight: 800; color: var(--navy); }
.kpi-label { font-size: 12px; color: var(--mid); margin-top: 4px; }
.kpi-sub   { font-size: 12px; color: var(--mid); margin-top: 2px; }
.kpi-card.danger  .kpi-val { color: var(--red); }
.kpi-card.danger           { border-top-color: var(--red); }
.kpi-card.warning .kpi-val { color: var(--orange); }
.kpi-card.warning          { border-top-color: var(--orange); }
.kpi-card.success .kpi-val { color: var(--energia); }
.kpi-card.success          { border-top-color: var(--energia); }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   ══════════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid; gap: 24px;
}

.dashboard-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.dashboard-card-title {
  font-size: 16px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.dashboard-card-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 20px; background: var(--blue); border-radius: 2px;
}

/* Filter bar */
.filter-bar {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 24px;
}
.filter-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; align-items: flex-end;
}

/* ══════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════ */
.timeline { position: relative; padding: 16px 0 0 40px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: ''; position: absolute;
  left: -35px; top: 2px;
  width: 14px; height: 14px;
  background: var(--blue); border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--blue);
}
.timeline-item.completed::before { background: var(--energia); box-shadow: 0 0 0 2px var(--energia); }
.timeline-item.pending::before   { background: #D1D5DB; box-shadow: 0 0 0 2px #D1D5DB; }
.timeline-item.rejected::before  { background: var(--red); box-shadow: 0 0 0 2px var(--red); }

.timeline-dot  { /* alias */ }
.timeline-content .timeline-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.timeline-content .timeline-date  { font-size: 12px; color: var(--mid); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   UPLOAD AREA
   ══════════════════════════════════════════════════════════════ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px; text-align: center;
  background: var(--light); cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 12px;
}
.upload-area:hover {
  border-color: var(--blue); background: rgba(41,155,213,0.04);
}
.upload-area-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area-text { color: var(--mid); font-size: 14px; font-weight: 500; }
.upload-area-sub  { color: #9CA3AF; font-size: 12px; margin-top: 4px; }

.file-list { display: grid; gap: 8px; margin-bottom: 16px; }
.file-item {
  background: var(--light); padding: 12px 16px;
  border-radius: var(--radius); display: flex;
  justify-content: space-between; align-items: center;
}
.file-name   { font-weight: 600; color: var(--navy); font-size: 13px; }
.file-remove { background: none; border: none; color: var(--red); cursor: pointer; font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal {
  display: none; position: fixed; z-index: 2000;
  inset: 0; background: rgba(0,0,0,0.5); overflow-y: auto;
}
.modal.active { display: block; }
.modal-content {
  background: var(--white); margin: 5% auto;
  padding: 32px; border-radius: var(--radius-xl);
  width: 90%; max-width: 560px;
  box-shadow: var(--shadow-xl);
}
.modal-close {
  float: right; font-size: 28px; font-weight: 700;
  cursor: pointer; color: var(--mid); background: none; border: none;
  line-height: 1;
}
.modal-close:hover { color: var(--dark); }

/* ══════════════════════════════════════════════════════════════
   SUMMARY BOX (checkout)
   ══════════════════════════════════════════════════════════════ */
.summary-box {
  background: var(--light); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px;
}
.summary-item {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.summary-item:last-child { border-bottom: none; }
.summary-label { color: var(--mid); font-size: 14px; }
.summary-value { font-weight: 700; color: var(--navy); }
.summary-total {
  border-top: 2px solid var(--blue); padding-top: 12px; margin-top: 12px;
  font-size: 18px;
}

/* ══════════════════════════════════════════════════════════════
   SUCCESS / MESSAGE
   ══════════════════════════════════════════════════════════════ */
.success-container { text-align: center; padding: 48px 20px; }
.success-icon  { font-size: 64px; margin-bottom: 16px; }
.success-title {
  font-family: var(--font-display); font-size: 28px;
  font-weight: 700; color: var(--navy); margin-bottom: 8px;
}
.success-sub { color: var(--mid); font-size: 15px; margin-bottom: 24px; }
.success-details {
  background: var(--light); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 24px; text-align: left;
}
.success-detail-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.success-detail-item:last-child { border-bottom: none; }
.success-detail-label { color: var(--mid); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.success-detail-value { font-weight: 700; color: var(--navy); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   HIGHLIGHT / CALLOUT BOXES
   ══════════════════════════════════════════════════════════════ */
.highlight-box {
  background: var(--light); border-left: 4px solid var(--blue);
  padding: 16px 20px; border-radius: var(--radius);
}
.highlight-box.energia { border-left-color: var(--energia); }
.highlight-box.warning { border-left-color: var(--orange); background: var(--orange-light); }

/* ARERA note */
.arera-note {
  background: var(--white); border: 2px solid var(--energia);
  border-radius: var(--radius-lg); padding: 16px 20px;
  text-align: center; color: var(--energia); font-weight: 600;
  margin: 20px 0;
}

/* ══════════════════════════════════════════════════════════════
   STICKY CTA
   ══════════════════════════════════════════════════════════════ */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--navy); padding: 12px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  z-index: 999; box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  transform: translateY(100%); transition: transform 0.3s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta p { color: #B0C4D8; font-size: 14px; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   PAGE-SPECIFIC: LEGAL / CONDIZIONI
   ══════════════════════════════════════════════════════════════ */
.toc {
  background: var(--light); border-left: 4px solid var(--blue);
  padding: 20px 24px; border-radius: var(--radius-lg); margin-bottom: 40px;
}
.toc h2 { font-size: 16px; color: var(--navy); margin-bottom: 12px; }
.toc ul { list-style: none; }
.toc li { margin-bottom: 6px; }
.toc a  { color: var(--blue); text-decoration: none; font-weight: 500; font-size: 14px; }
.toc a:hover { text-decoration: underline; }

.legal-section { margin-bottom: 40px; scroll-margin-top: 80px; }
.legal-section h2 {
  font-family: var(--font-display); font-size: 22px;
  color: var(--navy); padding-bottom: 10px;
  border-bottom: 2px solid var(--blue); margin-bottom: 16px;
}
.legal-section h3 { font-size: 16px; color: var(--navy); margin: 16px 0 8px; }
.legal-section p  { font-size: 14px; color: var(--mid); margin-bottom: 12px; line-height: 1.8; }
.legal-section ul { margin-left: 20px; margin-bottom: 12px; }
.legal-section li { font-size: 14px; color: var(--mid); margin-bottom: 6px; line-height: 1.8; }

/* ══════════════════════════════════════════════════════════════
   API / INDEX PAGE
   ══════════════════════════════════════════════════════════════ */
.api-endpoint {
  background: var(--light); border-left: 3px solid var(--blue);
  padding: 8px 12px; margin: 6px 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.api-status {
  background: var(--green-light); border: 1px solid var(--energia);
  color: #064E3B; padding: 12px 20px; border-radius: var(--radius-lg);
  text-align: center; font-weight: 700; margin: 16px 0;
}

/* ══════════════════════════════════════════════════════════════
   CHART CONTAINERS
   ══════════════════════════════════════════════════════════════ */
.chart-box {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px;
}
.chart-title {
  font-size: 16px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.chart-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 20px; background: var(--blue); border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .section       { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .kpi-grid      { grid-template-columns: 1fr 1fr; }
  .cards-grid    { grid-template-columns: 1fr; }
  .pricing-grid  { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .filter-row    { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container     { padding: 0 16px; }
  .kpi-grid      { grid-template-columns: 1fr; }
  .btn-lg        { padding: 12px 20px; font-size: 14px; }
  .hero h1       { font-size: 26px; }
  .site-header__back { display: none; }
}
