/* ==========================================================================
   C.S.I. · Centro Servizi Integrati — Ricalcolo Pensione
   Design system del clone
   ========================================================================== */

:root {
  --bg: #f8f3eb;
  --bg-soft: #fbf8f2;
  --surface: #ffffff;
  --surface-2: #efe8dc;
  --border: #e6decf;
  --border-strong: #d9cfbc;

  --fg: #0f2340;
  --fg-2: #1c2e4a;
  --body: #4b5566;
  --muted: #6b7280;

  --primary: #0c2340;
  --primary-hover: #14304f;
  --primary-soft: #e8ecf2;

  --success: #1c7a4e;
  --danger: #b42318;
  --danger-soft: #fdf1ef;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 35, 64, .05);
  --shadow-md: 0 10px 30px -18px rgba(15, 35, 64, .35);
  --shadow-lg: 0 24px 60px -30px rgba(15, 35, 64, .45);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 768px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header { padding: 20px 0 10px; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.brand span { font-weight: 700; }

.nav-link {
  font-size: 15px;
  color: #54607a;
  transition: color .15s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--fg); }

/* ---------- Typography ---------- */

.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg);
}

.display {
  font-size: clamp(31px, 7.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.028em;
  font-weight: 700;
  color: var(--fg);
}

.page-title {
  font-size: clamp(26px, 5.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--fg);
}

.lead {
  font-size: clamp(16px, 2.3vw, 19px);
  line-height: 1.58;
  color: var(--body);
  max-width: 34em;
}

/* ---------- Buttons ---------- */

.btn {
  --btn-h: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding: 0 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}

.btn svg { flex: 0 0 auto; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: #a8b3c2;
  color: #f4f6f9;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-outline:hover { border-color: #b9ad95; background: #fffdf9; }

.btn-sm { --btn-h: 48px; padding: 0 22px; font-size: 15.5px; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Landing ---------- */

.hero { padding-top: 26px; padding-bottom: 6px; }

.hero h1 { margin-top: 18px; }

.hero .lead { margin-top: 20px; }

.cta-row {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.info-card {
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid #eff0ec;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
  box-shadow: var(--shadow-sm);
}

.info-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-head svg { color: var(--fg); flex: 0 0 auto; }
.info-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.012em;
}

.info-card > p {
  margin-top: 10px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--body);
}

.logo-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.logo-tile {
  flex: 0 1 calc(50% - 7px);
  min-width: 148px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e9e2d5;
  border-radius: 10px;
}

/* marchi SPID ricostruiti */
/* marchi degli enti (immagini reali) */
.brand-mark {
  display: block;
  width: auto;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}
.brand-mark.namirial { max-width: 62%; }
.brand-mark.spiditalia { max-width: 68%; }
.brand-mark.infocert { max-width: 62%; }

.spid-badges .logo-tile .brand-mark { max-height: 44px; }

.spid-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  margin-top: 16px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
}

/* cover della sezione SPID, sull'impostazione visiva della hero */
.spid-cover {
  position: relative;
  margin: 16px 0 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #1f6fb2, #3aa0c8 55%, #7fd0e0);
}
.spid-cover .spid-banner {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}
.spid-cover-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 20px 18px;
  color: #fff;
  background: linear-gradient(to top, rgba(12, 35, 64, .9), rgba(12, 35, 64, .18) 62%, transparent);
}
.spid-cover-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .85;
}
.spid-cover-cap strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.spid-cover-cap span:last-child { font-size: 13.5px; line-height: 1.4; opacity: .88; }

