/* =============================================
   DESIGN TOKENS — Dark Premium
   ============================================= */
:root {
  --bg:        #07091a;
  --bg-2:      #0b0e22;
  --surface:   #0f1630;
  --surface-2: #161e3a;

  --text:      #e4eeff;
  --text-2:    #96b4d4;
  --text-3:    #5a7898;

  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.12);

  --blue:      #4f8ef7;
  --blue-d:    #2563eb;
  --amber:     #f59e0b;
  --amber-d:   #d97706;
  --violet:    #818cf8;

  --ok:        #10b981;
  --warn:      #f59e0b;
  --danger:    #ef4444;

  --shadow-sm: 0 2px 14px rgba(0,0,0,.4);
  --shadow:    0 8px 36px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 80px rgba(0,0,0,.6);

  --r:    12px;
  --r-lg: 20px;
  --r-xl: 32px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue); }
img { max-width: 100%; height: auto; }
.link-button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 4px 0; font: inherit; cursor: pointer; text-align: left;
}
.link-button:hover { color: var(--text); text-decoration: underline; }

/* =============================================
   HEADER & NAV
   ============================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,26,.92);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; color: var(--text); text-decoration: none;
  font-size: 15px; letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  flex-shrink: 0; line-height: 0;
  transition: filter .22s;
}
.brand:hover .brand-mark {
  filter: drop-shadow(0 0 7px rgba(245,158,11,.65));
}
.brand-name {
  display: flex; flex-direction: column; gap: 1px;
}
.brand-first {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; line-height: 1;
}
.brand-last {
  font-size: 17px; font-weight: 900; color: var(--text);
  letter-spacing: -.03em; line-height: 1.05;
}
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  color: var(--text-2); padding: 8px 13px; border-radius: 9px;
  font-weight: 500; font-size: 14px; text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.07); text-decoration: none; }
.nav-links a.active { color: var(--text); background: rgba(79,142,247,.12); }
/* CTA nel nav: stessa grafica di hero-primary, dimensioni adatte all'header */
.nav-links .btn.hero-primary {
  font-size: 14px; padding: 9px 22px; min-height: 38px;
  letter-spacing: 0; color: #fff;
}
.nav-links .btn.hero-primary:hover { color: #fff; }
.mobile-toggle {
  display: none; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.06); color: var(--text);
  border-radius: 9px; padding: 8px 14px; font-weight: 700; cursor: pointer;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 24px; border-radius: 999px;
  border: 1px solid transparent; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  font: inherit; line-height: 1.1;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(255,255,255,.1) 0%, transparent 60%);
  pointer-events: none;
}
.btn:hover {
  background: var(--blue-d); text-decoration: none; color: #fff;
  transform: translateY(-1px); box-shadow: 0 6px 28px rgba(79,142,247,.45);
}
.btn:active { transform: none; box-shadow: none; }

.btn.secondary {
  background: rgba(79,142,247,.1); color: var(--blue);
  border-color: rgba(79,142,247,.25);
}
.btn.secondary::after { background: none; }
.btn.secondary:hover { background: rgba(79,142,247,.18); box-shadow: none; transform: none; }

.btn.ghost {
  background: transparent; color: var(--text-2); border-color: var(--line-2);
}
.btn.ghost::after { background: none; }
.btn.ghost:hover { background: rgba(255,255,255,.07); color: var(--text); box-shadow: none; transform: none; }

.btn.danger {
  background: rgba(239,68,68,.12); color: var(--danger);
  border-color: rgba(239,68,68,.25);
}
.btn.danger::after { background: none; }

.btn.small { min-height: 36px; padding: 8px 18px; font-size: 13px; }

.btn.hero-primary {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border: none; font-size: 16px; padding: 15px 34px;
  box-shadow: 0 4px 40px rgba(37,99,235,.48), inset 0 1px 0 rgba(255,255,255,.16);
  letter-spacing: .01em;
}
.btn.hero-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  background-size: 200% 100%; background-position: 200% 0;
  transition: background-position .5s ease;
  pointer-events: none;
}
.btn.hero-primary:hover::before { background-position: -200% 0; }
.btn.hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 60px rgba(37,99,235,.65), inset 0 1px 0 rgba(255,255,255,.22);
}

/* Custom checkboxes */
.consent-checks { display: flex; flex-direction: column; gap: 16px; }
.consent-check { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.consent-check input[type="checkbox"] { display: none; }
.consent-check .check-box {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--line-2); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
  margin-top: 1px;
}
.consent-check input:checked + .check-box {
  background: var(--blue); border-color: var(--blue);
}
.consent-check .check-box svg { display: none; }
.consent-check input:checked + .check-box svg { display: block; }
.consent-check .check-label { font-size: 14px; color: var(--text-2); line-height: 1.5; }
/* Error state — shown by JS when required checkbox is unchecked */
.consent-check--error .check-box {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
}
.consent-check--error .check-label { color: var(--text); }

/* =============================================
   LAYOUT
   ============================================= */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section.tight { padding: 60px 0; }

/* =============================================
   HERO
   ============================================= */
