/* ============================================================
   KmQuadrato Francavilla al Mare — Stylesheet globale
   Colori principali:
     Blu primario  #2563EB
     Arancio coupon #F97316
     Navy admin    #0F172A
     Slate         #1E293B
     Bianco card   #FFFFFF
     Sfondo        #F1F5F9
   ============================================================ */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background: #F1F5F9;
  color: #1E293B;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

a { color: #2563EB; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

/* ============================================================
   UTILITÀ GENERALI
   ============================================================ */
.container   { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm{ max-width: 480px;  margin: 0 auto; padding: 0 1.5rem; }
.container-md{ max-width: 768px;  margin: 0 auto; padding: 0 1.5rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.sr-only     { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* ============================================================
   COLORI DI STATO / BADGE
   ============================================================ */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-blue    { background: #DBEAFE; color: #1D4ED8; }
.badge-green   { background: #DCFCE7; color: #15803D; }
.badge-orange  { background: #FFEDD5; color: #C2410C; }
.badge-red     { background: #FEE2E2; color: #B91C1C; }
.badge-gray    { background: #F1F5F9; color: #64748B; }
.badge-yellow  { background: #FEF9C3; color: #A16207; }
.badge-navy    { background: #0F172A; color: #E2E8F0; }

/* ============================================================
   HEADER PUBBLICO / NAVIGAZIONE
   ============================================================ */
.site-header {
  background: #2563EB;
  color: #fff;
  padding: .9rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.site-header .logo span { opacity: .75; font-weight: 400; font-size: 1rem; }
.site-header nav a {
  color: rgba(255,255,255,.85);
  font-weight: 500;
  margin-left: 1.25rem;
  font-size: .95rem;
  transition: color .15s;
}
.site-header nav a:hover,
.site-header nav a.active { color: #fff; text-decoration: none; }

/* Header bianco — usato sulla landing page pubblica */
.site-header-white {
  background: #fff;
  color: #0F172A;
  padding: 0 1.5rem;
  height: 64px;
  box-shadow: 0 1px 0 #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-white .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo: quadrato blu + SVG pin + testo */
.site-header-white .logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon-box {
  width: 36px;
  height: 36px;
  background: #2563EB;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-icon-box svg { display: block; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text .brand { font-size: 1rem; font-weight: 800; color: #0F172A; letter-spacing: -.02em; }
.logo-text .city  { font-size: .72rem; font-weight: 500; color: #64748B; }

/* Nav links */
.site-header-white nav { display: flex; align-items: center; gap: .25rem; }
.site-header-white nav a {
  color: #475569;
  font-weight: 500;
  font-size: .875rem;
  padding: .45rem .9rem;
  border-radius: .4rem;
  transition: color .15s, background .15s;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-header-white nav a:hover { color: #2563EB; background: #EFF6FF; text-decoration: none; }
.site-header-white nav .btn-nav-primary {
  background: #2563EB;
  color: #fff !important;
  padding: .45rem 1.15rem;
  border-radius: .45rem;
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
  transition: background .15s;
  margin-left: .25rem;
  min-height: 44px;
}
.site-header-white nav .btn-nav-primary:hover { background: #1D4ED8; }

/* Header admin navy */
.header-admin {
  background: #0F172A;
  color: #E2E8F0;
  padding: .9rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-admin .header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.header-admin .logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.header-admin .logo .role-chip {
  background: #2563EB;
  color: #fff;
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.header-admin nav a {
  color: #94A3B8;
  font-size: .9rem;
  font-weight: 500;
  margin-left: 1rem;
  transition: color .15s;
}
.header-admin nav a:hover { color: #E2E8F0; text-decoration: none; }

/* Header provider arancio accent */
.header-provider {
  background: #fff;
  border-bottom: 3px solid #F97316;
  padding: .9rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-provider .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.header-provider .logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.header-provider .logo .role-chip {
  background: #F97316;
  color: #fff;
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================================
   PULSANTI
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border: none;
  border-radius: .5rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary  { background: #2563EB; color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.25); }
.btn-primary:hover { background: #1D4ED8; }

.btn-orange   { background: #F97316; color: #fff; box-shadow: 0 2px 6px rgba(249,115,22,.25); }
.btn-orange:hover { background: #EA6C0A; }

.btn-danger   { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-success  { background: #22C55E; color: #fff; }
.btn-success:hover { background: #16A34A; }

.btn-outline  { background: transparent; border: 1.5px solid #2563EB; color: #2563EB; }
.btn-outline:hover { background: #EFF6FF; }

.btn-gray     { background: #E2E8F0; color: #475569; }
.btn-gray:hover { background: #CBD5E1; }

.btn-dark     { background: #0F172A; color: #fff; }
.btn-dark:hover { background: #1E293B; }

.btn-sm  { padding: .35rem .85rem; font-size: .8rem; min-height: 44px; }
.btn-lg  { padding: .75rem 2rem;   font-size: 1.05rem; }
.btn-xl  { padding: 1rem 2.5rem;   font-size: 1.15rem; border-radius: .75rem; }
.btn-block { width: 100%; }

/* ============================================================
   FORM
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
}
.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid #CBD5E1;
  border-radius: .5rem;
  font-size: .95rem;
  color: #1E293B;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: #94A3B8; }
.form-control.error { border-color: #EF4444; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint  { font-size: .78rem; color: #64748B; margin-top: .25rem; }
.form-error { font-size: .78rem; color: #EF4444; margin-top: .25rem; }

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

/* Fieldset */
fieldset {
  border: 1.5px solid #E2E8F0;
  border-radius: .6rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
legend {
  font-size: .85rem;
  font-weight: 700;
  color: #475569;
  padding: 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: #fff;
  border-radius: .875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  overflow: hidden;
}
.card-body   { padding: 1.5rem; }
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.card-header h2, .card-header h3 { font-size: 1.05rem; font-weight: 700; color: #0F172A; }
.card-footer {
  padding: .85rem 1.5rem;
  border-top: 1px solid #F1F5F9;
  background: #F8FAFC;
}

/* Stat card */
.stat-card {
  background: #fff;
  border-radius: .875rem;
  padding: 1.35rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border-left: 4px solid #2563EB;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.stat-card.orange  { border-left-color: #F97316; }
.stat-card.green   { border-left-color: #22C55E; }
.stat-card.purple  { border-left-color: #8B5CF6; }
.stat-card .stat-label { font-size: .78rem; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: #0F172A; line-height: 1.1; }
.stat-card .stat-sub   { font-size: .8rem; color: #64748B; }

/* ============================================================
   TABS
   ============================================================ */
.tabs-bar {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: .65rem 1.25rem;
  border: none;
  background: none;
  font-size: .9rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s;
  border-radius: .4rem .4rem 0 0;
}
.tab-btn:hover { color: #2563EB; background: #F1F5F9; }
.tab-btn.active { color: #2563EB; border-bottom-color: #2563EB; }
.tab-btn.active-orange { color: #F97316; border-bottom-color: #F97316; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   TABELLA DATI
   ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: .6rem;
  border: 1px solid #E2E8F0;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table thead th {
  background: #F8FAFC;
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1.5px solid #E2E8F0;
  white-space: nowrap;
}
.data-table thead th input.col-filter {
  display: block;
  margin-top: .3rem;
  width: 100%;
  padding: .25rem .5rem;
  border: 1px solid #CBD5E1;
  border-radius: .3rem;
  font-size: .78rem;
  font-weight: 400;
  color: #1E293B;
  background: #fff;
  outline: none;
}
.data-table thead th input.col-filter:focus { border-color: #2563EB; }
.data-table tbody tr { border-bottom: 1px solid #F1F5F9; transition: background .1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody td { padding: .75rem 1rem; color: #374151; vertical-align: middle; }
.data-table .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.data-table .no-data {
  text-align: center;
  color: #94A3B8;
  padding: 2.5rem 1rem;
  font-style: italic;
}

/* ============================================================
   MAPPA
   ============================================================ */
#map-container {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}
#map {
  flex: 1;
  height: 100%;
  z-index: 1;
}
.map-sidebar {
  width: 340px;
  min-width: 280px;
  max-width: 380px;
  background: #fff;
  border-left: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
}
.map-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}
.map-sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: .5rem;
}
.map-sidebar-list { overflow-y: auto; flex: 1; }

/* Filtri categoria mappa */
.cat-filters {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .6rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  background: #fff;
}
.cat-btn {
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 1.5px solid #CBD5E1;
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: #475569;
}
.cat-btn:hover  { border-color: #2563EB; color: #2563EB; background: #EFF6FF; }
.cat-btn.active { background: #2563EB; color: #fff; border-color: #2563EB; }
.cat-btn.active-ristorante { background: #EF4444; border-color: #EF4444; color: #fff; }
.cat-btn.active-bar        { background: #F97316; border-color: #F97316; color: #fff; }
.cat-btn.active-stabilimento { background: #06B6D4; border-color: #06B6D4; color: #fff; }
.cat-btn.active-attivita   { background: #8B5CF6; border-color: #8B5CF6; color: #fff; }

/* Provider card nella sidebar mappa */
.provider-list-item {
  padding: .85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background .1s;
}
.provider-list-item:hover { background: #F8FAFC; }
.provider-list-item.selected { background: #EFF6FF; border-left: 3px solid #2563EB; }
.provider-list-item .prov-name {
  font-weight: 700;
  font-size: .9rem;
  color: #0F172A;
}
.provider-list-item .prov-meta {
  font-size: .78rem;
  color: #64748B;
  margin-top: .15rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.provider-list-item .prov-coupon-count {
  background: #DBEAFE;
  color: #1D4ED8;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
}

/* Pannello dettaglio provider (sopra alla mappa su mobile, sidebar su desktop) */
.provider-detail-panel {
  background: #fff;
  border-radius: .875rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  padding: 1.5rem;
  max-width: 460px;
  width: 100%;
}
.provider-detail-panel .prov-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: .3rem;
}

/* ============================================================
   COUPON CARD (stile ticket)
   ============================================================ */
.coupon-card {
  border: 2px dashed #CBD5E1;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 1rem;
}
.coupon-card:hover { border-color: #F97316; box-shadow: 0 4px 16px rgba(249,115,22,.1); }
.coupon-card.redeemed {
  opacity: .6;
  border-color: #E2E8F0;
  background: #F8FAFC;
}
.coupon-card .coupon-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: .3rem;
}
.coupon-card.redeemed .coupon-title { text-decoration: line-through; color: #94A3B8; }
.coupon-card .coupon-desc  { font-size: .85rem; color: #475569; margin-bottom: .5rem; }
.coupon-card .coupon-cond  { font-size: .78rem; color: #64748B; font-style: italic; }
.coupon-card .coupon-expiry{ font-size: .75rem; color: #94A3B8; margin-top: .4rem; }
.coupon-card .coupon-badge-validity {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: .68rem;
  font-weight: 700;
  background: #F97316;
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
}

/* Codice QR / display codice */
.qr-code-display {
  background: #0F172A;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: .15em;
  padding: .75rem 1.5rem;
  border-radius: .5rem;
  text-align: center;
  margin: .75rem 0;
  user-select: all;
  overflow: hidden;
  word-break: break-all;
}
.qr-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .5rem;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: .5rem;
  display: inline-block;
}
.qr-image-wrap img { display: block; }

/* ============================================================
   ALERT / TOAST
   ============================================================ */
.alert {
  padding: .85rem 1.1rem;
  border-radius: .6rem;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border: 1px solid transparent;
}
.alert-info    { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.alert-success { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-danger  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

/* Toast fisso in basso a destra */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: #0F172A;
  color: #F8FAFC;
  padding: .85rem 1.25rem;
  border-radius: .6rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  font-size: .88rem;
  font-weight: 500;
  max-width: 320px;
  animation: slideInToast .25s ease;
  pointer-events: all;
  border-left: 4px solid #2563EB;
}
.toast.success { border-left-color: #22C55E; }
.toast.error   { border-left-color: #EF4444; }
.toast.warning { border-left-color: #F97316; }
@keyframes slideInToast {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; color: #0F172A; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #94A3B8;
  cursor: pointer;
  line-height: 1;
  padding: .2rem .5rem;
  border-radius: .3rem;
  transition: color .15s;
}
.modal-close:hover { color: #0F172A; }
.modal-body   { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #F1F5F9;
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Hero: sfondo azzurro chiarissimo #EFF6FF */
.hero {
  background: #EFF6FF;
  padding: 5.5rem 1.5rem 5rem;
  text-align: center;
  position: relative;
}
.hero-content { max-width: 760px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 900;
  line-height: 1.18;
  margin-bottom: 1.25rem;
  letter-spacing: -.025em;
}
.hero-h1-dark { color: #1E3A5F; display: block; }
.hero-h1-blue { color: #2563EB; display: block; }

.hero .subtitle {
  font-size: 1.05rem;
  color: #475569;
  margin-bottom: 2.5rem;
  line-height: 1.75;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.hero .hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Bottoni hero */
.btn-hero-visitor {
  background: #2563EB;
  color: #fff;
  padding: .85rem 2rem;
  border-radius: .6rem;
  font-size: .975rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.btn-hero-visitor:hover { background: #1D4ED8; transform: translateY(-1px); text-decoration: none; }

.btn-hero-provider {
  background: #F97316;
  color: #fff;
  padding: .85rem 2rem;
  border-radius: .6rem;
  font-size: .975rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.btn-hero-provider:hover { background: #ea6c0a; transform: translateY(-1px); text-decoration: none; }

/* Stat bar sotto hero */
.hero-stats {
  background: #fff;
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid #E2E8F0;
}
.hero-stats-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  text-align: center;
}
.hero-stat-item {
  padding: 1rem 1.5rem;
  border-right: 1px solid #E2E8F0;
}
.hero-stat-item:last-child { border-right: none; }
.hero-stat-item .hero-stat-num {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: .35rem;
}
.hero-stat-item .hero-stat-label {
  font-size: .78rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Sezione "Come funziona" — 3 card */
.features-section {
  padding: 5rem 1.5rem;
  background: #F8FAFC;
}
.features-section h2 {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: .6rem;
  letter-spacing: -.02em;
}
.features-section .section-sub {
  text-align: center;
  color: #64748B;
  font-size: 1rem;
  margin-bottom: 3rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.feature-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2.25rem 1.75rem;
  border: 1.5px solid #E2E8F0;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(37,99,235,.1);
  border-color: #BFDBFE;
}
.feature-card .icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: #2563EB;
}
.feature-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563EB;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  margin-bottom: .85rem;
}
.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: .5rem;
}
.feature-card p { font-size: .9rem; color: #64748B; line-height: 1.65; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #EFF6FF 0%, #F1F5F9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.auth-card-header {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  color: #fff;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.auth-card-header .auth-logo { font-size: 1.5rem; font-weight: 900; margin-bottom: .25rem; }
.auth-card-header p { font-size: .9rem; opacity: .85; }
.auth-card-body { padding: 1.75rem 1.5rem; }

.role-toggle {
  display: flex;
  background: #F1F5F9;
  border-radius: .5rem;
  padding: .25rem;
  margin-bottom: 1.5rem;
}
.role-toggle button {
  flex: 1;
  padding: .5rem;
  border: none;
  border-radius: .35rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #64748B;
  transition: all .15s;
}
.role-toggle button.active-visitor  { background: #2563EB; color: #fff; }
.role-toggle button.active-provider { background: #F97316; color: #fff; }

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: .875rem;
  color: #64748B;
}
.auth-switch a { color: #2563EB; font-weight: 600; }

.demo-logins {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #E2E8F0;
}
.demo-logins p { font-size: .78rem; color: #94A3B8; text-align: center; margin-bottom: .6rem; }
.demo-logins .demo-btns { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dash-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}
.dash-layout-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}

/* Profilo visitor */
.profile-card {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  color: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}
.profile-info { min-width: 0; flex: 1; }
.profile-info .name  { font-size: 1.2rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-info .email { font-size: .85rem; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-info .role-badge {
  display: inline-block;
  margin-top: .35rem;
  background: rgba(255,255,255,.2);
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 1.5px solid #CBD5E1;
  border-radius: .5rem;
  padding: .4rem .75rem;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: #2563EB; }
.search-bar input {
  border: none;
  outline: none;
  font-size: .9rem;
  flex: 1;
  background: transparent;
  color: #1E293B;
}
.search-bar .search-icon { color: #94A3B8; font-size: 1rem; }

/* ============================================================
   SCAN QR BOX
   ============================================================ */
.qr-scan-box {
  background: #F8FAFC;
  border: 2px dashed #CBD5E1;
  border-radius: .875rem;
  padding: 2rem;
  text-align: center;
}
.qr-scan-box h3    { font-size: 1rem; font-weight: 700; color: #0F172A; margin-bottom: .5rem; }
.qr-scan-box p     { font-size: .85rem; color: #64748B; margin-bottom: 1rem; }
.qr-scan-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: .6rem;
  font-weight: 600;
  font-size: .9rem;
}
.qr-scan-result.success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.qr-scan-result.error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

/* ============================================================
   FOOTER — 3 colonne: logo+desc | link rapidi | contatti
   ============================================================ */
.site-footer {
  background: #0F172A;
  color: #94A3B8;
  font-size: .875rem;
}
.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}
.site-footer .footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.site-footer .footer-brand .logo-icon-box {
  width: 34px;
  height: 34px;
  background: #2563EB;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.site-footer .footer-brand .logo-name {
  font-size: 1rem;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: -.01em;
}
.site-footer .footer-brand p {
  color: #64748B;
  font-size: .84rem;
  line-height: 1.65;
  max-width: 280px;
}
.site-footer .footer-col h4 {
  font-size: .78rem;
  font-weight: 700;
  color: #E2E8F0;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}
.site-footer .footer-col ul { list-style: none; padding: 0; margin: 0; }
.site-footer .footer-col ul li { margin-bottom: .55rem; }
.site-footer .footer-col ul li a {
  color: #64748B;
  font-size: .875rem;
  text-decoration: none;
  transition: color .15s;
}
.site-footer .footer-col ul li a:hover { color: #CBD5E1; text-decoration: none; }
.site-footer .footer-col .contact-line {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  color: #64748B;
  font-size: .875rem;
  margin-bottom: .6rem;
  line-height: 1.5;
}
.site-footer .footer-col .contact-line svg { flex-shrink: 0; margin-top: 1px; color: #475569; }
.site-footer .footer-bottom {
  border-top: 1px solid #1E293B;
  padding: 1.25rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .8rem;
  color: #475569;
}
.site-footer .footer-bottom a { color: #475569; text-decoration: none; }
.site-footer .footer-bottom a:hover { color: #94A3B8; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .features-grid              { grid-template-columns: 1fr 1fr; }
  .hero-stats-grid            { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-inner  { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  #map-container { flex-direction: column; height: auto; overflow-x: hidden; }
  #map           { height: 55vw; min-height: 280px; max-height: 420px; }
  .map-sidebar   { width: 100%; max-width: 100%; border-left: none; border-top: 1px solid #E2E8F0; max-height: 40vh; overflow-x: hidden; }
  .dash-layout, .dash-layout-wide { padding: 1rem .75rem; max-width: 100%; overflow-x: hidden; }
  .stats-row     { grid-template-columns: 1fr 1fr; }
  .modal-box     { max-height: 95vh; }
  .hero          { padding: 3.5rem 1rem 3rem; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-stat-item  { border-right: none; border-bottom: 1px solid #E2E8F0; }
  .hero-stat-item:last-child { border-bottom: none; }
  .site-footer .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 1.25rem; }
  .site-footer .footer-bottom { flex-direction: column; text-align: center; }
  .form-row      { grid-template-columns: 1fr; }
  /* Hero buttons: full-width stacked su mobile */
  .hero .hero-actions { flex-direction: column; align-items: stretch; gap: .75rem; }
  .btn-hero-visitor,
  .btn-hero-provider { width: 100%; justify-content: center; padding: .9rem 1.5rem; font-size: .9rem; min-height: 48px; }
  /* Profile card: stack verticale su mobile */
  .profile-card { flex-direction: column; text-align: center; gap: .75rem; padding: 1.25rem 1rem; }
  .profile-card .profile-avatar { width: 50px; height: 50px; margin: 0 auto; }
  .profile-card .profile-info { width: 100%; }
  .profile-card .profile-info .name { font-size: 1.1rem; white-space: normal; }
  .profile-card .profile-info .email { font-size: .78rem; white-space: normal; word-break: break-all; }
  .profile-card > div:last-child { margin-left: 0; text-align: center; width: 100%; }
  /* Header nav: compatto su mobile */
  .site-header { padding: .65rem 1rem; }
  .site-header .header-inner { gap: .5rem; }
  .site-header .logo { font-size: 1.1rem; }
  .site-header .logo span { display: none; }
  .site-header nav { gap: .25rem; flex-shrink: 1; min-width: 0; }
  .tab-btn { font-size: .78rem; padding: .35rem .5rem; white-space: nowrap; }
  /* Landing: nascondere link secondari, solo Accedi visibile */
  .site-header-white nav a:not(.btn-nav-primary) { display: none !important; }
  /* Profile card: data membro contenuta */
  .profile-card > div:last-child { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) {
  .stats-row     { grid-template-columns: 1fr; }
  .tabs-bar      { gap: 0; }
  .tab-btn       { padding: .55rem .85rem; font-size: .82rem; }
}

/* ============================================================
   LEAFLET CUSTOM OVERRIDES
   ============================================================ */
.leaflet-popup-content-wrapper {
  border-radius: .75rem !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.15) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content {
  margin: 0 !important;
  min-width: 220px;
  max-width: calc(100vw - 2rem);
}
.map-popup {
  padding: 1rem;
}
.map-popup .popup-name  { font-weight: 800; font-size: .95rem; color: #0F172A; margin-bottom: .2rem; }
.map-popup .popup-cat   { font-size: .75rem; color: #64748B; margin-bottom: .5rem; }
.map-popup .popup-desc  { font-size: .8rem;  color: #475569; margin-bottom: .75rem; line-height: 1.5; }
.map-popup .popup-footer{ display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.leaflet-control-zoom a {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}

/* ============================================================
   PENDING BANNER (provider non approvato)
   ============================================================ */
.pending-banner {
  background: #FEF9C3;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: .6rem;
  padding: .85rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.pending-banner .pending-icon { font-size: 1.2rem; }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-wrap { display: flex; align-items: center; gap: .6rem; }
.toggle-input { display: none; }
.toggle-label {
  width: 42px;
  height: 24px;
  background: #CBD5E1;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-input:checked + .toggle-label { background: #2563EB; }
.toggle-input:checked + .toggle-label::after { transform: translateX(18px); }

/* ============================================================
   MISC
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: 1.25rem 0;
}
.text-muted { color: #64748B; font-size: .875rem; }
.text-small { font-size: .82rem; }
.font-mono  { font-family: 'Courier New', Courier, monospace; }
.font-bold  { font-weight: 700; }
.rounded    { border-radius: .5rem; }
.rounded-full { border-radius: 999px; }
.shadow     { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.overflow-x-auto { overflow-x: auto; }

/* Spinner caricamento */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3rem;
  color: #64748B;
  font-size: .9rem;
}

/* Provider status colors in tables */
.status-approved { color: #15803D; font-weight: 700; }
.status-pending  { color: #A16207; font-weight: 700; }
.status-attivo   { color: #15803D; }
.status-riscattato { color: #1D4ED8; }
.status-scaduto  { color: #B91C1C; }
.status-cancellato { color: #64748B; }