.spid-banner-fallback {
  margin-top: 16px;
  border-radius: 10px;
  padding: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(115deg, #1f6fb2 0%, #3aa0c8 55%, #7fd0e0 100%);
  color: #fff;
}
.spid-banner-fallback .sb-big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.spid-banner-fallback .sb-cie { font-size: 20px; font-weight: 600; opacity: .95; }

/* segnaposto dei marchi se le immagini non sono pubblicate */
.logo-fallback { display: none; }
.logo-tile.is-missing .brand-mark { display: none; }
.logo-tile.is-missing .logo-fallback { display: flex; }

.fb-namirial { flex-direction: column; align-items: center; gap: 5px; }
.fb-namirial .fb-word { font-size: 13px; font-weight: 700; color: #1c1c1c; letter-spacing: -.01em; }
.fb-namirial .fb-word i { font-style: normal; color: #6d2a52; }

.fb-spiditalia { flex-direction: column; align-items: center; gap: 3px; }
.fb-spiditalia .fb-word { font-size: 20px; letter-spacing: -.02em; }
.fb-spiditalia .fb-word i { font-style: normal; font-weight: 600; color: #10233f; }
.fb-spiditalia .fb-word b { font-weight: 500; color: #1c6fd0; }
.fb-sub {
  width: 100%;
  padding-top: 3px;
  border-top: 2px solid #1c6fd0;
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: .22em;
  color: #1c6fd0;
  text-align: right;
}

.fb-infocert { flex-direction: row; align-items: center; gap: 8px; }
.fb-infocert .fb-word { font-size: 18px; font-weight: 700; color: #1b3a6b; }
.fb-infocert .fb-word b { color: #8a8f98; }

.mark { display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1; }
.mark-numeria { font-size: 11px; font-weight: 700; color: #2b3a55; letter-spacing: -.01em; }
.mark-numeria b { color: #1554b3; }
.chip-spid {
  display: inline-block;
  background: #1554b3;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 7px 3px;
  border-radius: 2px;
}
.mark-spiditalia { flex-direction: column; align-items: stretch; gap: 3px; }
.mark-spiditalia .wm { display: flex; align-items: baseline; justify-content: center; font-size: 23px; letter-spacing: -.02em; }
.mark-spiditalia .s1 { color: #10233f; font-weight: 600; }
.mark-spiditalia .s2 { color: #1c6fd0; font-weight: 500; }
.mark-spiditalia .sub {
  display: block;
  font-size: 6.5px;
  letter-spacing: .22em;
  color: #1c6fd0;
  font-weight: 600;
  border-top: 2px solid #1c6fd0;
  padding-top: 3px;
  width: 100%;
  text-align: right;
}
.mark-infocert { flex-direction: row; align-items: center; gap: 8px; }
.mark-infocert .n1 { font-size: 19px; font-weight: 700; color: #1b3a6b; letter-spacing: -.02em; }
.mark-infocert .n1 em { font-style: normal; color: #1c6fd0; }
.idbox {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #1c6fd0;
  border-radius: 4px;
  padding: 2px 6px 3px;
  letter-spacing: .04em;
}

.media-frame {
  margin: 34px 0 0;
  border-radius: 2px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 10%, #f2e6d4 0%, transparent 60%),
    linear-gradient(160deg, #e9e0d2, #d8dcd9 55%, #c9d2d6);
  aspect-ratio: 528 / 581;
  position: relative;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame.is-failed img { display: none; }
.media-frame .media-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  text-align: center;
  padding: 24px;
  color: #4a5568;
  font-size: 14px;
}
.media-fallback .mf-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .02em;
  box-shadow: var(--shadow-md);
}
.media-fallback p { max-width: 22em; margin: 0 auto; line-height: 1.5; }
.media-fallback strong { color: var(--fg); display: block; margin-bottom: 6px; font-size: 15px; }
.media-frame.is-failed .media-fallback { display: grid; }

.steps {
  display: grid;
  gap: 18px;
  margin: 34px 0 64px;
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step-card {
  background: var(--surface);
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-sm);
}
.step-card .step-icon { color: var(--fg); }
.step-card h3 {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.step-card p {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--body);
}

/* ---------- Wizard ---------- */

.wizard { padding: 14px 0 64px; }

.wizard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0 30px;
}
.stepper .s-item {
  padding-bottom: 10px;
  border-bottom: 2px solid #e3dacb;
  font-size: 14.5px;
  color: #6b7280;
  transition: color .15s ease, border-color .15s ease;
}
.stepper .s-item.is-active { border-color: var(--primary); color: var(--fg); font-weight: 600; }
.stepper .s-item.is-done { border-color: #a9b7c9; color: var(--fg); }

.field { margin-bottom: 18px; }

.fl {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
}

.input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e2dacb;
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 16.5px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="date"] { padding-right: 10px; }

.input::placeholder { color: #9aa2af; }

.input:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 35, 64, .1);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffbfa;
}

.help {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.help.is-error { color: var(--danger); }

.field-row { display: grid; gap: 18px; }
@media (min-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

input[type="file"] {
  width: 100%;
  height: 46px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #e2dacb;
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 15.5px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid #d9cfbc;
  border-radius: 6px;
  background: #faf7f1;
  color: var(--fg);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #f2ece1; }

.file-card {
  border: 1px solid #e2dacb;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
}
.file-card .file-label { font-size: 15.5px; font-weight: 500; color: var(--fg); }
.file-card .file-label span { font-weight: 400; color: var(--muted); }
.file-card .file-name { margin-top: 6px; font-size: 13.5px; color: var(--body); word-break: break-all; }

.check-card {
  display: grid;
  gap: 16px;
  margin-bottom: 30px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--fg);
}

.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1.5px solid #c9bfae;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background-color .12s ease, border-color .12s ease;
}
.check-row input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(42deg);
}
.check-row input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(12, 35, 64, .16);
}

.section-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
}

/* ---------- Moduli mandato / privacy (struttura dei moduli ACLI) ---------- */

.form-doc {
  margin-bottom: 24px;
  padding: 26px 26px 24px;
  background: #fff;
  border: 1px solid #e8e1d5;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.fd-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e8dfd0;
}
.fd-logo { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.fd-brand-sub {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.fd-enti p {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--body);
  text-align: right;
}

.fd-title {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.fd-ref {
  margin-top: 6px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--muted);
}

.fd-block { margin-top: 22px; }
.fd-block > h4 {
  padding-bottom: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8dfd0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg);
}
.fd-block > h4 b { color: var(--primary); }

.fd-grid { display: grid; gap: 12px; }
@media (min-width: 620px) {
  .fd-grid.two { grid-template-columns: 1fr 1fr; }
}

.fd-field { display: block; }
.fd-field > span {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
}
.fd-field input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid #cfc6b6;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  color: var(--fg);
  font-family: inherit;
}
.fd-field input:focus {
  outline: none;
  border-bottom-color: var(--primary);
  box-shadow: 0 2px 0 -1px var(--primary);
}
.fd-field input[readonly] {
  font-weight: 600;
  background: #faf7f1;
  border-radius: 4px 4px 0 0;
}

.fd-text { font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.fd-list { margin: 10px 0 0 18px; padding: 0; }
.fd-list li { margin-bottom: 5px; font-size: 14px; line-height: 1.55; color: var(--fg-2); }

.fd-yesno { display: flex; gap: 22px; margin-top: 8px; }
.fd-yesno label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
}
.fd-yesno input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

.fd-boxes { display: grid; gap: 14px; }
@media (min-width: 620px) {
  .fd-boxes { grid-template-columns: 1fr 1fr; }
}
.fd-box {
  padding: 14px 16px;
  background: #fbf8f2;
  border: 1px solid #e2dacb;
  border-radius: var(--radius-md);
}
.fd-box h5 {
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a5568;
}
.fd-firma-line {
  margin-top: 16px;
  padding-top: 6px;
  border-top: 1px solid #cfc6b6;
  font-size: 11.5px;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}
.fd-stamp {
  display: grid;
  place-items: center;
  height: 54px;
  margin-top: 12px;
  border: 1px dashed #cfc6b6;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a8a094;
}

.fd-consent {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fbf8f2;
  border: 1px solid #efe7da;
  border-radius: var(--radius-md);
}
.fd-consent h5 {
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
}

.preview-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.fd-sign {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed #e6decf;
}
.fd-date { font-size: 12.5px; color: var(--muted); }
.fd-note { margin-top: 10px; font-size: 12px; font-style: italic; color: var(--muted); }

@media (max-width: 560px) {
  .fd-enti p { text-align: left; }
  .form-doc { padding: 20px 18px; }
}

/* ---------- vecchi moduli (non più usati) ---------- */

.doc-card {
  margin-bottom: 22px;
  padding: 24px 24px 22px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.doc-head {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #f0eade;
}
.doc-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-head h3 {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.doc-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}

.doc-parties { display: grid; gap: 14px; margin-bottom: 18px; }
@media (min-width: 620px) {
  .doc-parties { grid-template-columns: 1.4fr 1fr; }
}
.party {
  padding: 14px 16px;
  background: #fbf8f2;
  border: 1px solid #efe7da;
  border-radius: var(--radius-md);
}
.party-label {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.party-grid { margin: 0; display: grid; gap: 8px; }
.party-grid > div { display: flex; justify-content: space-between; gap: 14px; font-size: 14.5px; }
.party-grid dt { color: var(--muted); }
.party-grid dd { margin: 0; font-weight: 600; color: var(--fg); text-align: right; }
.party-name { font-size: 15.5px; font-weight: 700; }
.party-note { margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--body); }
.doc-edit {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.doc-body { font-size: 15px; line-height: 1.6; color: var(--fg-2); }
.doc-body p + p { margin-top: 10px; }
.doc-body ul { margin: 10px 0 10px 18px; padding: 0; }
.doc-body li { margin-bottom: 4px; }

.sign-block {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed #e6decf;
}
@media (min-width: 560px) {
  .sign-block { grid-template-columns: 1fr 1.2fr; align-items: end; }
}
.sign-place > span,
.sign-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.sign-place strong { font-size: 15px; font-weight: 600; }
.sign-echo { font-size: 17px; font-style: italic; }
.doc-consent { margin-top: 18px; padding-top: 16px; border-top: 1px solid #f0eade; }
.consents { display: grid; gap: 14px; margin-top: 18px; }
.consents em { font-style: normal; font-size: 13px; color: var(--muted); }

.opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e2dacb;
  border-radius: var(--radius-md);
  font-size: 16.5px;
  color: var(--fg);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.opt:hover { border-color: #c9bfae; }
.opt.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

.spid-panel {
  margin: 2px 0 26px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.spid-panel p {
  font-size: 16.5px;
  line-height: 1.52;
  color: #24334d;
}

.spid-visual {
  margin-top: 16px;
  border-radius: 10px;
  padding: 16px 18px;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(115deg, #2a7fb8 0%, #3aa0c8 45%, #7fd0e0 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.spid-visual .sv-title { font-size: 13px; letter-spacing: .16em; font-weight: 700; text-transform: uppercase; opacity: .95; }
.spid-visual .sv-sub { margin-top: 6px; font-size: 11.5px; opacity: .85; letter-spacing: .02em; }
.spid-visual .sv-chip {
  width: 34px; height: 26px;
  border-radius: 5px;
  background: linear-gradient(135deg, #f4e6a8, #d8c37a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.spid-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.spid-badges .logo-tile {
  flex: 1 1 30%;
  min-width: 120px;
  min-height: 52px;
  background: #fff;
  border-color: #e5ddce;
  transform: scale(.98);
}

.spid-panel p.spid-note {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #5c6572;
}

.wizard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Calendario ---------- */

.cal {
  width: 100%;
  max-width: 400px;
  padding: 18px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cal-nav {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  color: var(--fg);
}
.cal-nav:hover:not(:disabled) { background: #faf7f1; }
.cal-nav:disabled { color: #c3c7ce; cursor: not-allowed; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  padding: 6px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.day {
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  color: var(--fg);
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.day:hover:not(:disabled) { background: #f3eee4; }
.day.is-empty { visibility: hidden; }
.day:disabled { color: #c3c7ce; cursor: not-allowed; }
.day.is-today { background: #f1ece3; }
.day.is-selected { background: var(--primary); color: #fff; }
.day.is-selected:hover { background: var(--primary); }

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.slot {
  height: 46px;
  border: 1px solid #e2dacb;
  border-radius: 10px;
  background: #fff;
  font-size: 16.5px;
  color: var(--fg);
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.slot:hover:not(:disabled) { border-color: #c9bfae; }
.slot.is-selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled { color: #c3c7ce; background: #fbf9f4; cursor: not-allowed; }
.slot.is-off { font-size: 12.5px; line-height: 1.2; padding: 0 8px; white-space: normal; }

/* ---------- gestione fasce nel CRM ---------- */

.slot-form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 8px; }
.slot-form label { display: block; }
.slot-form span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #4a5568; }
.weekday-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.weekday-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--fg); }
.weekday-row input { accent-color: var(--primary); }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slot-chip {
  padding: 8px 12px;
  border: 1px solid #e2dacb;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--fg);
  cursor: pointer;
}
.slot-chip.is-closed { background: #fbf9f4; color: #b6bcc6; border-style: dashed; text-decoration: line-through; }
.slot-chip.is-booked { background: #eef1f5; color: #34425c; border-color: #d7dde6; cursor: not-allowed; }

.summary {
  margin-top: 26px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.summary h4 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.summary p {
  margin: 6px 0;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--fg-2);
}
.summary strong { font-weight: 600; color: var(--fg); }

/* ---------- Successo ---------- */

.receipt { padding: 26px 0 10px; }

.receipt-badge {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  margin-bottom: 22px;
}

.receipt-grid {
  margin-top: 26px;
  padding: 22px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.receipt-grid dl { margin: 0; display: grid; gap: 12px; }
.receipt-grid .row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 16px;
}
.receipt-grid dt { color: var(--muted); }
.receipt-grid dd { margin: 0; color: var(--fg); font-weight: 500; text-align: right; }

.receipt-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Login ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px 20px;
}
.auth-wrap:has(.reserved.is-open) {
  justify-content: flex-start;
  padding-top: 72px;
}
.auth { width: 100%; max-width: 640px; text-align: center; }

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
}
.auth h1 {
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.028em;
}
.auth .auth-sub {
  margin-top: 10px;
  font-size: 17px;
  color: var(--body);
}
.auth-card {
  margin-top: 34px;
  padding: 30px 30px 26px;
  background: #fff;
  border: 1px solid #f0ebe1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: left;
}

.btn-google {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #efeae1;
  color: #3f4550;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn-google:hover { background: #e8e2d7; }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  font-size: 12px;
  letter-spacing: .06em;
  color: #8b929e;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ece6da;
}

.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b929e;
  pointer-events: none;
}
.input-wrap input { padding-left: 44px; height: 48px; }

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
}
.label-row a { font-size: 15px; font-weight: 400; color: #54607a; }
.label-row a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

.auth-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 16px;
  color: var(--body);
}
.auth-foot a { color: var(--fg); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-note {
  margin-top: 26px;
  font-size: 13px;
  color: #8b929e;
  text-align: center;
}

/* accesso operatore con OTP */
.otp-info {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--body);
}
.otp-input {
  height: 54px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .32em;
  padding-left: 14px;
}
.otp-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.linkish {
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  color: #54607a;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--fg); }

/* area riservata */
.reserved { display: none; }
.reserved.is-open { display: block; }

.booking-list { display: grid; gap: 12px; margin-top: 18px; }
.booking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-md);
  text-align: left;
}
.booking-item .bi-when { font-size: 16px; font-weight: 600; }
.booking-item .bi-who { margin-top: 4px; font-size: 14px; color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: #eef1f5;
  color: #34425c;
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- CRM operatore ---------- */

.crm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  margin-bottom: 8px;
}
.crm-wrap {
  margin-top: 8px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.crm-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
}
.crm-table th {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fbf8f2;
  border-bottom: 1px solid #f0eade;
}
.crm-table td {
  padding: 12px 14px;
  vertical-align: top;
  color: var(--fg-2);
  border-bottom: 1px solid #f5f0e6;
}
.crm-table tr:last-child td { border-bottom: 0; }
.crm-name { font-weight: 600; color: var(--fg); }
.crm-sub { font-size: 12.5px; color: var(--muted); }
.crm-empty { padding: 20px; font-size: 14px; color: var(--muted); }
.crm-status {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e2dacb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--fg);
}

/* ---------- shell del CRM ---------- */

.crm-head {
  background: #fff;
  border-bottom: 1px solid #ece5d8;
  padding: 18px 0;
}
.crm-head-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.crm-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.crm-title {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.crm-user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--body); }

.crm-tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #ece5d8;
  background: #fff;
}
.crm-tab {
  padding: 14px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.crm-tab:hover { color: var(--fg); }
.crm-tab.is-active { color: var(--fg); font-weight: 600; border-bottom-color: var(--primary); }

/* ---------- shell con sidebar ---------- */

.crm-shell { display: flex; align-items: stretch; min-height: 100vh; }
.crm-side {
  position: sticky;
  top: 0;
  flex: 0 0 250px;
  width: 250px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 14px;
  background: #fff;
  border-right: 1px solid #ece5d8;
}
.crm-brand { display: flex; align-items: center; gap: 10px; }
.crm-brand img { width: 150px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.crm-brand.has-logo span { display: none; }
.crm-brand span { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.crm-brand small { display: block; margin-top: 1px; font-size: 8.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.crm-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.crm-nav .crm-tab {
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.crm-nav .crm-tab:hover { background: #fbf8f2; color: var(--fg); }
.crm-nav .crm-tab.is-active { background: #f1ece3; color: var(--fg); font-weight: 600; }
.crm-side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0eade;
  font-size: 12.5px;
  color: var(--muted);
}
.crm-main { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .crm-shell { display: block; }
  .crm-side {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #ece5d8;
  }
  .crm-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .crm-side-foot { border-top: 0; padding-top: 0; }
}

.crm-main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 70px; }
.crm-panel { display: none; }
.crm-panel.is-active { display: block; }

.crm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crm-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2dacb;
  border-radius: 7px;
  background: #fff;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--fg);
}
.crm-row { cursor: pointer; }
.crm-row:hover td { background: #fbf8f2; }

.crm-detail {
  margin-top: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.crm-detail-grid { display: grid; gap: 20px; }
@media (min-width: 860px) {
  .crm-detail-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.crm-list { margin: 8px 0 0 16px; padding: 0; }
.crm-list li { font-size: 13.5px; line-height: 1.5; color: var(--fg-2); margin-bottom: 4px; }
.crm-detail h3 { letter-spacing: -0.02em; }

/* ---------- scheda pratica ---------- */

.progress { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.progress-step {
  flex: 1 1 150px;
  padding: 10px 12px;
  border: 1px solid #efe7da;
  border-radius: 10px;
  background: #fbf8f2;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.progress-step b { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.progress-step.done { background: #eef4ef; border-color: #cfe0d3; color: #1c7a4e; }
.progress-step.current { background: var(--primary); border-color: var(--primary); color: #fff; }

.doc-list { display: grid; gap: 8px; margin-top: 8px; }
.doc-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.35; color: var(--fg-2); }
.doc-item input { margin-top: 2px; accent-color: var(--primary); }

.comm-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.comm-item { padding: 10px 12px; border: 1px solid #efe7da; border-radius: 8px; background: #fbf8f2; font-size: 13px; color: var(--fg-2); }
.comm-item b { display: block; margin-bottom: 3px; font-size: 13.5px; color: var(--fg); }
.comm-form { margin-top: 12px; display: grid; gap: 8px; }

.crn-reg-grid, .crm-reg-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 10px; }
.crm-reg-slot { display: grid; gap: 8px; padding: 12px 14px; background: #fbf8f2; border: 1px solid #efe7da; border-radius: 10px; }
.crm-reg-slot > span { font-size: 12px; font-weight: 600; color: #4a5568; }

/* ---------- libreria template ---------- */

.tmpl-layout { display: grid; gap: 18px; margin-top: 16px; }
@media (min-width: 900px) {
  .tmpl-layout { grid-template-columns: 1fr 1fr; align-items: start; }
}
.tmpl-list { display: grid; gap: 10px; }
.tmpl-card {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 13px 15px;
  text-align: left;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: 12px;
  cursor: pointer;
}
.tmpl-card:hover { border-color: #d9cfbc; }
.tmpl-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12, 35, 64, .08); }
.tmpl-card b { display: block; font-size: 14px; color: var(--fg); }
.tmpl-card span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.chip {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f5;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #34425c;
}
.tmpl-preview { padding: 18px; background: #fff; border: 1px solid #eff0ec; border-radius: 12px; min-height: 220px; }
.tmpl-preview h4 { font-size: 15px; margin-bottom: 6px; }
.tmpl-preview pre { margin: 12px 0 0; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55; color: var(--fg-2); }

/* ---------- finestra documento ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 35, 64, .45);
}
.modal[hidden] { display: none; }
.modal-panel {
  width: min(860px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px -30px rgba(15, 35, 64, .6);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #ece5d8;
  background: #fbf8f2;
}
.modal-body { padding: 24px 26px 30px; overflow-y: auto; }

.doc-title { font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; }
.doc-ref { margin-top: 6px; font-size: 12.5px; font-style: italic; color: var(--muted); }
.doc-h { margin: 20px 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid #e8dfd0; padding-bottom: 5px; }
.doc-p { font-size: 14px; line-height: 1.6; color: var(--fg-2); margin-bottom: 8px; }
.doc-rows { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc-rows th, .doc-rows td { padding: 6px 8px; font-size: 13.5px; text-align: left; border-bottom: 1px solid #f0eade; }
.doc-rows th { width: 42%; color: var(--muted); font-weight: 600; }
.doc-vidim { display: grid; gap: 18px; margin-top: 26px; padding-top: 16px; border-top: 1px dashed #e2dacb; }
@media (min-width: 620px) { .doc-vidim { grid-template-columns: 1fr 1fr; align-items: end; } }
.doc-vidim strong { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stamp-box { padding: 14px; border: 1px dashed #c9bfae; border-radius: 8px; font-size: 12px; line-height: 1.45; color: #5c6572; text-align: center; }
.sign-line { padding-top: 26px; border-bottom: 1px solid #9a9285; font-size: 14px; font-style: italic; text-align: center; }

.doc-enti { margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid #e8dfd0; }
.doc-head2 { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid #e8dfd0; }
.doc-head2 .brand { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.doc-head2 .brand small { display: block; margin-top: 2px; font-size: 9px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.doc-head2 .enti { text-align: right; font-size: 11.5px; line-height: 1.45; color: var(--fg-2); }
.doc-enti strong { display: block; font-size: 13px; letter-spacing: .05em; }
.doc-enti span { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); text-align: right; }
.doc-attest { display: grid; gap: 14px; margin-top: 8px; }
@media (min-width: 620px) { .doc-attest { grid-template-columns: 1fr 1fr; } }
.doc-attest > div { padding: 14px 16px; border: 1px solid #efe7da; border-radius: 8px; background: #fbf8f2; }
.doc-attest strong { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.doc-list { margin: 8px 0 8px 18px; padding: 0; }
.doc-list li { margin-bottom: 5px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }

.studio-card {
  max-width: 640px;
  margin-top: 8px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.studio-card a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }


/* ---------- panoramica ---------- */

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 6px;
}
.kpi {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.kpi span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi strong { display: block; margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.kpi small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }

.chart-card {
  margin-top: 16px;
  padding: 18px 20px 14px;
  background: #fff;
  border: 1px solid #eff0ec;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.chart-title { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  margin-top: 14px;
}
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart-col i {
  display: block;
  width: 100%;
  max-width: 46px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #14304f, #0c2340);
  min-height: 3px;
}
.chart-col b { font-size: 11px; font-weight: 600; color: var(--fg); }
.chart-col em { font-style: normal; font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* ---------- stampa ---------- */

.print-only { display: none; }

@media print {
  body { background: #fff; }
  .crm-head, .crm-tabs, .crm-side, .crm-main, .toast, .modal, .wizard { display: none !important; }
  .print-only { display: block !important; }
  .print-doc { color: #000; font-size: 11.5pt; line-height: 1.5; }
  .print-doc h1 { margin: 0 0 4px; font-size: 17pt; letter-spacing: -0.01em; }
  .print-doc h2 { margin: 18px 0 6px; font-size: 12pt; text-transform: uppercase; letter-spacing: .06em; }
  .print-doc p { margin: 0 0 8px; }
  .print-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 10px; border-bottom: 2px solid #000; }
  .print-head small { display: block; font-size: 9.5pt; }
  .print-doc table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  .print-doc th, .print-doc td { border: 1px solid #999; padding: 6px 8px; font-size: 10.5pt; text-align: left; vertical-align: top; }
  .print-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 46px; }
  .print-sign div { flex: 1; padding-top: 6px; border-top: 1px solid #000; font-size: 9.5pt; text-align: center; }
}


/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  min-width: min(420px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 80;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* ---------- Utility ---------- */

.is-hidden { display: none !important; }
.stack-sm > * + * { margin-top: 10px; }

@media (max-width: 420px) {
  .wizard-actions { flex-direction: column-reverse; align-items: stretch; }
  .wizard-actions .btn { width: 100%; }
  .receipt-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- piè di pagina ---------- */

.site-footer {
  margin-top: 40px;
  padding: 26px 0 54px;
  border-top: 1px solid #ece5d8;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body);
}
.footer-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-studio { margin-top: 6px; font-size: 15px; color: var(--fg); }
.footer-lines { margin-top: 6px; }
.site-footer a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