.hero {
  min-height: min(840px, calc(100vh - 68px));
  display: grid; align-items: center; padding: 84px 0 64px;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 10% 50%, rgba(37,99,235,.18) 0%, transparent 55%),
    radial-gradient(ellipse 65% 60% at 80% 48%, rgba(124,58,237,.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 50% 110%, rgba(245,158,11,.08) 0%, transparent 55%);
  animation: aurora 20s ease-in-out infinite alternate;
}
.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(79,142,247,.45) 25%,
    rgba(124,58,237,.4) 75%,
    transparent 100%);
  pointer-events: none;
}
@keyframes aurora {
  0%   { transform: scale(1) translate(0,0); }
  33%  { transform: scale(1.04) translate(-1.5%, 1.5%); }
  66%  { transform: scale(1.02) translate(2%, -1.2%); }
  100% { transform: scale(1) translate(0,0); }
}
.hero-orb {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
}
.hero-orb-1 {
  width: 640px; height: 640px; left: -200px; top: -180px;
  background: radial-gradient(circle, rgba(37,99,235,.12) 0%, transparent 70%);
  filter: blur(70px);
  animation: orb-float 24s ease-in-out infinite;
}
.hero-orb-2 {
  width: 520px; height: 520px; right: -120px; bottom: -100px;
  background: radial-gradient(circle, rgba(124,58,237,.1) 0%, transparent 70%);
  filter: blur(70px);
  animation: orb-float 30s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: 280px; height: 280px; left: 42%; top: 30%;
  background: radial-gradient(circle, rgba(245,158,11,.08) 0%, transparent 70%);
  filter: blur(50px);
  animation: orb-float 38s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0,0) scale(1); }
  25%  { transform: translate(32px,-42px) scale(1.06); }
  50%  { transform: translate(-22px, 22px) scale(.95); }
  75%  { transform: translate(12px, 32px) scale(1.04); }
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0,1.12fr) minmax(280px,.88fr);
  gap: 56px; align-items: center; position: relative; z-index: 3;
}
.hero h1       { color: #eef4ff; }
.hero .lead    { color: var(--text-2); }
.hero .copy    { color: var(--text-3); }
.hero .trust   { color: var(--text-3); font-size: 14px; margin-top: 20px; }
.hero .actions { margin-top: 36px; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
.eyebrow {
  color: var(--amber); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: 11px; margin-bottom: 20px; display: block;
}
h1, h2, h3 { line-height: 1.05; letter-spacing: -.03em; margin: 0 0 18px; color: var(--text); }
h1 { font-size: clamp(3rem, 7.5vw, 5.8rem); font-weight: 900; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; }
.lead { font-size: clamp(1.08rem, 2vw, 1.3rem); color: var(--text-2); max-width: 820px; line-height: 1.55; }
.copy { color: var(--text-2); max-width: 780px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.trust { color: var(--text-3); font-size: 14px; margin-top: 20px; }

/* Gradient headline text */
.grad {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 55%, #fcd34d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Section pill label */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,.1); color: var(--amber);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 999px; padding: 6px 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 22px;
}
.section-label::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

/* Trust badges */
.trust-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2);
  color: #34d399; border-radius: 999px; padding: 5px 13px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.trust-badge::before {
  content: '✓'; font-size: 11px; font-weight: 800;
}

/* Proof bar */
.proof-bar {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2); padding: 0;
}
.proof-items {
  display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap;
}
.proof-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px 36px; border-right: 1px solid var(--line);
  text-align: center; flex: 1; min-width: 140px;
}
.proof-item:last-child { border-right: none; }
.proof-item strong {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  letter-spacing: -.04em; display: block; line-height: 1;
}
.proof-item span {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .1em; margin-top: 5px; font-weight: 600;
}

/* Section divider */
.section-divider {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2) 30%, var(--line-2) 70%, transparent);
  margin: 0;
}

/* =============================================
   PORTAL PANEL (Hero aside)
   ============================================= */
.portal-panel {
  background: rgba(15,22,48,.72);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 24px;
  backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}
.portal-visual {
  display: block; width: 100%; border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.07); margin-bottom: 18px; opacity: .85;
}
.quick-ticket { display: grid; gap: 8px; }
.quick-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.06); border-radius: var(--r);
  background: rgba(255,255,255,.03); color: var(--text);
  transition: border-color .22s, background .22s;
  text-decoration: none;
}
.quick-row:hover {
  border-color: rgba(79,142,247,.3); background: rgba(79,142,247,.06);
  text-decoration: none; color: var(--text);
}
.quick-row strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.quick-row span { color: var(--text-2); font-size: 13px; line-height: 1.5; display: block; }

/* =============================================
   SEARCH PANEL
   ============================================= */
.problem-search {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 40px;
  box-shadow: var(--shadow-lg);
}
.problem-search form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
.problem-search input { min-height: 52px; }
.search-results { display: grid; gap: 14px; margin-top: 20px; }
.confidence { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; }

/* =============================================
   GRIDS & CARDS
   ============================================= */
.grid { display: grid; gap: 20px; }
.grid.two   { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.four  { grid-template-columns: repeat(4, minmax(0,1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card.link-card {
  color: var(--text); text-decoration: none;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s;
}
.card.link-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px var(--cat-color, rgba(79,142,247,.2));
  border-color: var(--cat-color, rgba(79,142,247,.28));
  text-decoration: none;
  color: var(--text);
}

/* Feature cards with ghost number */
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-2);
}
.feature-card .card-num {
  position: absolute; bottom: -8px; right: 12px;
  font-size: 80px; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, rgba(79,142,247,.12), transparent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none; user-select: none;
}
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px; margin-bottom: 20px;
}

