/* MareCalmo - area Business/Admin (pagine server-rendered).
   Stile "dashboard sobria": eredita i token della web app (app/static/styles.css)
   ma resta piatto/professionale (niente gradiente radiale né animazioni vistose).
   Caricato da _page() in app/business/web.py; usato anche da payments.py e admin.py. */

:root {
  --teal-50: #ecfeff;
  --teal-100: #cffafe;
  --teal-500: #0ea5a5;
  --teal-700: #0f766e;
  /* Alias retro-compat: nelle pagine business si usava --teal (= teal-700). */
  --teal: #0f766e;
  --bg: #f6fbfc;
  --ink: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --amber: #f59e0b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);
  --r-card: 16px;
  --r-tile: 12px;
  --r-chip: 10px;
  --r-pill: 999px;
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
               system-ui, 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);              /* sobrio: niente gradiente radiale */
  color: var(--ink);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Header condiviso ---------- */
.biz-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-top)) 18px 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 0.5px solid var(--border);
}
.biz-brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.biz-brand .biz-mark {
  width: 28px; height: 28px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; display: block;
  box-shadow: var(--shadow-sm);
}
.biz-brand .biz-mark svg { width: 100%; height: 100%; display: block; }
.biz-brand .biz-word {
  font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.biz-brand .biz-word b { font-weight: 800; color: var(--teal-700); }
.biz-brand .biz-word span { font-weight: 500; color: var(--muted); }
.biz-nav {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex-shrink: 0;
  padding: 7px; border-radius: var(--r-pill);   /* solo icona di default */
  border: 1px solid var(--border); background: #fff;
  color: var(--teal-700); font-size: 0.85rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.05s ease;
}
.biz-nav svg { flex-shrink: 0; }
.biz-nav:hover { box-shadow: var(--shadow); }
.biz-nav:active { transform: scale(0.96); }
/* L'etichetta "Mappa" compare solo sugli schermi grandi. */
.biz-nav-label { display: none; }
@media (min-width: 768px) {
  .biz-nav { padding: 7px 13px; }
  .biz-nav-label { display: inline; }
}

.wrap { max-width: 560px; margin: 0 auto; padding: 22px 18px 60px; }

h1 { color: var(--teal-700); font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin-top: 28px; }
h3 { color: var(--ink); }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
}
/* Accento laterale opzionale (coerente con .card della home): aggiungere class="accent". */
.card.accent { border-left: 4px solid var(--teal-500); }

/* ---------- Form ---------- */
label {
  display: block; font-size: 13px; font-weight: 600; color: var(--muted);
  margin: 10px 0 4px;
}
input, textarea, select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 165, 0.18);
}
textarea { min-height: 70px; resize: vertical; }

