:root {
  --bg: #0f172a;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1e3a8a, var(--bg));
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.brand {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--primary);
  text-align: center;
}

.subtitle { margin: 8px 0 16px; font-size: 22px; }

.hint { color: var(--muted); font-size: 14px; line-height: 1.5; }

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
}

input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.btn {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { width: 100%; background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; width: 100%; }
.btn-link { background: none; color: var(--primary); padding: 6px 0; margin-top: 8px; }

.alert {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert ul { margin: 0; padding-left: 18px; }

.qr-wrap { display: flex; justify-content: center; margin: 16px 0; }
.qr-wrap img { border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: #fff; }

.secret {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  letter-spacing: 1px;
  word-break: break-all;
  text-align: center;
}

.steps { color: var(--muted); font-size: 14px; line-height: 1.7; padding-left: 20px; }

.status { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 15px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-on { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.inline-form .btn { margin-top: 0; }
.stacked { display: block; }

hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.wrap { white-space: pre-wrap; word-break: break-word; margin: 0; }

.method-title { margin: 18px 0 4px; font-size: 16px; }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 22px 0 6px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}
.divider span { padding: 0 12px; }

.recaptcha { margin: 14px 0; }

.foot { color: rgba(255, 255, 255, 0.6); font-size: 12px; }

/* =========================================================================
   APP SHELL (area autenticata con sidebar) — sovrascrive il layout centrato
   ========================================================================= */
body.app {
  display: block;
  padding: 0;
  background: #f1f5f9;
  color: var(--text);
}

.app .card { max-width: none; width: auto; padding: 18px 20px; margin: 0 0 16px; border-radius: 12px; box-shadow: 0 1px 3px rgba(2,6,23,.08); }
.app .card.narrow { max-width: 460px; }

.sidebar {
  position: fixed; top: 0; left: 0; width: 232px; height: 100vh;
  background: #0f172a; color: #cbd5e1; padding: 18px 12px; overflow-y: auto;
}
.side-brand { font-size: 20px; font-weight: 800; color: #fff; padding: 6px 10px 18px; }
.side-brand span { color: #60a5fa; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav .disabled {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 14px;
}
.side-nav a:hover { background: #1e293b; color: #fff; }
.side-nav a.on { background: #2563eb; color: #fff; }
.side-nav .ico { width: 18px; text-align: center; opacity: .9; }
.side-nav .disabled { color: #64748b; cursor: default; }
.side-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #64748b; padding: 16px 12px 6px; }

.app-main { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--border); padding: 14px 24px;
  position: sticky; top: 0; z-index: 5;
}
.page-title { font-size: 20px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; font-size: 14px; }
.role-badge { color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.role-admin { background: #7c3aed; }
.role-user { background: #2563eb; }
.role-sales { background: #0891b2; }

.content { padding: 20px 24px; flex: 1; }
.content-flash { margin: 16px 24px 0; }
.app-foot { padding: 14px 24px; color: var(--muted); font-size: 12px; }

.card-title { margin: 0 0 14px; font-size: 16px; }

/* Card a scomparsa (elemento nativo <details>, nessun JavaScript) */
details.collapse-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.collapse-card > summary::-webkit-details-marker { display: none; }
details.collapse-card > summary::before { content: '▸'; font-size: 13px; color: var(--muted, #64748b); transition: transform .15s ease; }
details.collapse-card[open] > summary::before { transform: rotate(90deg); }
details.collapse-card > summary .card-title { margin: 0; }
details.collapse-card > summary .collapse-hint { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted, #94a3b8); }
details.collapse-card[open] > summary .collapse-hint { display: none; }
details.collapse-card > summary:hover .card-title { text-decoration: underline; }
.collapse-body { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* KPI di riepilogo */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi-rating, .kpi-donut { display: flex; align-items: center; gap: 16px; }
.kpi-donut { flex-direction: column; text-align: center; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-sub { font-size: 13px; margin-top: 4px; }
.kpi-big { font-size: 30px; font-weight: 800; margin: 6px 0; }
.kpi-mini { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }

.rating-circle {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; border: 6px solid var(--g, #f59e0b); color: var(--g, #f59e0b); flex: none;
}
.grade-A { --g: #16a34a; } .grade-B { --g: #0891b2; } .grade-C { --g: #f59e0b; } .grade-D { --g: #ea580c; } .grade-F { --g: #dc2626; }

.donut { width: 90px; height: 90px; border-radius: 50%; background: conic-gradient(#16a34a calc(var(--val) * 1%), #e2e8f0 0); display: grid; place-items: center; }
.donut span { background: #fff; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }

/* Statistiche asset */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { text-align: center; }
.stat-num { font-size: 30px; font-weight: 800; }
.stat-num.warn { color: var(--danger); }
.stat-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table.companies, table.heatmap { width: 100%; border-collapse: collapse; font-size: 14px; }
table.companies th, table.heatmap th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.companies td, table.heatmap td { padding: 10px; border-bottom: 1px solid #f1f5f9; }
table.companies tr:hover td { background: #f8fafc; }
.c-name { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.heatmap td { text-align: center; font-variant-numeric: tabular-nums; }
.heatmap .row-lbl { text-align: left; font-weight: 600; }
.sev-crit { color: #dc2626; } .sev-high { color: #ea580c; } .sev-med { color: #d97706; } .sev-low { color: #16a34a; }

.grade-pill { display: inline-block; min-width: 22px; text-align: center; padding: 2px 8px; border-radius: 6px; color: #fff; font-weight: 700; background: var(--g, #64748b); }

/* Admin */
.row-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { margin: 0 0 6px; }
.row-form input, .row-form select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.row-form-action .btn { margin: 0; }

/* Form anagrafico a griglia (es. scheda azienda) */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .fld { display: flex; flex-direction: column; }
.form-grid .fld.col-2 { grid-column: span 2; }
.form-grid .fld.col-3 { grid-column: 1 / -1; }
.form-grid label { margin: 0 0 6px; font-size: 13px; color: var(--muted, #64748b); }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; width: 100%; font-family: inherit;
}
.form-grid textarea { min-height: 64px; resize: vertical; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.form-section-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #94a3b8); grid-column: 1 / -1; margin-top: 4px; }
@media (max-width: 820px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .fld.col-2, .form-grid .fld.col-3 { grid-column: 1 / -1; } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.inline-mini { display: inline; }
.inline-mini select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-mini { margin: 0; padding: 6px 10px; font-size: 12px; background: #f1f5f9; border: 1px solid var(--border); color: var(--text); }
.btn-mini-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #e2e8f0; color: #475569; margin-left: 4px; vertical-align: middle; }
.tag-warn { background: #fef3c7; color: #92400e; }

@media (max-width: 820px) {
  .sidebar { position: static; width: auto; height: auto; }
  .app-main { margin-left: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-sep, .side-nav .disabled { display: none; }
}

/* Admin: tab + gestione dati */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.admin-tabs a { padding: 8px 16px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.admin-tabs a.on { background: #fff; color: var(--primary); border-color: var(--border); border-bottom-color: #fff; }
.data-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-actions { margin: 8px 0 12px; }
.import-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-row input[type="file"] { font-size: 13px; }
.clear-form { margin-top: 10px; }
.demo-banner { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.demo-banner a { color: #1e40af; font-weight: 700; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cta-card .btn { margin: 0; }

/* =========================================================================
   SHOWROOM AI
   ========================================================================= */
.side-nav a.back-link { color: #93c5fd; font-size: 13px; }

.sh-hero { background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; border-radius: 14px; padding: 26px 28px; margin-bottom: 16px; }
.sh-hero h2 { margin: 6px 0 10px; font-size: 24px; }
.sh-hero p { color: #cbd5e1; margin: 0; max-width: 760px; line-height: 1.6; }
.sh-kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #93c5fd; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.orders-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }

ul.tick { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.tick li { padding-left: 24px; position: relative; font-size: 14px; }
ul.tick li::before { content: '✓'; position: absolute; left: 0; color: #16a34a; font-weight: 800; }

.roadmap { display: flex; gap: 10px; flex-wrap: wrap; }
.phase { flex: 1; min-width: 120px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.phase .ph-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e2e8f0; color: #475569; font-weight: 800; margin-bottom: 8px; }
.phase.done { border-color: #bbf7d0; background: #f0fdf4; } .phase.done .ph-n { background: #16a34a; color: #fff; }
.phase.now { border-color: #bfdbfe; background: #eff6ff; } .phase.now .ph-n { background: #2563eb; color: #fff; }
.phase b { display: block; font-size: 13px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.product-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fff; }
.p-cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.p-name { font-weight: 700; margin: 4px 0; }
.p-meta { font-size: 12px; color: var(--muted); }
.p-colors { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #94a3b8, #475569); display: inline-block; }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill-premium { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.pill-warn { background: #fef2f2; color: #991b1b; }
.pill-done { background: #dcfce7; color: #166534; }
.pill-now { background: #dbeafe; color: #1e40af; }
.pill-plan { background: #f1f5f9; color: #475569; }

.ai-tag { font-size: 10px; font-weight: 800; letter-spacing: .5px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; padding: 2px 7px; border-radius: 6px; vertical-align: middle; margin-left: 6px; }
.ai-tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ai-tips li { background: #f8fafc; border-left: 3px solid #7c3aed; padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 14px; }

table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv td { padding: 7px 0; border-bottom: 1px solid #f1f5f9; }
table.kv td:first-child { color: var(--muted); width: 48%; }
table.kv td:last-child { font-weight: 600; text-align: right; }

.trend { font-weight: 700; }
.trend-up { color: #16a34a; } .trend-down { color: #dc2626; } .trend-flat { color: #64748b; }

input.sz { width: 46px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 6px; text-align: center; font-size: 14px; }
.sz-h { text-align: center; }

.score-card { position: sticky; top: 76px; }
.score-gauge-wrap { text-align: center; margin-bottom: 14px; }
.score-gauge { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--c, #2563eb) calc(var(--val) * 1%), #e2e8f0 0); }
.score-gauge span { background: #fff; width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.score-gauge span b { font-size: 36px; font-weight: 800; }
.score-gauge span small { font-size: 12px; color: var(--muted); }
.score-grade { font-weight: 700; margin-top: 10px; }

.subscores { margin-top: 8px; }
.sub-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.sub-row > span:first-child { width: 150px; color: var(--muted); }
.sub-row > b { width: 34px; text-align: right; }
.bar { background: #e2e8f0; border-radius: 999px; height: 8px; flex: 1; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #2563eb; border-radius: 999px; }

.checks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.checks-title { margin: 16px 0 6px; font-size: 14px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.chk-ico { font-weight: 800; }
.chk-ok .chk-ico { color: #16a34a; } .chk-warn .chk-ico { color: #d97706; }

.twin-bar { position: relative; height: 12px; background: #e2e8f0; border-radius: 999px; }
.twin-bar .cur { position: absolute; left: 0; top: 0; height: 100%; background: #93c5fd; border-radius: 999px; }
.twin-bar .ideal { position: absolute; top: -2px; width: 3px; height: 16px; background: #0f172a; border-radius: 2px; }
.lg-cur, .lg-ideal { display: inline-block; width: 20px; height: 8px; border-radius: 4px; vertical-align: middle; }
.lg-cur { background: #93c5fd; } .lg-ideal { background: #0f172a; }

.story p { margin: 0 0 12px; line-height: 1.6; }

.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.bubble-user { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.bubble-ai { align-self: flex-start; background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
.chat-input-mock { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-mock input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.chat-input-mock .btn { margin: 0; }

.barchart { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 10px; }
.bc-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bc-bar { width: 100%; max-width: 46px; background: linear-gradient(#60a5fa, #2563eb); border-radius: 6px 6px 0 0; min-height: 4px; }
.bc-lbl { margin-top: 6px; font-size: 12px; color: var(--muted); }

.alerts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; }
.dot-lvl { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.alert-high .dot-lvl { background: #dc2626; } .alert-med .dot-lvl { background: #f59e0b; } .alert-low .dot-lvl { background: #16a34a; }

/* Il pannello Fashion Score va sotto la tabella su schermi medi/stretti */
@media (max-width: 1100px) {
  .orders-layout { grid-template-columns: 1fr; }
  .score-card { position: static; }
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}

/* --- Avviso di inattività / auto-logout --- */
.idle-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.55);
}
.idle-box {
  background: var(--card); color: var(--text);
  width: min(92vw, 420px); padding: 24px 24px 20px;
  border-radius: 14px; box-shadow: var(--shadow); text-align: center;
}
.idle-title { margin: 0 0 8px; font-size: 20px; }
.idle-text { margin: 0 0 18px; color: var(--muted); }
.idle-count { color: var(--danger); font-variant-numeric: tabular-nums; }
.idle-actions { display: flex; gap: 10px; justify-content: center; align-items: center; }
.idle-actions .btn-primary { width: auto; padding: 10px 18px; }
.idle-actions .idle-logout { width: auto; }
.idle-info { margin: -6px 0 18px; font-size: 12px; color: var(--muted); }
.bc-val { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--text); }

/* ===========================================================================
   Sezione "Abito su Misura AI" (/sumisura)
   =========================================================================== */
.mtm-hero { background: linear-gradient(135deg, #1c1917, #4c2c1a); }
.mtm-hero .sh-kicker { color: #f0b27a; }

.mtm-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mtm-phase { display: flex; gap: 12px; align-items: flex-start; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.mtm-phase .ph-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #4c2c1a; color: #fff; font-size: 13px; font-weight: 700;
}
.mtm-phase b { font-size: 14px; }
.mtm-phase p { margin: 4px 0 0; line-height: 1.5; }

.mtm-cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.mtm-cta-row .btn { width: auto; }

.mtm-config-form { flex-wrap: wrap; }
.mtm-config-form > div { min-width: 170px; }

.mtm-conf { display: flex; gap: 14px; align-items: flex-start; }
.mtm-conf p { margin: 4px 0 0; }
.mtm-swatch { flex: 0 0 56px; height: 56px; border-radius: 10px; border: 1px solid rgba(2, 6, 23, 0.15); box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.18); }
.mtm-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(2, 6, 23, 0.2); vertical-align: -1px; }

/* Palcoscenico 3D della prova virtuale */
.mtm-stage-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mtm-stage-head .muted { display: block; }
.mtm-stage-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Selettore di vista a segmenti */
.mtm-seg { display: inline-flex; background: #eef2f7; border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.mtm-segbtn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 7px;
}
.mtm-segbtn:hover { color: var(--text); }
.mtm-segbtn.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(2, 6, 23, 0.14); }

.mtm-togbtn {
  border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 9px;
}
.mtm-togbtn:hover { color: var(--text); border-color: #cbd5e1; }
.mtm-togbtn.on { background: #1e293b; border-color: #1e293b; color: #fff; }

.mtm-stage {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 380px;
  background:
    radial-gradient(70% 55% at 50% 12%, rgba(148, 163, 184, 0.30), transparent 70%),
    radial-gradient(120% 100% at 50% 100%, #0b0f16, #1b212c);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Vignettatura: stacca la figura dal fondo come in uno studio fotografico */
.mtm-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(78% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55));
}
.mtm-stage canvas { display: block; width: 100% !important; height: auto !important; cursor: grab; }
.mtm-stage canvas.grabbing { cursor: grabbing; }
.mtm-stage-fallback { color: #cbd5e1; font-size: 14px; padding: 40px 20px; text-align: center; }
.mtm-stage-hint { margin-top: 10px; }

/* Avanzamento della commessa */
.mtm-steps { display: flex; flex-direction: column; gap: 0; margin: 4px 0 12px; }
.mtm-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; position: relative; color: var(--muted); font-size: 14px; }
.mtm-step::before { content: ''; position: absolute; left: 6px; top: 22px; bottom: -6px; width: 2px; background: var(--border); }
.mtm-step:last-child::before { display: none; }
.mtm-step-dot { width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; border: 2px solid #cbd5e1; flex: 0 0 14px; }
.mtm-step.done { color: var(--text); }
.mtm-step.done .mtm-step-dot { background: var(--ok); border-color: var(--ok); }
.mtm-step.now { color: var(--text); font-weight: 700; }
.mtm-step.now .mtm-step-dot { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }

tr.row-on { background: #eff6ff; }

/* ===========================================================================
   SITO PUBBLICO DI PRESENTAZIONE (body.site)
   ---------------------------------------------------------------------------
   Direzione estetica scelta prima di scrivere il CSS (non di ripiego):
   impianto EDITORIALE / sartoriale — filetti al posto delle ombre, raggi quasi
   nulli, tipografia display grande, molto respiro, un solo accento.
   Coppia tipografica: Playfair Display (display) + Inter (testo), che è
   l'abbinamento associato a moda ed editoriale; etichette in monospace.
   Colore: neutri CALDI tinti di marca (inchiostro caldo su crema, non
   #000 su #fff) con accento ottone. Tutti i colori derivano da un'unica
   tinta --brand-hue in OKLCH: cambiando quel numero si ritinge tutto.
   Spaziature su griglia da 4px. Nessun valore esadecimale sparso nei blocchi.
   =========================================================================== */

/* --- font ospitati in locale (la CSP consente solo 'self') --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/static/vendor/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/vendor/fonts/playfair-display-latin.woff2') format('woff2');
}

body.site {
  /* tinta di marca: unica manopola da cui deriva tutta la palette */
  --brand-hue: 38;

  /* neutri caldi — mai nero puro né bianco puro */
  --ink: oklch(20% 0.014 var(--brand-hue));
  --ink-soft: oklch(34% 0.012 var(--brand-hue));
  --ink-mute: oklch(50% 0.014 var(--brand-hue));
  --paper: oklch(98.6% 0.008 var(--brand-hue));
  --paper-2: oklch(95.8% 0.012 var(--brand-hue));
  --line: oklch(88% 0.014 var(--brand-hue));
  --line-ink: oklch(20% 0.014 var(--brand-hue));

  /* accento ottone: quello chiaro solo per filetti e dettagli, quello
     profondo per gli sfondi che portano testo (contrasto ≥ 4.5:1) */
  --accent: oklch(62% 0.125 var(--brand-hue));
  --accent-deep: oklch(44% 0.115 var(--brand-hue));
  --on-ink: oklch(96% 0.010 var(--brand-hue));

  /* griglia di spaziatura da 4px */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* scala tipografica */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  --t-label: 11px;
  --t-sm: 14px;
  --t-base: 16px;
  --t-lg: 18px;
  --t-xl: clamp(19px, 1.3vw, 21px);
  --t-2xl: clamp(23px, 2.1vw, 29px);
  --t-3xl: clamp(28px, 3.1vw, 40px);
  --t-4xl: clamp(34px, 4.6vw, 58px);
  --t-5xl: clamp(42px, 6.2vw, 78px);

  --r: 2px;
  --r-lg: 4px;
  --measure: 1120px;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);

  display: block;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.site h1, body.site h2, body.site h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}
/* Solo i link senza classe ereditano il colore: con `body.site a` la regola
   (0,1,2) batteva per specificita' `.btn-cta` (0,1,0) e il testo del bottone
   principale finiva nero su nero. */
body.site a:not([class]) { color: inherit; }
body.site :focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
}

/* etichetta in monospace: ricorre in tutta la pagina come "voce di scheda" */
.eyebrow {
  font-family: var(--font-label);
  font-size: var(--t-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* --- testata --- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) clamp(var(--s-4), 5vw, var(--s-16));
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-logo {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none;
  /* Il colore va dichiarato: essendo un <a> CON classe non ricade più
     nell'ereditarietà di `a:not([class])`, e restava il blu di default
     del browser (#0000ee). */
  color: var(--ink);
}
.site-logo span { color: var(--accent-deep); }
.site-nav { display: flex; align-items: center; gap: clamp(var(--s-3), 2vw, var(--s-8)); }
.site-nav a {
  text-decoration: none; font-size: var(--t-sm); font-weight: 500;
  color: var(--ink-soft); transition: color 180ms var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.site-login {
  background: var(--ink); color: var(--on-ink);
  padding: var(--s-2) var(--s-4); border-radius: var(--r);
  font-weight: 600; cursor: pointer;
  transition: background 180ms var(--ease);
}
.site-nav a.site-login:hover { background: var(--accent-deep); color: var(--on-ink); }

/* --- hero: crema, tipografia grande, un filetto --- */
.hero {
  padding: clamp(var(--s-16), 8vw, var(--s-32)) clamp(var(--s-4), 5vw, var(--s-16)) clamp(var(--s-12), 6vw, var(--s-24));
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--measure); margin: 0 auto; }
.hero-kicker {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-deep);
  display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6);
}
.hero-kicker::after { content: ''; flex: 0 0 72px; height: 1px; background: var(--accent); }
.hero h1 {
  font-size: var(--t-5xl);
  max-width: 22ch;
  margin-bottom: var(--s-8);
}
.hero h1 em { font-style: italic; color: var(--accent-deep); }
.hero-lead {
  margin: 0 0 var(--s-10); font-size: var(--t-xl); color: var(--ink-soft);
  max-width: 60ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-12); }
.btn-cta {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: var(--t-sm);
  letter-spacing: 0.01em;
  padding: var(--s-4) var(--s-8); border-radius: var(--r);
  background: var(--ink); color: var(--on-ink);
  border: 1px solid var(--ink);
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
.btn-cta:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-cta-ghost { background: transparent; color: var(--ink); }
.btn-cta-ghost:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: var(--s-6);
  padding-top: var(--s-6); border-top: 1px solid var(--line);
}
.hero-badges span {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute);
}

/* --- fascia numeri: cifre in display, divise da filetti --- */
.numbers { padding: 0 clamp(var(--s-4), 5vw, var(--s-16)); border-bottom: 1px solid var(--line); }
.numbers-inner {
  max-width: var(--measure); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.numbers-inner div {
  padding: var(--s-10) var(--s-6) var(--s-10) 0;
  border-left: 1px solid var(--line);
  padding-left: var(--s-6);
}
.numbers-inner div:first-child { border-left: 0; padding-left: 0; }
.numbers-inner b {
  display: block; font-family: var(--font-display); font-size: var(--t-3xl);
  font-weight: 500; line-height: 1; margin-bottom: var(--s-2);
}
.numbers-inner span {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute);
}

/* --- sezioni --- */
.section { padding: clamp(var(--s-16), 8vw, var(--s-32)) clamp(var(--s-4), 5vw, var(--s-16)); }
.section-inner { max-width: var(--measure); margin: 0 auto; }
.section-dark { background: var(--ink); color: var(--on-ink); }
.section-title { font-size: var(--t-3xl); margin-bottom: var(--s-4); }
.section-lead { margin: 0 0 var(--s-16); color: var(--ink-mute); font-size: var(--t-lg); max-width: 62ch; }
.section-dark .section-lead { color: color-mix(in oklab, var(--on-ink) 72%, transparent); }

/* --- schede prodotto: due colonne, filetto di separazione --- */
.product {
  display: grid; grid-template-columns: 1.45fr 1fr;
  gap: clamp(var(--s-8), 5vw, var(--s-20));
  align-items: start;
  padding: var(--s-16) 0;
  border-top: 1px solid var(--line);
}
.product:first-of-type { border-top: 0; padding-top: 0; }
.product-tag {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-deep);
}
.product h3 { margin: var(--s-3) 0 var(--s-3); font-size: var(--t-4xl); }
.product-claim {
  margin: 0 0 var(--s-5); font-family: var(--font-display); font-style: italic;
  font-size: var(--t-xl); color: var(--ink-soft);
}
.product-text > p { color: var(--ink-soft); margin: 0 0 var(--s-4); max-width: 62ch; }
.product-list {
  list-style: none; padding: 0; margin: var(--s-8) 0 0;
  border-top: 1px solid var(--line);
}
.product-list li {
  padding: var(--s-4) 0 var(--s-4) var(--s-8);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm); color: var(--ink-soft); position: relative;
}
.product-list li b { color: var(--ink); font-weight: 600; }
.product-list li::before {
  content: ''; position: absolute; left: 0; top: calc(var(--s-4) + 0.7em);
  width: var(--s-5); height: 1px; background: var(--accent);
}
.product-for {
  font-size: var(--t-sm); color: var(--ink-mute);
  margin: var(--s-6) 0 0; padding-left: var(--s-4);
  border-left: 2px solid var(--accent);
}

/* scheda tecnica accanto al prodotto: sembra una distinta d'atelier */
.product-figure { position: sticky; top: calc(var(--s-16) + var(--s-4)); }
.spec {
  border: 1px solid var(--line-ink); border-radius: var(--r);
  background: var(--paper-2);
}
.spec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-ink);
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.spec-body { padding: var(--s-4) var(--s-5) var(--s-5); }
.spec-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s-4); padding: var(--s-3) 0;
  border-bottom: 1px dotted var(--line);
  font-size: var(--t-sm);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row span { color: var(--ink-mute); }
.spec-row b { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 500; }
.spec-meter { height: 2px; background: var(--line); margin-top: var(--s-2); }
.spec-meter i { display: block; height: 100%; background: var(--accent-deep); }

/* --- come si adotta: quattro passi numerati su fondo inchiostro --- */
.steps-grid {
  display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid color-mix(in oklab, var(--on-ink) 22%, transparent);
}
.step-card {
  padding: var(--s-8) var(--s-6) var(--s-10);
  border-left: 1px solid color-mix(in oklab, var(--on-ink) 22%, transparent);
}
.step-card:first-child { border-left: 0; padding-left: 0; }
.step-card .step-n {
  display: block; font-family: var(--font-display); font-size: var(--t-2xl);
  color: var(--accent); margin-bottom: var(--s-4);
}
.step-card b { display: block; margin-bottom: var(--s-2); font-size: var(--t-lg); font-weight: 600; }
.step-card p { margin: 0; color: color-mix(in oklab, var(--on-ink) 68%, transparent); font-size: var(--t-sm); }

/* --- azienda --- */
.azienda-grid {
  display: grid; grid-template-columns: 1.25fr 1fr;
  gap: clamp(var(--s-8), 5vw, var(--s-20)); align-items: start;
}
.azienda-grid p { color: var(--ink-soft); max-width: 60ch; }
.values { display: flex; flex-direction: column; }
.values > div { padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.values > div:last-child { border-bottom: 1px solid var(--line); }
.values b { display: block; margin-bottom: var(--s-1); font-family: var(--font-display); font-size: var(--t-lg); font-weight: 500; }
.values span { font-size: var(--t-sm); color: var(--ink-mute); }

/* --- fascia finale --- */
.cta-band {
  background: var(--ink); color: var(--on-ink);
  padding: clamp(var(--s-12), 6vw, var(--s-20)) clamp(var(--s-4), 5vw, var(--s-16));
  border-top: 1px solid color-mix(in oklab, var(--on-ink) 16%, transparent);
}
.cta-band-inner {
  max-width: var(--measure); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--s-8);
  align-items: center; justify-content: space-between;
}
.cta-band h2 { font-size: var(--t-3xl); margin-bottom: var(--s-2); }
.cta-band p { margin: 0; color: color-mix(in oklab, var(--on-ink) 72%, transparent); max-width: 58ch; }
.cta-band .btn-cta { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
.cta-band .btn-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* --- piede --- */
.site-foot {
  background: var(--ink); color: color-mix(in oklab, var(--on-ink) 62%, transparent);
  padding: clamp(var(--s-12), 6vw, var(--s-20)) clamp(var(--s-4), 5vw, var(--s-16)) 0;
}
.site-foot-grid {
  max-width: var(--measure); margin: 0 auto;
  display: grid; gap: var(--s-8);
  grid-template-columns: 1.7fr repeat(3, 1fr);
  padding-bottom: var(--s-10);
}
.site-foot h4 {
  color: var(--on-ink); font-family: var(--font-label); font-size: var(--t-label);
  text-transform: uppercase; letter-spacing: 0.16em; margin: 0 0 var(--s-4); font-weight: 400;
}
.site-foot a, .site-foot span {
  display: block; color: inherit; text-decoration: none;
  font-size: var(--t-sm); margin-bottom: var(--s-2);
  transition: color 180ms var(--ease);
}
.site-foot a:hover { color: var(--on-ink); }
.site-foot p { font-size: var(--t-sm); margin: var(--s-3) 0 0; max-width: 38ch; }
.site-logo-foot { color: var(--on-ink); }
.site-logo-foot span { color: var(--accent); }
.site-foot-bar {
  max-width: var(--measure); margin: 0 auto;
  border-top: 1px solid color-mix(in oklab, var(--on-ink) 16%, transparent);
  padding: var(--s-5) 0; font-size: var(--t-label);
  font-family: var(--font-label); letter-spacing: 0.08em;
}
.site-foot-bar span { display: inline; margin: 0; }
/* il link dell'informativa sta nella barra in fondo: va reso inline (i link del
   piede sono a blocco) e sottolineato, perche' deve essere facile da trovare */
.site-foot-bar a {
  display: inline; margin: 0; text-decoration: underline;
  text-underline-offset: 3px; letter-spacing: inherit;
}

/* --- Informativa privacy (/privacy) ---------------------------------------
   Pagina di solo testo: la misura si stringe rispetto a --measure (1120px, che
   e' giusta per una vetrina ma illeggibile per la prosa) e la tabella sfonda
   la colonna scorrendo in orizzontale. Stessi token e stessi stilemi del resto
   del sito: filetti da 1px, etichette monospace, un solo accento. */
.legal-inner { max-width: 78ch; }
.legal-h1 { font-size: var(--t-4xl); margin: var(--s-4) 0 var(--s-5); }
.legal-h2 {
  font-size: var(--t-2xl); margin: var(--s-16) 0 var(--s-4);
  padding-top: var(--s-6); border-top: 1px solid var(--line);
}
.legal-inner p { color: var(--ink-soft); margin: 0 0 var(--s-4); }
.legal-inner p.section-lead { color: var(--ink-mute); margin-bottom: var(--s-5); }
.legal-meta {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute);
}
.legal-small { font-size: var(--t-sm); }
.legal-inner p.legal-small { color: var(--ink-mute); }
/* I link della prosa devono vedersi. Serve `body.site` davanti: la regola
   `body.site a:not([class])` che fa ereditare il colore vale (0,2,2) e
   batterebbe un semplice `.legal-inner a:not([class])` (0,2,1). E' la stessa
   trappola di specificita' gia' pagata con .btn-cta (vedi design-system). */
body.site .legal-inner a:not([class]) {
  color: var(--accent-deep); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.legal code {
  font-family: var(--font-label); font-size: 0.88em;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1px 5px;
}

/* avviso "informativa da compilare": visibile solo finche' i dati del titolare
   mancano, e solo in sviluppo (in produzione il server non parte affatto) */
.legal-warn {
  border: 1px solid var(--accent-deep); border-left-width: 3px;
  background: color-mix(in oklab, var(--accent) 14%, var(--paper));
  padding: var(--s-4) var(--s-5); margin: var(--s-6) 0;
  border-radius: var(--r); font-size: var(--t-sm); color: var(--ink);
}

/* i tre casi (visitatore / utente / cliente di un'azienda) */
.legal-cases {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6); margin: var(--s-6) 0 var(--s-8);
}
.legal-cases article { border-top: 1px solid var(--line-ink); padding-top: var(--s-4); }
.legal-cases h3 { font-size: var(--t-xl); margin-bottom: var(--s-2); }
.legal-cases p { font-size: var(--t-sm); margin: 0; }
.legal-case-tag {
  font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: var(--s-2);
}

.legal-note {
  border-left: 3px solid var(--accent); background: var(--paper-2);
  padding: var(--s-5) var(--s-6); margin: var(--s-6) 0;
  border-radius: var(--r);
}
.legal-note p:last-child { margin-bottom: 0; }

/* tabella chiave/valore (titolare, responsabili) */
.legal-kv { width: 100%; border-collapse: collapse; margin: var(--s-4) 0 var(--s-6); }
.legal-kv td {
  padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: var(--t-sm); color: var(--ink-soft);
}
.legal-kv td:first-child {
  width: 34%; color: var(--ink-mute); font-family: var(--font-label);
  font-size: var(--t-label); letter-spacing: 0.08em; text-transform: uppercase;
  padding-top: calc(var(--s-3) + 3px);
}
.legal-kv td:last-child { padding-right: 0; }

/* tabella dei trattamenti: piu' larga della colonna di testo, scorre su mobile */
.legal-tablewrap { overflow-x: auto; margin: var(--s-6) 0; border-top: 1px solid var(--line-ink); }
.legal-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: var(--t-sm); }
.legal-table th {
  text-align: left; font-family: var(--font-label); font-size: var(--t-label);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute);
  font-weight: 400; padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.legal-table td {
  padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: 1px solid var(--line);
  vertical-align: top; color: var(--ink-soft);
}
.legal-table th:last-child, .legal-table td:last-child { padding-right: 0; }
.legal-rowhead td {
  background: var(--paper-2); color: var(--ink);
  border-bottom: 1px solid var(--line-ink);
  padding: var(--s-5) var(--s-4) var(--s-3) var(--s-3);
}
.legal-rowhead .legal-case-cell {
  font-family: var(--font-label); color: var(--accent-deep); width: 3em;
}
.legal-off { color: var(--ink-mute); font-style: italic; }
.legal-inner p.legal-after-table { font-size: var(--t-sm); }

/* elenco dei diritti: stesso trattino dell'elenco prodotti */
.legal-list { margin: 0 0 var(--s-4); padding-left: 0; list-style: none; }
.legal-list li {
  position: relative; padding-left: var(--s-6);
  margin-bottom: var(--s-3); color: var(--ink-soft);
}
.legal-list li::before {
  content: ''; position: absolute; left: 0; top: 0.72em;
  width: 12px; height: 1px; background: var(--accent);
}

.legal-back {
  margin-top: var(--s-16); padding-top: var(--s-6);
  border-top: 1px solid var(--line); font-family: var(--font-label);
  font-size: var(--t-label); letter-spacing: 0.1em; text-transform: uppercase;
}

/* --- responsive: 375 / 768 / 1024 / 1440 --- */
@media (max-width: 1024px) {
  .product, .azienda-grid { grid-template-columns: 1fr; }
  .product-figure { position: static; }
  .step-card { border-left: 0; padding-left: 0; border-top: 1px solid color-mix(in oklab, var(--on-ink) 22%, transparent); }
  .steps-grid { border-top: 0; }
}
@media (max-width: 768px) {
  .site-foot-grid { grid-template-columns: 1fr 1fr; }
  .numbers-inner div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .numbers-inner div:first-child { border-top: 0; }
  .legal-cases { grid-template-columns: 1fr; gap: var(--s-5); }
}
@media (max-width: 620px) {
  .site-nav a:not(.site-login) { display: none; }
  .site-foot-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body.site *, body.site *::before, body.site *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Maschera di inserimento/modifica di un singolo record (Amministrazione) --- */
.record-form .field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin-bottom: 8px;
}
.record-form .field { display: flex; flex-direction: column; gap: 5px; }
.record-form .field-wide { grid-column: 1 / -1; }
.record-form label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.record-form label .muted { font-weight: 400; }
.record-form input[type="text"],
.record-form input[type="number"],
.record-form textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.record-form input:focus, .record-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.record-form textarea { resize: vertical; }
.record-form .check-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 39px; font-weight: 400;
}
.record-form .check-row input { width: 18px; height: 18px; }
.actions-cell form { display: inline-block; margin-left: 6px; }

/* --- Agenda appuntamenti (vista mese e vista giorno) ----------------------
   Griglia a sette colonne fisse: le celle restano allineate anche quando un
   giorno ha piu' appuntamenti degli altri. */
.cal-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cal-nav { display: flex; gap: 6px; }
.cal-mese {
  font-size: 20px; font-weight: 700; color: var(--text);
  text-transform: capitalize; margin-right: auto;
}

.cal { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { background: #f8fafc; border-bottom: 1px solid var(--border); }
.cal-dow-cell {
  padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.cal-cell {
  display: block; min-height: 104px; padding: 6px 8px 8px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: inherit; text-decoration: none; background: #fff;
  transition: background 140ms ease;
}
.cal-row .cal-cell:last-child { border-right: 0; }
.cal-cell:hover { background: #f8fafc; }
.cal-out { background: #fcfcfd; }
.cal-out .cal-num { color: #cbd5e1; }
.cal-today { background: #eff6ff; }
.cal-today .cal-num {
  background: var(--primary); color: #fff; border-radius: 999px;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
}
.cal-num { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-ev {
  font-size: 11px; line-height: 1.35; padding: 2px 5px; margin-bottom: 2px;
  border-radius: 4px; background: #eef2ff; color: #3730a3;
  border-left: 3px solid var(--primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-ev-ora { font-weight: 700; }
.cal-ev-fatto { background: #ecfdf5; color: #065f46; border-left-color: var(--ok); }
.cal-ev-annullato { background: #f1f5f9; color: #94a3b8; border-left-color: #cbd5e1; text-decoration: line-through; }
.cal-more { font-size: 10px; color: var(--muted); padding-left: 5px; }

/* vista giorno: due colonne, la giornata e la scheda del cliente */
.agenda-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.day-grid { border-top: 1px solid var(--border); }
.day-row { display: grid; grid-template-columns: 58px 1fr; border-bottom: 1px solid #f1f5f9; min-height: 34px; }
.day-hour { font-size: 11px; color: var(--muted); padding: 7px 8px 0 0; text-align: right; }
.day-slot { padding: 4px 0; display: flex; flex-direction: column; gap: 4px; }
.day-ev {
  display: block; text-decoration: none; color: inherit;
  padding: 5px 9px; border-radius: 6px; font-size: 13px;
  background: #eef2ff; border-left: 3px solid var(--primary);
}
.day-ev:hover { filter: brightness(0.97); }
.day-ev.on { outline: 2px solid var(--primary); outline-offset: 1px; }
.day-ev .muted { margin-left: 6px; }
.day-ev-fatto { background: #ecfdf5; border-left-color: var(--ok); }
.day-ev-annullato { background: #f1f5f9; border-left-color: #cbd5e1; color: var(--muted); }

@media (max-width: 1100px) {
  .agenda-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cal-cell { min-height: 74px; }
  .cal-ev { font-size: 10px; }
}
.nowrap { white-space: nowrap; }