/* Category cards */
.cat-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.cat-icon {
  font-family: 'Material Icons'; font-weight: normal; font-style: normal;
  font-size: 36px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: block; margin-bottom: 6px;
  -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
}
.cat-arrow {
  display: inline-block; margin-top: auto; color: var(--text-3); font-size: 16px;
  transition: color .2s, transform .2s;
}
.cat-card:hover .cat-arrow { color: var(--cat-color, var(--blue)); transform: translateX(4px); }
.cat-card h3 { margin: 0; }
.cat-copy {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0;
}

/* Category page header */
.cat-page-header {
  display: flex; gap: 28px; align-items: flex-start;
}
.cat-page-icon {
  font-family: 'Material Icons'; font-weight: normal; font-style: normal;
  font-size: 64px; line-height: 1; letter-spacing: normal; text-transform: none;
  -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  flex-shrink: 0; margin-top: 6px; opacity: .9;
}
.cat-disclaimer {
  margin-top: 28px; padding: 14px 18px 14px 20px;
  border-left: 3px solid var(--line-2);
  color: var(--text-3); font-size: 13px; line-height: 1.65;
  background: rgba(255,255,255,.02); border-radius: 0 var(--r) var(--r) 0;
}

/* How steps */
.how-steps { display: grid; gap: 16px; }
.how-step {
  display: flex; gap: 24px; align-items: flex-start;
}
.how-num {
  font-size: 2.4rem; font-weight: 900; letter-spacing: -.05em; line-height: 1;
  color: var(--blue); opacity: .35; flex-shrink: 0; min-width: 52px;
}

/* FAQ list */
.faq-list { display: grid; gap: 2px; }
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 700; color: var(--text);
  transition: color .15s;
}
.faq-item summary:hover { color: var(--blue); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-toggle {
  color: var(--amber); font-size: 22px; line-height: 1; flex-shrink: 0;
  transition: transform .2s;
}
details[open] .faq-toggle { transform: rotate(45deg); }
.faq-item .copy { padding-bottom: 18px; margin: 0; }
.faq-item .copy a { font-weight: 700; }

/* Estimate page */
.estimate-hero {
  display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 28px;
  align-items: end; margin-bottom: 32px;
}
.estimate-mini {
  background: rgba(79,142,247,.08); border: 1px solid rgba(79,142,247,.2);
  border-radius: var(--r-lg); padding: 22px;
}
.estimate-mini span,
.estimate-mini small { display: block; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.estimate-mini strong {
  display: block; margin: 6px 0; color: var(--text); font-size: 24px;
  letter-spacing: -.03em;
}
.estimate-shell {
  display: grid; grid-template-columns: minmax(0,1.08fr) minmax(320px,.92fr);
  gap: 24px; align-items: start;
}
.estimate-form h2 { margin-top: 0; }
.estimate-check {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 16px 0 10px; color: var(--text-2);
}
.estimate-result {
  position: sticky; top: 96px;
  background:
    linear-gradient(180deg, rgba(79,142,247,.09), transparent 38%),
    var(--surface);
  border-color: rgba(79,142,247,.22);
}
.estimate-total {
  font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 900;
  line-height: .95; letter-spacing: -.07em; color: var(--text);
  margin: 8px 0 16px;
}
.estimate-breakdown {
  display: grid; gap: 10px; margin: 22px 0;
}
.estimate-breakdown div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.estimate-breakdown div:last-child { border-bottom: none; }
.estimate-breakdown span { color: var(--text-3); }
.estimate-breakdown strong { color: var(--text); white-space: nowrap; }
.estimate-note {
  margin: 20px 0; padding: 14px 16px;
  border-radius: var(--r); background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.18);
  color: var(--text-2); font-size: 13px; line-height: 1.6;
}

/* Dark CTA card */
.cta-section {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 68px 60px;
  position: relative; overflow: hidden; color: var(--text);
}
.cta-section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 20% 50%, rgba(37,99,235,.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 82% 50%, rgba(124,58,237,.16) 0%, transparent 60%);
}
.cta-section > * { position: relative; z-index: 1; }
.cta-section h2   { color: var(--text); }
.cta-section .lead { color: var(--text-2); max-width: 640px; }

/* =============================================
   SOCIAL PROOF STRIP
   ============================================= */
.social-proof-strip {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0; margin-top: 32px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface);
}
.proof-project {
  flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px;
  padding: 22px 28px; text-decoration: none;
  transition: background .15s;
}
.proof-project:hover { background: var(--bg-2); }
.proof-project strong { font-size: 15px; font-weight: 700; color: var(--text); }
.proof-project span { font-size: 13px; color: var(--text-3); }
.proof-divider { width: 1px; align-self: stretch; background: var(--line-2); flex-shrink: 0; }
@media (max-width: 600px) {
  .proof-divider { width: 100%; height: 1px; }
}

/* =============================================
   ERROR PAGE
   ============================================= */