/* ---------- Bottoni ---------- */
button, .btn {
  display: inline-block; background: var(--teal-700); color: #fff; border: none;
  padding: 11px 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
button:hover, .btn:hover { filter: brightness(1.05); }
button:active, .btn:active { transform: scale(0.97); }
button:focus-visible, .btn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(14, 165, 165, 0.30);
}
button.secondary, .btn.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--border);
}
button.secondary:hover, .btn.secondary:hover { filter: none; background: #f8fafc; }

/* ---------- Tag di stato ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.tag-active { background: #dcfce7; color: #166534; }
.tag-pending { background: #fef3c7; color: #92400e; }
.tag-rejected { background: #fee2e2; color: #991b1b; }
.tag-expired { background: #e2e8f0; color: #475569; }

/* ---------- Utility ---------- */
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ok { color: #166534; font-size: 13px; }
.err { color: #991b1b; font-size: 13px; }

/* ---------- Piani prezzo ---------- */
.plans { display: grid; gap: 10px; }
.plan {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: #fff;
}
.plan b { font-size: 18px; }

/* ---------- Landing: hero, benefici, prezzi ---------- */
.lead {
  font-size: 16px; line-height: 1.5; color: var(--ink);
  margin: 6px 0 8px;
}
.benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.benefits li {
  position: relative; padding-left: 26px;
  font-size: 14px; line-height: 1.45;
}
.benefits li::before {
  content: "✓"; position: absolute; left: 4px; top: 0;
  color: var(--teal-700); font-weight: 800;
}

/* Prezzi stile "pricing table": 3 card affiancate (anche su mobile). */
.price-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  align-items: stretch; margin: 14px 0 8px;
}
.price-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 3px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 16px 9px 14px; box-shadow: var(--shadow-sm);
}
.price-card.featured {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 2px rgba(14, 165, 165, 0.16), var(--shadow);
}
.price-flag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--teal-700); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.price-name {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.price-amount { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.05; }
.price-amount span { font-size: 16px; font-weight: 700; margin-left: 1px; }
.price-per { font-size: 12px; color: var(--muted); }
.price-note {
  font-size: 11.5px; color: var(--muted); line-height: 1.35;
  margin: 5px 0 12px;
}
.price-card .btn {
  width: 100%; padding: 9px 8px; font-size: 14px;
  margin-top: auto; text-align: center;
}
.price-foot { margin: 6px 0 0; text-align: center; font-size: 12px; }
.steps { margin: 12px 0 0; text-align: center; font-size: 12.5px; }

/* Schermi molto stretti: alleggerisco le card senza spezzare l'affiancamento. */
@media (max-width: 360px) {
  .price-cards { gap: 7px; }
  .price-card { padding: 15px 6px 12px; }
  .price-amount { font-size: 26px; }
  .price-note { font-size: 11px; }
}

/* ---------- Campi specifici ---------- */
.field-help { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.tel-row { display: flex; gap: 8px; }
.tel-row select { width: 90px; flex: none; }
.badge-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-grid label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-pill);
  font-weight: 500; color: var(--ink); cursor: pointer;
}
.badge-grid input { width: auto; }
.orari-day {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.orari-day .d { width: 44px; font-weight: 600; font-size: 13px; }
.orari-day input[type=time] { width: auto; flex: none; padding: 6px 8px; }
.orari-day .closed { color: var(--muted); font-size: 13px; }
.slot-wrap { display: inline-flex; align-items: center; gap: 4px; }
/* La 1ª fascia va sempre a capo: occupa l'intera riga del giorno (flex-wrap),
   così giorno + «aperto» restano sopra e gli orari sotto. */
.orari-day .slot-first { flex-basis: 100%; margin-top: 3px; }
.slot-lbl { font-size: 11px; color: var(--muted); }
.charcount { font-size: 11px; color: var(--muted); text-align: right; }

/* ---------- Galleria foto ---------- */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery .ph {
  position: relative; width: 96px; height: 96px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border); background: #f1f5f9;
}
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; }
.gallery .ph button {
  position: absolute; top: 4px; right: 4px; width: 40px; height: 40px;
  padding: 0; border-radius: 8px; background: rgba(153, 27, 27, 0.92); color: #fff;
  font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ph-tag { position: absolute; left: 3px; bottom: 3px; font-size: 9px; padding: 1px 6px; }
.media-slot img {
  height: 64px; border-radius: 8px; border: 1px solid var(--border);
  vertical-align: middle; margin-right: 8px;
}

/* ---------- Modale di conferma riutilizzabile ---------- */
.mc-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: none; align-items: center; justify-content: center; padding: 18px;
  z-index: 1000;
}
.mc-overlay.show { display: flex; }
.mc-modal {
  background: #fff; border-radius: 14px; padding: 20px; max-width: 380px;
  width: 100%; box-shadow: var(--shadow-lg);
}
.mc-modal h3 { margin: 0 0 6px; font-size: 17px; }
.mc-modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.mc-modal .row { justify-content: flex-end; }

/* ---------- Pannello "Il tuo spazio" ---------- */
.panel-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.panel-top h1 { margin: 0 0 2px; }
.panel-email { margin: 0; font-size: 13px; word-break: break-all; }
.panel-actions { margin: 12px 0 0; }

/* Avvisi (verifica, abbonamento non attivo) - sostituisce gli stili inline. */
.notice {
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 13px; font-size: 12.5px; color: var(--muted); line-height: 1.45;
  margin: 12px 0;
}
.notice-warn { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.notice-warn strong { color: #7c2d12; }

/* Card riepilogo abbonamento */
.biz-summary { margin-top: 22px; }
.biz-summary-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.biz-summary-name { font-size: 17px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.meta-chip {
  font-size: 12px; color: var(--muted);
  background: #f1f5f9; border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 3px 10px;
}
.meta-chip b { color: var(--ink); font-weight: 700; }
.biz-summary-manage { margin: 12px 0 0; font-size: 13px; }

/* Card-sezione con intestazione (icona + titolo + sottotitolo) */
.card.section { margin-top: 12px; }
.section-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.section-ico {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-50); color: var(--teal-700);
}
.section-ico svg { width: 18px; height: 18px; }
/* Icona line inline (intestazioni, bottoni): eredita colore e si allinea al testo. */
.biz-ico { vertical-align: -0.18em; flex: none; }
h1 .biz-ico { vertical-align: -0.14em; }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.section-sub { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.35; }

/* Legenda compatta degli stati */
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; margin: 12px 0 6px;
}
