@import url('master81_layout.css');

:root {
  --ink: #0A0A0A;
  --ink-soft: #4A5568;
  --paper: #FFFFFF;
  --card: #FFFFFF;
  --line: #E2E8F0;
  --amber: #00875A;
  --amber-bg: #E8F5E9;
  --green: #00875A;
  --green-hover: #00704A;
  --green-bg: #E8F5E9;
  --danger: #8C3030;
  --danger-bg: #F8E8E4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --serif: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand strong {
  background: #00875A;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 135, 90, 0.25);
}
.brand span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
nav { display: flex; gap: 22px; align-items: center; }
nav a { text-decoration: none; font-size: 15px; color: var(--ink-soft); }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary, .nav-cta { background: var(--ink); color: #f7f3ea; }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn:hover, .nav-cta:hover { transform: translateY(-1px); }

.hero { padding: 72px 0 36px; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 48px; align-items: end; }
.kicker { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); font-weight: 650; margin: 0 0 14px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(40px, 5vw, 68px); line-height: 0.98; }
h2 { font-size: clamp(30px, 3vw, 42px); line-height: 1.05; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-note { border-left: 3px solid var(--amber); padding: 8px 0 8px 16px; color: var(--ink-soft); font-size: 15px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.section { padding: 28px 0 64px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 28px; margin-bottom: 8px; }
.meta { color: var(--ink-soft); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.price { font-family: var(--serif); font-size: 34px; margin: 14px 0; }
.price small { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); }
ul.clean { margin: 12px 0 0; padding: 0; list-style: none; }
ul.clean li { padding: 8px 0; border-top: 1px solid var(--line); }
.tag { display: inline-block; background: var(--amber-bg); color: var(--amber); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--danger-bg); color: var(--danger); }

.steps { display: grid; grid-template-columns: 88px 1fr; gap: 8px 16px; align-items: start; }
.num { font-family: var(--serif); font-size: 28px; color: var(--amber); }
.form-card { padding: 28px; }
.progress { display: flex; gap: 8px; margin-bottom: 22px; }
.progress span { height: 4px; flex: 1; background: var(--line); border-radius: 99px; }
.progress span.on { background: var(--green); }
label { display: block; font-size: 13px; font-weight: 650; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 90px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.savebar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.status { font-size: 13px; color: var(--green); min-height: 20px; }
.person, .deadline {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
}
table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 14px; }
.table-responsive, .table-81-wrap, .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
}
@media (max-width: 860px) {
  table:not(.no-auto-scroll) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--ink-soft); font-size: 14px; }
.footer a { color: var(--ink-soft); }
.notice { background: var(--danger-bg); color: var(--danger); border-radius: 16px; padding: 14px 16px; font-size: 15px; }
.okbox { background: var(--green-bg); color: var(--green); border-radius: 16px; padding: 14px 16px; }

/* =========================================================================
   REGOLA 4 GOVERNANCE: ZERO MENU ORIZZONTALE IN HEADER
   Solo Contatore Live + Tasto WhatsApp + Tasto Menu Burger
   ========================================================================= */
nav { display: none !important; }

.header-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header-live-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1E293B;
  user-select: none;
}
.live-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: livePulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-wa-btn,
.header-mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF !important;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}
.header-wa-btn:hover,
.header-mail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.45);
}

.burger-menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}
.burger-menu-btn:hover {
  background: #E2E8F0;
}
.burger-bar {
  width: 20px;
  height: 2.2px;
  background: #0F172A;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* =========================================================================
   BURGER DRAWER MODAL OVERLAY
   ========================================================================= */
.burger-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.burger-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.burger-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 86vw);
  background: #FFFFFF;
  box-shadow: -8px 0 32px rgba(0,0,0,0.2);
  z-index: 100000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.burger-drawer-overlay.open .burger-drawer-panel {
  transform: translateX(0);
}
.burger-drawer-header {
  padding: 20px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.burger-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
}
.burger-drawer-nav {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.burger-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #0F172A;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.15s ease;
}
.burger-drawer-nav a:hover, .burger-drawer-nav a:active {
  background: #F1F5F9;
  color: #00875A;
}
.burger-drawer-nav a.active {
  background: #ECFDF5;
  color: #065F46;
}

/* =========================================================================
   PWA MOBILE BOTTOM DOCK (NATIVE APP FEEL)
   ========================================================================= */
.pwa-bottom-dock {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 74px !important;
  }
  .pwa-bottom-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid #CBD5E1;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 8px));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    justify-content: space-around;
    align-items: center;
  }
  .dock-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #64748B;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    transition: transform 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .dock-tab:active {
    transform: scale(0.92);
    background: #F1F5F9;
  }
  .dock-tab.active {
    color: #00875A;
  }
  .dock-tab.dock-wa,
  .dock-tab.dock-mail {
    color: #059669;
  }
  .dock-tab svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
  }
  .header-live-stats .stat-text-extra {
    display: none;
  }
}

/* =========================================================================
   CORPORATE FOOTER METALLICO VERDE (REGOLA 9 GOVERNANCE)
   ========================================================================= */
.corp-master-footer {
  background: linear-gradient(135deg, #064E3B 0%, #00875A 50%, #065F46 100%);
  color: #FFFFFF !important;
  padding: 44px 20px 56px;
  border-top: 3px solid #10B981;
  text-align: center;
  margin-top: 40px;
}
.corp-master-footer a {
  color: #A7F3D0;
  text-decoration: underline;
}
.corp-master-footer a:hover {
  color: #FFFFFF;
}
.footer-bank-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 20px;
  margin: 18px auto;
  max-width: 720px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #F8FAFC;
  backdrop-filter: blur(4px);
}

@media (max-width: 860px) {
  .hero, .grid-2, .grid-3, .row { grid-template-columns: 1fr; }
  .top-inner { min-height: 64px; }
}