.error-page { text-align: center; padding: 80px 0 60px; max-width: 560px; margin: 0 auto; }
.error-code { font-size: clamp(80px, 18vw, 160px); font-weight: 900; line-height: 1; color: var(--amber); opacity: .18; margin-bottom: -24px; }
.error-page h1 { font-size: clamp(24px, 5vw, 38px); margin-bottom: 16px; }
.error-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }

/* =============================================
   CHIPS & STATUS
   ============================================= */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .status {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 5px 12px; background: var(--surface-2); color: var(--text-2);
  font-weight: 600; font-size: 12px; letter-spacing: .02em;
}
.status.nuovo, .status.pagamento-confermato  { background: rgba(16,185,129,.14); color: #34d399; }
.status.urgente, .status.alta, .status.failed { background: rgba(239,68,68,.14); color: #f87171; }
.status.in-attesa-pagamento, .status.in-valutazione { background: rgba(245,158,11,.14); color: #fbbf24; }
.status.chiuso, .status.rimborsato           { background: var(--surface); color: var(--text-2); border: 1px solid var(--line); }
.status.bozza, .status.proposto, .status.programmato { background: rgba(129,140,248,.14); color: #a5b4fc; }
.status.inviato, .status.confermato          { background: rgba(79,142,247,.14); color: #93c5fd; }
.status.accettato, .status.completato, .status.fatto, .status.pagato, .status.emesso { background: rgba(16,185,129,.14); color: #34d399; }
.status.annullato, .status.rinviato          { background: rgba(239,68,68,.14); color: #f87171; }

/* =============================================
   WIZARD / FORM STEPS
   ============================================= */
.steps { display: flex; align-items: flex-start; margin-bottom: 40px; position: relative; }
.step-pill {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex: 1; color: var(--text-3); font-size: 11px; font-weight: 600;
  text-align: center; position: relative; user-select: none;
}
.pill-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 2px solid var(--line-2);
  display: grid; place-items: center; position: relative; z-index: 1;
  font-size: 13px; font-weight: 700; color: var(--text-3);
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.step-pill:not(:last-child)::after {
  content: ''; position: absolute; top: 15px;
  left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--line-2); transition: background .3s;
}
.step-pill.done::after { background: var(--blue); }
.step-pill.active .pill-dot {
  background: var(--blue); border-color: var(--blue); color: #fff;
  box-shadow: 0 0 0 5px rgba(79,142,247,.18);
}
.step-pill.done .pill-dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.step-pill.active { color: var(--text); }
.step-pill.done { color: var(--text-2); }
.pill-label { line-height: 1.3; max-width: 72px; }

.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-step h2 { font-size: 1.3rem; margin-bottom: 18px; }
.category-fields-panel {
  margin-top: 30px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.category-fields-panel h3 { margin: 0 0 16px; }

/* Category choice cards — improved */
.category-choice {
  border: 1.5px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-lg); padding: 20px 18px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, box-shadow .2s, transform .18s;
  position: relative;
}
.category-choice:hover {
  border-color: rgba(79,142,247,.45); transform: translateY(-3px); box-shadow: var(--shadow);
}
.category-choice input { position: absolute; opacity: 0; pointer-events: none; }
.category-choice:has(input:checked) {
  border-color: var(--blue); border-width: 2px;
  box-shadow: 0 0 0 3px rgba(79,142,247,.18), var(--shadow-sm);
  background: rgba(79,142,247,.07);
}
.cat-choice-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.cat-choice-icon .material-icons { font-size: 24px; }

/* =============================================
   FORMS
   ============================================= */
label { display: block; font-weight: 600; color: var(--text-2); margin: 14px 0 7px; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1.5px solid rgba(255,255,255,.1); border-radius: var(--r);
  padding: 12px 14px; font: inherit; color: var(--text);
  background: rgba(255,255,255,.05);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 44px;
  background-color: rgba(255,255,255,.05);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23b8c6dc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  color-scheme: dark;
}
select::-ms-expand { display: none; }
select option { background: #111; color: var(--text); }
textarea { min-height: 118px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,142,247,.18);
}
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(79,142,247,.5); outline-offset: 2px;
}
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.help { color: var(--text-2); font-size: 14px; }
.form-error { color: var(--danger); font-size: 14px; }
.honeypot { position: absolute; left: -9999px; }

/* File upload custom button */
.file-upload-label { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; margin: 8px 0 0; }
.file-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-upload-btn { flex-shrink: 0; }
.file-upload-names { color: var(--text-3); font-size: 14px; font-weight: 400; }

/* =============================================
   TABLES
   ============================================= */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.02); }

/* =============================================
   FLASH MESSAGES
   ============================================= */
.flash { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; }
.flash-item { border-radius: var(--r); padding: 14px 18px; margin-bottom: 10px; background: rgba(79,142,247,.1); color: #93c5fd; border: 1px solid rgba(79,142,247,.22); }
.flash-item.error   { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(239,68,68,.22); }
.flash-item.success { background: rgba(16,185,129,.1); color: #34d399; border-color: rgba(16,185,129,.22); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  padding: 68px 0 40px; margin-top: 80px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0,.6fr)); gap: 40px; }
.footer a { display: block; color: var(--text-3); padding: 4px 0; font-size: 14px; transition: color .15s; }
.footer a:hover { color: var(--text); text-decoration: none; }
.footer .link-button { display: block; font-size: 14px; color: var(--text-3); }
.footer .link-button:hover { color: var(--text); }
.footer strong {
  color: var(--text-3); text-transform: uppercase; letter-spacing: .1em;
  font-size: 11px; display: block; margin-bottom: 14px; font-weight: 700;
}
.footer .brand { margin-bottom: 14px; }
.footer .copy { color: var(--text-2); font-size: 15px; margin: 0 0 10px; }
.footer p a { display: inline; color: var(--text-3); }
.footer p a:hover { color: var(--text-2); }
.footer-bottom {
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--text-3); font-size: 13px; flex-wrap: wrap;
}

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-hero {
  display: grid; grid-template-columns: 300px 1fr; gap: 60px; align-items: start;
  margin-top: 8px;
}
.about-photo-wrap {
  position: relative;
  flex-shrink: 0;
}
.about-photo-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 52%;
  background: linear-gradient(to top, var(--bg) 0%, rgba(7,9,26,.4) 60%, transparent 100%);
  pointer-events: none;
}
.about-photo {
  width: 100%; display: block;
  filter: drop-shadow(0 28px 48px rgba(0,0,0,.55));
}
.about-bio { padding-top: 8px; }
.about-tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px;
}
.about-tags span {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: rgba(255,255,255,.06); border: 1px solid var(--line-2);
  padding: 4px 12px; border-radius: 99px;
}
.footer-made { font-size: 13px; color: var(--text-3); }
.footer-heart { color: #ef4444; font-style: normal; }
.footer-lily { color: var(--amber); font-style: normal; letter-spacing: -.02em; }

/* Publications */
.pub-list { display: grid; gap: 14px; }
.pub-item { display: block; text-decoration: none !important; }
.pub-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pub-year { font-size: 13px; font-weight: 800; color: var(--amber); letter-spacing: -.02em; }
.pub-tag {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .07em;
}
.pub-item h3 { margin: 0 0 10px; font-size: 16px; color: var(--text); font-weight: 700; line-height: 1.4; }
.pub-link { font-size: 13px; color: var(--blue); font-weight: 600; }
.pub-item:hover .pub-link { text-decoration: underline; }

/* Project cards */
.proj-card { text-decoration: none !important; display: flex; flex-direction: column; }
.proj-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px; }
.proj-tag {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--amber); margin-bottom: 4px;
}
.proj-arrow {
  font-size: 22px; color: var(--text-3); flex-shrink: 0; margin-top: 2px;
  transition: color .15s, transform .15s;
}
.proj-card:hover .proj-arrow { color: var(--blue); transform: translate(3px,-3px); }
.proj-card .copy { flex: 1; }
.proj-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3);
}
.proj-status {
  background: rgba(16,185,129,.1); color: var(--ok);
  padding: 2px 10px; border-radius: 99px; font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em;
}

/* Category choice icon (ticket form) */
.cat-choice-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 10px;
  flex-shrink: 0;
}
.cat-choice-icon .material-icons { font-size: 22px; }
.category-choice { position: relative; display: flex; flex-direction: column; }

/* =============================================
   COOKIE BANNER
   ============================================= */
/* Backdrop — blocca l'interazione con la pagina finché l'utente non sceglie */
.cookie-backdrop {
  position: fixed; inset: 0; z-index: 89;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.cookie-backdrop[hidden] { display: none; }
body.cookie-locked { overflow: hidden; }

.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 90;
  max-width: 720px; margin: 0 auto;
  background: rgba(7,9,26,.97); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(32px);
  padding: 22px 24px; display: flex; flex-direction: column;
  gap: 16px; align-items: stretch; color: var(--text);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner strong { color: var(--text); font-size: 15px; }
.cookie-banner p { margin: 4px 0 10px; color: var(--text-2); font-size: 14px; }
.cookie-policy-link { color: #7eb3f7; font-size: 12px; white-space: nowrap; }
.cookie-policy-link:hover { color: #a8ccff; }
.cookie-choice-note { font-size: 11px; opacity: .55; font-weight: 400; }
.cookie-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cookie-choice {
  position: relative;
  display: block;
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  transition: background .12s, border-color .12s;
  overflow: hidden;
}
.cookie-choice:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.cookie-check-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.cookie-check-label {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%;
  padding: 11px 12px;
  cursor: pointer; color: #c8daf0; font-size: 13px;
  font-weight: 500; user-select: none; margin: 0; line-height: 1.4;
}
.cookie-check-box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(200,218,240,.7);
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  position: relative;
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.cookie-check-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .12s;
}
.cookie-check-input:checked + .cookie-check-box {
  background: #4f8ef7;
  border-color: #4f8ef7;
  box-shadow: 0 0 0 4px rgba(79,142,247,.16);
}
.cookie-check-input:checked + .cookie-check-box::after { opacity: 1; }
.cookie-check-input:disabled + .cookie-check-box { opacity: .85; }
.cookie-check-input:disabled ~ .cookie-choice-text,
.cookie-check-input:disabled ~ .cookie-choice-text .cookie-choice-note { cursor: default; }
.cookie-check-input:focus-visible + .cookie-check-box {
  outline: 2px solid #4f8ef7; outline-offset: 2px;
}
.cookie-choice-text { display: block; flex: 1; min-width: 0; }
.cookie-error {
  margin: 12px 0 0;
  color: #fecaca;
  background: rgba(220,38,38,.14);
  border: 1px solid rgba(248,113,113,.35);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
}
.cookie-error[hidden] { display: none; }
.cookie-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; min-width: 0;
}
.cookie-actions .btn { width: 100%; justify-content: center; }
.cookie-actions .btn[disabled] { opacity: .65; cursor: wait; }
.cookie-fab {
  position: fixed; bottom: 20px; left: 20px; z-index: 89;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text-3); cursor: pointer;
  display: grid; place-items: center; line-height: 0;
  box-shadow: var(--shadow-sm);
  transition: color .15s, background .15s, transform .18s;
}
.cookie-fab:hover { color: var(--text); background: var(--surface); transform: scale(1.1); }
.cookie-fab[hidden] { display: none; }

/* WhatsApp FAB */
.whatsapp-fab {
  position: fixed; bottom: 72px; right: 20px; z-index: 88;
  width: 48px; height: 48px; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.45);
  transition: transform .18s, box-shadow .18s;
  text-decoration: none;
}
.whatsapp-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,.55); }

/* Sticky mobile CTA */
.mobile-cta-sticky {
  display: none;
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 88;
  background: var(--amber); color: #000; font-weight: 700; font-size: 15px;
  padding: 14px 32px; border-radius: 99px;
  box-shadow: 0 4px 24px rgba(0,0,0,.28);
  text-decoration: none; white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.mobile-cta-sticky:hover { opacity: .9; }
@media (max-width: 767px) {
  .mobile-cta-sticky:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; }
}

/* Optional field label hint */
.field-optional { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 4px; }

/* Admin stat bars */
.stat-bars { display: grid; gap: 10px; margin-top: 16px; }
.stat-bar-row { display: grid; grid-template-columns: 140px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; }
.stat-bar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar-track { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--amber); border-radius: 99px; transition: width .4s ease; min-width: 4px; }
.stat-bar-val { color: var(--text-3); text-align: right; }

/* Message thread (legacy) */
.message-card { border-left: 3px solid var(--line-2); }
.message-admin { border-left-color: var(--amber); }
.message-client { border-left-color: var(--blue); }
.message-meta { display: flex; align-items: center; gap: 10px; }

/* Track page */
.track-hero {
  display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 32px; align-items: start;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  padding: 32px 36px; margin-top: 8px;
}
.track-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.track-badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  background: rgba(var(--badge-color, 100,116,139),.12);
  color: var(--badge-color, var(--text-2)); border: 1px solid rgba(var(--badge-color, 100,116,139),.2);
}
.track-badge[style*="--badge-color"] {
  background: color-mix(in srgb, var(--badge-color) 15%, transparent);
  color: var(--badge-color); border-color: color-mix(in srgb, var(--badge-color) 30%, transparent);
}
.track-badge-urgency { background: rgba(245,158,11,.1); color: #d97706; border-color: rgba(245,158,11,.2); }
.track-badge-code { background: rgba(255,255,255,.04); color: var(--text-3); border-color: var(--line-2); font-family: monospace; }
.track-badge-cat { background: rgba(79,142,247,.08); color: var(--blue); border-color: rgba(79,142,247,.18); }
.track-section-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.track-doc-card { display: flex; flex-direction: column; }
.track-doc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.track-doc-number { font-family: monospace; font-size: 13px; color: var(--text-3); }
.track-thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.track-msg {
  border-radius: var(--r-lg); padding: 18px 22px;
  border: 1px solid var(--line-2);
}
.track-msg-admin { background: var(--surface-2); border-left: 3px solid var(--amber); }
.track-msg-client { background: rgba(79,142,247,.05); border-left: 3px solid var(--blue); }
.track-msg-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.track-msg-author { font-size: 13px; font-weight: 700; color: var(--text); }
.track-msg-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.track-msg-body { font-size: 15px; color: var(--text-2); line-height: 1.65; }
.track-reply-form { margin-top: 0; }
.track-files { display: flex; flex-direction: column; gap: 8px; }
.track-file {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); text-decoration: none; transition: background .15s;
}
.track-file:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.track-file-icon { color: var(--text-3); display: flex; }
.track-file-info { flex: 1; }
.track-file-info strong { display: block; font-size: 14px; }
.track-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 12px; border-left: 2px solid var(--line-2); }
.track-event { display: flex; gap: 16px; padding-bottom: 24px; position: relative; }
.track-event-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--amber); border: 2px solid var(--surface);
  flex-shrink: 0; margin-top: 4px; margin-left: -17px;
}
.track-event-content { flex: 1; }
@media (max-width: 780px) {
  .track-hero { grid-template-columns: 1fr; }
}

/* Star rating */
.star-rating { display: flex; flex-direction: row-reverse; gap: 4px; width: fit-content; }
.star-rating input { display: none; }
.star-rating label { font-size: 36px; color: var(--line-2); cursor: pointer; transition: color .1s; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f59e0b; }

/* =============================================
   ADMIN SHELL & DARK SIDEBAR
   ============================================= */
.admin-shell { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 100vh; }
.admin-side {
  background: var(--bg); color: var(--text); padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.admin-side .brand { margin-bottom: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3); padding: 20px 10px 6px; display: block;
}
.admin-side a {
  display: flex; align-items: center; gap: 8px; color: var(--text-2);
  padding: 9px 10px; border-radius: var(--r); text-decoration: none;
  margin: 1px 0; font-size: 13px; font-weight: 500;
  transition: color .15s, background .15s; border-left: 3px solid transparent;
}
.admin-side a:hover { background: rgba(255,255,255,.06); color: var(--text); text-decoration: none; }
.admin-side a.active {
  background: rgba(79,142,247,.14); color: var(--blue);
  border-left-color: var(--blue); padding-left: 7px;
}
.admin-logout {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}

/* =============================================
   ADMIN LIGHT MAIN CONTENT
   ============================================= */
.admin-main {
  --bg:        #f8fafc;
  --bg-2:      #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;
  --line:      #e2e8f0;
  --line-2:    #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  background: var(--bg); color: var(--text);
  padding: 32px; min-width: 0;
}
.admin-main a { color: #2563eb; }
.admin-main a:hover { color: #1d4ed8; }
.admin-main h1, .admin-main h2, .admin-main h3 { color: #0f172a; }
.admin-main h1 { font-size: 1.8rem; letter-spacing: -.04em; margin: 0; }
.admin-main h2 { font-size: 1.2rem; letter-spacing: -.025em; margin-bottom: 8px; }
.admin-main h3 { font-size: 1rem; margin-bottom: 6px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.admin-main .help { color: #64748b; }

/* Inputs on light bg */
.admin-main input, .admin-main select, .admin-main textarea {
  border: 1.5px solid #e2e8f0; background: #ffffff; color: #0f172a;
}
.admin-main select {
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%2364758b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  color-scheme: light;
}
.admin-main input::placeholder, .admin-main textarea::placeholder { color: #94a3b8; }
.admin-main input:focus, .admin-main select:focus, .admin-main textarea:focus {
  border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.admin-main select option { background: #ffffff; color: #0f172a; }
.admin-main a.btn { color: #fff; }
.admin-main a.btn.ghost { color: #475569; }
.admin-main a.btn.ghost:hover { background: rgba(0,0,0,.05); color: #0f172a; }
.admin-main .btn.ghost { color: #475569; }
.admin-main .btn.ghost:hover { background: rgba(0,0,0,.05); color: #0f172a; }
.admin-main .btn.secondary { background: rgba(37,99,235,.09); color: #2563eb; border-color: rgba(37,99,235,.28); }
.admin-main .btn.secondary:hover { background: rgba(37,99,235,.16); box-shadow: none; transform: none; }
.admin-main a.btn.secondary { color: #2563eb; }
.admin-main a.btn.secondary:hover { color: #1d4ed8; }

/* Metric cards on light bg */
.metric {
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 24px; border-top: 3px solid #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-top-color .2s, box-shadow .2s;
}
.metric:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-top-color: #f59e0b; }
.metric strong {
  display: block; font-size: 40px; font-weight: 800; line-height: 1;
  letter-spacing: -.06em; color: #1d4ed8; margin-bottom: 6px;
}
.metric .metric-label { color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; display: block; }

/* Stat bars on light bg */
.admin-main .stat-bar-track { background: #e2e8f0; }
.admin-main .stat-bar-fill { background: #3b82f6; }
.admin-main .stat-bar-label { color: #475569; }
.admin-main .stat-bar-val { color: #1e293b; font-weight: 700; }

/* Tables on light bg */
.admin-main .table-wrap { background: #ffffff; border-color: #e2e8f0; }
.admin-main th { background: #f8fafc; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.admin-main td { border-bottom-color: #f1f5f9; color: #1e293b; }
.admin-main tr:hover td { background: rgba(37,99,235,.025); }

/* Flash messages on light bg */
.admin-main .flash-item { background: rgba(37,99,235,.07); color: #1d4ed8; border-color: rgba(37,99,235,.2); }
.admin-main .flash-item.error { background: rgba(185,28,28,.07); color: #b91c1c; border-color: rgba(185,28,28,.2); }
.admin-main .flash-item.success { background: rgba(5,150,105,.07); color: #065f46; border-color: rgba(5,150,105,.2); }

/* Status badges — darker text for light bg readability */
.admin-main .status.nuovo, .admin-main .status.pagamento-confermato { color: #059669; background: rgba(5,150,105,.1); }
.admin-main .status.urgente, .admin-main .status.alta, .admin-main .status.failed { color: #dc2626; background: rgba(220,38,38,.1); }
.admin-main .status.in-attesa-pagamento, .admin-main .status.in-valutazione { color: #d97706; background: rgba(217,119,6,.1); }
.admin-main .status.bozza, .admin-main .status.proposto, .admin-main .status.programmato { color: #4f46e5; background: rgba(79,70,229,.1); }
.admin-main .status.inviato, .admin-main .status.confermato { color: #2563eb; background: rgba(37,99,235,.1); }
.admin-main .status.accettato, .admin-main .status.completato, .admin-main .status.fatto, .admin-main .status.pagato, .admin-main .status.emesso { color: #059669; background: rgba(5,150,105,.1); }
.admin-main .status.annullato, .admin-main .status.rinviato { color: #dc2626; background: rgba(220,38,38,.1); }
.admin-main .status.chiuso, .admin-main .status.rimborsato { color: #64748b; background: rgba(100,116,139,.1); border-color: rgba(100,116,139,.2); }
.admin-main .chip { background: rgba(37,99,235,.08); color: #1d4ed8; }
.admin-main .card { margin-bottom: 20px; background: #ffffff; }
.admin-main .card h2, .admin-main .card h3 { margin-top: 0; color: #0f172a; }

/* =============================================
   ADMIN TABS
   ============================================= */
.admin-tabs {
  display: flex; gap: 0; border-bottom: 2px solid #e2e8f0;
  margin-bottom: 28px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.admin-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 22px; margin-bottom: -2px;
  font: 600 13px/1 inherit; color: #64748b; cursor: pointer;
  white-space: nowrap; transition: color .15s, border-color .15s, background .15s;
  border-radius: 8px 8px 0 0;
}
.admin-tab:hover { color: #0f172a; background: rgba(0,0,0,.03); }
.admin-tab.active { color: #2563eb; border-bottom-color: #2563eb; background: rgba(37,99,235,.04); }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
[data-animate] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .72s cubic-bezier(.16,1,.3,1), transform .72s cubic-bezier(.16,1,.3,1);
}
[data-animate].in-view { opacity: 1; transform: none; }
[data-animate-delay="1"] { transition-delay: .09s; }
[data-animate-delay="2"] { transition-delay: .18s; }
[data-animate-delay="3"] { transition-delay: .27s; }
[data-animate-delay="4"] { transition-delay: .36s; }
[data-animate-delay="5"] { transition-delay: .45s; }
.hero [data-animate] { transition-delay: 0s !important; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .hero-grid, .grid.two, .grid.three, .grid.four, .field-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .nav { align-items: flex-start; }
  .mobile-toggle { display: inline-flex; }
  .nav-links { display: none; width: 100%; padding-top: 8px; }
  .nav-links.open { display: flex; flex-direction: column; justify-content: flex-start; }
  .nav-links.open a { border-radius: var(--r); }
  .nav { flex-wrap: wrap; }
  h1 { font-size: clamp(2.6rem, 14vw, 4.2rem); }
  .hero { min-height: auto; padding: 60px 0 80px; }
  .hero::after { display: none; }
  .hero-orb { display: none; }
  .cta-section { padding: 44px 28px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-tabs { gap: 0; }
  .admin-tab { padding: 10px 14px; font-size: 12px; }
  .problem-search { padding: 28px; }
  .problem-search form { grid-template-columns: 1fr; }
  .estimate-hero,
  .estimate-shell { grid-template-columns: 1fr; }
  .estimate-result { position: static; }
  .estimate-mini { order: -1; }
  .cookie-banner {
    display: flex; flex-direction: column; align-items: stretch;
    left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 24px; max-width: none;
    max-height: calc(100dvh - 24px);
    padding: 20px 18px; box-sizing: border-box; gap: 0; overflow-y: auto;
    background: rgba(10,13,30,.97);
    border-color: rgba(255,255,255,.16);
    box-shadow: 0 24px 90px rgba(0,0,0,.7);
  }
  .cookie-banner > div:first-child { padding: 0; }
  .cookie-banner strong { font-size: 16px; color: #e4eeff; }
  .cookie-banner p { font-size: 14px; line-height: 1.55; margin: 6px 0 12px; color: #96b4d4; }
  .cookie-choices { gap: 8px; margin: 12px 0 0; }
  .cookie-choice {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.055);
  }
  .cookie-choice:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }
  .cookie-choice:hover { background: rgba(255,255,255,.08); }
  .cookie-check-label { padding: 13px 12px; font-size: 14px; }
  .cookie-check-box { width: 24px; height: 24px; border-radius: 8px; }
  .cookie-check-box::after { left: 7px; top: 3px; width: 6px; height: 12px; }
  .cookie-choice-note { display: block; margin-top: 2px; font-size: 12px; }
  .cookie-error { font-size: 13px; margin-top: 12px; }
  .cookie-actions {
    display: flex; flex-direction: column; gap: 8px;
    padding: 16px 0 0; min-width: 0;
  }
  .cookie-actions .btn {
    width: 100%; text-align: center; justify-content: center;
    min-width: 0; min-height: 48px; font-size: 15px; padding: 13px 16px;
  }
  .cookie-actions [data-cookie-accept] { order: 1; }
  .cookie-actions [data-cookie-save] { order: 2; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #e4eeff; }
  .cookie-actions [data-cookie-save]:hover { background: rgba(255,255,255,.14); }
  .cookie-actions [data-cookie-reject] { order: 3; background: transparent; border-color: rgba(255,255,255,.14); color: #96b4d4; font-size: 14px; min-height: 42px; }
  .cookie-actions [data-cookie-reject]:hover { background: rgba(255,255,255,.06); color: #e4eeff; }
  .proof-item { padding: 16px 20px; border-right: none; border-bottom: 1px solid var(--line); }
  .proof-item:last-child { border-bottom: none; }
  .trust-row { gap: 6px; }
  .about-hero { grid-template-columns: 1fr; gap: 32px; }
  .about-photo-wrap { max-width: 240px; }
  .pub-list { gap: 12px; }
}
