/* eContact Contatti & Onboarding — v1.0.0
   Usa i token del tema (--ec-*) con fallback, chiaro/scuro. */

.eccf, .eccf-modal, .eccf-card {
  --eccf-green: var(--ec-green, #0B6B34);
  --eccf-green-dark: var(--ec-green-dark, #085229);
  --eccf-brand: var(--ec-brand, #00B140);
  --eccf-ink: var(--ec-ink, #0F1A12);
  --eccf-muted: var(--ec-gray-500, #56615A);
  --eccf-line: var(--ec-gray-200, #E2E8E0);
  --eccf-line-strong: var(--ec-gray-300, #C9D6C4);
  --eccf-soft: var(--ec-gray-50, #F9FAF8);
  --eccf-tint: var(--ec-green-light, #EAF3DE);
  --eccf-card: #fff;
  --eccf-danger: var(--ec-danger, #B42318);
  --eccf-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --eccf-font: var(--ec-font-primary, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-family: var(--eccf-font);
}

/* Pagina con la sezione: contenitore più largo del default (800px). */
body.eccf-wide .wp-block-post-content { max-width: 1200px; }

.eccf-sr, .eccf-hp {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.eccf-ico { flex: none; display: block; }

/* ── Layout ─────────────────────────────────── */
.eccf {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 28px;
  align-items: start;
  margin: 8px 0 24px;
}

/* ── Colonna canali (scura) ─────────────────── */
.eccf-side {
  position: sticky; top: 110px;
  background: #0F1A12;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(0,177,64,.16) 0%, rgba(0,177,64,0) 60%);
  color: #CBD5CE;
  border-radius: 24px;
  padding: 36px 32px 30px;
  overflow: hidden;
}
.eccf-kicker {
  margin: 0 0 12px !important;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--eccf-green);
}
.eccf-side .eccf-kicker { color: #3DDC84; }
.eccf .eccf-side__title,
.wp-block-post-content .eccf .eccf-side__title {
  display: block; border: 0; padding: 0;
  margin: 0 0 26px;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.18; letter-spacing: -.02em;
  font-weight: 800; color: #F1F5F2; text-wrap: balance;
}
.eccf-side__title em { font-style: normal; color: #3DDC84; }

.wp-block-post-content .eccf ul, .wp-block-post-content .eccf ol,
.eccf-modal ul { list-style: none; margin: 0; padding: 0; }
.wp-block-post-content .eccf li, .eccf-modal li { margin: 0; color: inherit; line-height: 1.5; }

.eccf-channels { display: grid; gap: 8px; }
.wp-block-post-content .eccf a.eccf-channel,
.eccf a.eccf-channel {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #26332A;
  background: rgba(255,255,255,.02);
  color: #E3EAE5; text-decoration: none; font-weight: 500;
  transition: border-color .25s ease, background-color .25s ease, transform .35s var(--eccf-ease);
}
.eccf a.eccf-channel:hover, .eccf a.eccf-channel:focus-visible {
  border-color: #3DDC84; background: rgba(0,177,64,.08); text-decoration: none; color: #fff;
  transform: translateX(3px);
}
.eccf-channel__ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(0,177,64,.14); color: #3DDC84;
}
.eccf-channel__body { display: flex; flex-direction: column; min-width: 0; }
.eccf-channel__body strong { color: #F1F5F2; font-size: .98rem; font-weight: 700; }
.eccf-channel__body small { color: #95A39A; font-size: .84rem; overflow-wrap: anywhere; }
.eccf-channel__go { margin-left: auto; color: #95A39A; transition: color .2s ease, transform .35s var(--eccf-ease); }
.eccf a.eccf-channel:hover .eccf-channel__go { color: #3DDC84; transform: translateX(3px); }

.eccf a.eccf-channel.eccf-channel--call, .wp-block-post-content .eccf a.eccf-channel.eccf-channel--call { background: #00B140; border-color: #00B140; color: #0F1A12; }
.eccf a.eccf-channel.eccf-channel--call:hover, .eccf a.eccf-channel.eccf-channel--call:focus-visible, .wp-block-post-content .eccf a.eccf-channel.eccf-channel--call:hover { background: #00C94A; border-color: #00C94A; color: #0F1A12; }
.eccf-channel--call .eccf-channel__ico { background: rgba(15,26,18,.14); color: #0F1A12; }
.eccf-channel--call .eccf-channel__body strong { color: #0F1A12; }
.eccf-channel--call .eccf-channel__body small { color: #123A1F; }
.eccf-channel--call .eccf-channel__go, .eccf a.eccf-channel--call:hover .eccf-channel__go { color: #0F1A12; }

.eccf-path { margin: 26px 0 22px; padding: 20px 0 0; border-top: 1px solid #26332A; }
.eccf-path__label { margin: 0 0 12px !important; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #95A39A; }
.eccf-path ol { display: grid; gap: 0; counter-reset: none; }
.wp-block-post-content .eccf .eccf-path li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 7px 0; color: #CBD5CE; font-size: .93rem;
}
.eccf-path li span {
  position: relative; z-index: 1;
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; color: #3DDC84;
  border: 1.5px solid #34443A; background: #0F1A12;
}
.eccf-path li:not(:last-child)::after {
  content: ""; position: absolute; left: 11.5px; top: 31px; height: calc(100% - 24px); width: 1px; background: #34443A;
}
.eccf-side__alt {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 10px 0 0 !important; font-size: .88rem; line-height: 1.55 !important; color: #95A39A;
}
.eccf-side__alt .eccf-ico { margin-top: 2px; color: #3DDC84; }
.eccf-side__alt > span { display: block; }
.wp-block-post-content .eccf .eccf-side__alt a, .eccf .eccf-side__alt a { color: #E3EAE5; font-weight: 600; text-decoration: underline; text-decoration-color: #34443A; text-underline-offset: 3px; }
.eccf .eccf-side__alt a:hover { color: #3DDC84; text-decoration-color: #3DDC84; }

/* ── Card form ──────────────────────────────── */
.eccf-card {
  background: var(--eccf-card);
  border: 1px solid var(--eccf-line);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(15,26,18,.04), 0 18px 50px -24px rgba(15,26,18,.18);
  padding: 10px 34px 32px;
  color: var(--eccf-ink);
}
.eccf-card--single { padding-top: 30px; }

.eccf-tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  margin: 0 -24px 26px;
  border-bottom: 1px solid var(--eccf-line);
}
.eccf-tabs button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font: inherit; text-align: left;
  padding: 20px 24px 18px;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--eccf-muted);
  transition: color .2s ease;
}
.eccf-tabs__t { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.eccf-tabs__s { font-size: .82rem; font-weight: 500; opacity: .85; }
.eccf-tabs button[aria-selected="true"] { color: var(--eccf-ink); }
.eccf-tabs button[aria-selected="true"] .eccf-tabs__t { color: var(--eccf-green); }
.eccf-tabs button:hover { color: var(--eccf-ink); }
.eccf-tabs button:focus-visible { outline: 2px solid var(--eccf-green); outline-offset: -4px; border-radius: 12px; }
.eccf-tabs__ink {
  position: absolute; bottom: -1px; left: 0; height: 3px; width: 50%;
  background: var(--eccf-green); border-radius: 3px 3px 0 0;
  transition: transform .5s var(--eccf-ease);
}
.eccf-tabs[data-active="attivazione"] .eccf-tabs__ink { transform: translateX(100%); }

.eccf-panel[hidden] { display: none; }
.eccf-panel.is-entering .eccf-form > * { animation: eccf-rise .55s var(--eccf-ease) both; }
.eccf-panel.is-entering .eccf-form > *:nth-child(5) { animation-delay: .04s; }
.eccf-panel.is-entering .eccf-form > *:nth-child(6) { animation-delay: .08s; }
.eccf-panel.is-entering .eccf-form > *:nth-child(7) { animation-delay: .12s; }
.eccf-panel.is-entering .eccf-form > *:nth-child(8) { animation-delay: .16s; }
.eccf-panel.is-entering .eccf-form > *:nth-child(n+9) { animation-delay: .2s; }
@keyframes eccf-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Campi ──────────────────────────────────── */
.eccf-form { margin: 0; }
.eccf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-bottom: 18px; }
.eccf-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.eccf-field--full { margin-bottom: 18px; }
.eccf-field label, .eccf-chips legend {
  font-size: .86rem; font-weight: 600; color: var(--eccf-ink); line-height: 1.3;
}
.eccf-req { color: var(--eccf-green); }
.eccf-form input[type="text"], .eccf-form input[type="email"], .eccf-form input[type="tel"],
.eccf-form select, .eccf-form textarea {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--eccf-ink);
  background: var(--eccf-soft);
  border: 1.5px solid var(--eccf-line);
  border-radius: 12px;
  box-shadow: none; outline: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none; appearance: none;
}
.eccf-form textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.eccf-form select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356615A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.eccf-form ::placeholder { color: #8A948D; opacity: 1; }
.eccf-form input:hover, .eccf-form select:hover, .eccf-form textarea:hover { border-color: var(--eccf-line-strong); }
.eccf-form input:focus, .eccf-form select:focus, .eccf-form textarea:focus {
  border-color: var(--eccf-green); background: #fff;
  box-shadow: 0 0 0 4px rgba(11,107,52,.12);
}
.eccf-field.has-error input, .eccf-field.has-error select, .eccf-field.has-error textarea { border-color: var(--eccf-danger); background: #FFF8F7; }
.eccf-err { font-size: .8rem; font-weight: 600; color: var(--eccf-danger); }

/* Step numerati (attivazione) */
.eccf-step { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 14px; }
.eccf-step:not(.eccf-step--first) { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--eccf-line); }
.eccf-step__n { font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: var(--eccf-green); font-variant-numeric: tabular-nums; }
.eccf-step__t { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; color: var(--eccf-ink); }

/* Chip (checkbox / radio) */
.eccf-chips { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.eccf-chips legend { padding: 0; margin-bottom: 10px; }
.eccf-chips__list { display: flex; flex-wrap: wrap; gap: 8px; }
.eccf-chip { position: relative; cursor: pointer; }
.eccf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.eccf-chip span {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 8px 15px;
  border: 1.5px solid var(--eccf-line); border-radius: 999px;
  font-size: .88rem; font-weight: 600; color: var(--eccf-ink); background: #fff;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
  user-select: none;
}
.eccf-chip span::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; flex: none;
  border: 1.5px solid var(--eccf-line-strong); background: #fff;
  transition: background-color .2s ease, border-color .2s ease;
}
.eccf-chips--radio .eccf-chip span::before { border-radius: 50%; }
.eccf-chip:hover span { border-color: var(--eccf-line-strong); }
.eccf-chip input:checked + span { border-color: var(--eccf-green); background: var(--eccf-tint); color: var(--eccf-green-dark); }
.eccf-chip input:checked + span::before {
  border-color: var(--eccf-green);
  background: var(--eccf-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/10px no-repeat;
}
.eccf-chip input:focus-visible + span { outline: 2px solid var(--eccf-green); outline-offset: 2px; }

/* Scelta modalità attivazione */
.eccf-choice { border: 0; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.eccf-choice__opt { position: relative; cursor: pointer; display: block; }
.eccf-choice__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.eccf-choice__box {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px 16px 16px 46px;
  border: 1.5px solid var(--eccf-line); border-radius: 14px; background: #fff;
  position: relative;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.eccf-choice__box::before {
  content: ""; position: absolute; left: 16px; top: 18px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--eccf-line-strong); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.eccf-choice__box strong { font-size: .95rem; color: var(--eccf-ink); }
.eccf-choice__box small { font-size: .83rem; line-height: 1.45; color: var(--eccf-muted); }
.eccf-choice__opt:hover .eccf-choice__box { border-color: var(--eccf-line-strong); }
.eccf-choice__opt input:checked + .eccf-choice__box { border-color: var(--eccf-green); background: var(--eccf-tint); }
.eccf-choice__opt input:checked + .eccf-choice__box::before { border-color: var(--eccf-green); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--eccf-green); }
.eccf-choice__opt input:focus-visible + .eccf-choice__box { outline: 2px solid var(--eccf-green); outline-offset: 2px; }

/* Consenso */
.eccf-consent { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 22px; cursor: pointer; font-size: .86rem; line-height: 1.5; color: var(--eccf-muted); }
.eccf-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--eccf-green); cursor: pointer; }
.wp-block-post-content .eccf-consent a, .eccf-consent a { color: var(--eccf-green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.eccf-consent.has-error { color: var(--eccf-danger); }

/* Azioni */
.eccf-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.eccf-submit, .eccf .eccf-btn, .eccf-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 700; letter-spacing: -.005em;
  background: var(--eccf-green); color: #fff !important; text-decoration: none !important;
  transition: background-color .2s ease, box-shadow .25s ease, transform .35s var(--eccf-ease);
}
.eccf-submit:hover, .eccf-btn--primary:hover { background: var(--eccf-green-dark); box-shadow: 0 8px 22px -8px rgba(11,107,52,.55); }
.eccf-submit:active { transform: scale(.985); }
.eccf-submit:focus-visible, .eccf-btn:focus-visible { outline: 3px solid var(--eccf-green); outline-offset: 3px; }
.eccf-submit .eccf-ico { transition: transform .35s var(--eccf-ease); }
.eccf-submit:hover .eccf-ico { transform: translateX(3px); }
.eccf-submit__spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: eccf-spin .7s linear infinite; }
.eccf-form.is-loading .eccf-submit { pointer-events: none; opacity: .85; }
.eccf-form.is-loading .eccf-submit__spin { display: block; }
.eccf-form.is-loading .eccf-submit .eccf-ico { display: none; }
@keyframes eccf-spin { to { transform: rotate(360deg); } }
.eccf-note { margin: 0 !important; font-size: .84rem; color: var(--eccf-muted); }
.eccf-btn--outline { background: #fff; color: var(--eccf-ink) !important; border: 1.5px solid var(--eccf-line-strong); }
.eccf-btn--outline:hover { border-color: var(--eccf-green); color: var(--eccf-green) !important; }
.eccf-btn--link { background: none; color: var(--eccf-green) !important; padding: 0; min-height: 0; }

.eccf-status:empty { display: none; }
.eccf-status { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; background: #FFF1EF; color: var(--eccf-danger); border: 1px solid #F5C9C3; }

/* Conferma */
.eccf-done { padding: 34px 6px 10px; text-align: left; outline: none; animation: eccf-rise .6s var(--eccf-ease) both; }
.eccf-done__ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--eccf-tint); color: var(--eccf-green); margin-bottom: 18px; }
.eccf .eccf-done h3, .eccf-done h3 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--eccf-ink); }
.eccf-done p { margin: 0 0 22px; color: var(--eccf-muted); line-height: 1.65; max-width: 52ch; }
.eccf-banner { grid-column: 1 / -1; padding: 14px 18px; border-radius: 14px; font-weight: 600; }
.eccf-banner--ok { background: var(--eccf-tint); color: var(--eccf-green-dark); }
.eccf-banner--err { background: #FFF1EF; color: var(--eccf-danger); }

/* ── Modal "Prenota call" ───────────────────── */
.eccf-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; }
.eccf-modal[hidden] { display: none; }
.eccf-modal__backdrop { position: absolute; inset: 0; background: rgba(8,14,10,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s ease; }
.eccf-modal__dialog {
  position: relative; z-index: 1;
  width: min(1040px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  display: grid; grid-template-columns: 330px minmax(0, 1fr);
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity .35s ease, transform .5s var(--eccf-ease);
}
.eccf-modal.is-open .eccf-modal__backdrop { opacity: 1; }
.eccf-modal.is-open .eccf-modal__dialog { opacity: 1; transform: none; }
.eccf-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--eccf-line);
  background: #fff; color: var(--eccf-ink); cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s ease, color .2s ease;
}
.eccf-modal__close:hover { border-color: var(--eccf-green); color: var(--eccf-green); }
.eccf-modal__close:focus-visible { outline: 3px solid var(--eccf-green); outline-offset: 2px; }
.eccf-modal__intro {
  background: #0F1A12;
  background-image: radial-gradient(120% 55% at 0% 0%, rgba(0,177,64,.2) 0%, rgba(0,177,64,0) 60%);
  color: #CBD5CE; padding: 36px 30px; overflow-y: auto;
}
.eccf-modal__intro .eccf-kicker { color: #3DDC84; }
.eccf-modal__intro h2 { margin: 0 0 14px; font-size: 1.55rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; color: #F1F5F2; text-wrap: balance; border: 0; padding: 0; display: block; }
.eccf-modal__lead { margin: 0 0 24px; font-size: .95rem; line-height: 1.6; color: #CBD5CE; }
.eccf-modal__label { margin: 0 0 10px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #95A39A; }
.eccf-modal__list { display: grid; gap: 10px; margin-bottom: 26px !important; }
.eccf-modal__list li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: #E3EAE5; }
.eccf-modal__list .eccf-ico { margin-top: 3px; color: #3DDC84; }
.eccf-modal__ext { display: inline;  font-size: .86rem; font-weight: 600; color: #E3EAE5 !important; text-decoration: underline; text-decoration-color: #34443A; text-underline-offset: 3px; }
.eccf-modal__ext .eccf-ico { display: inline-block; vertical-align: -2px; margin-left: 4px; }
.eccf-modal__ext:hover { color: #3DDC84 !important; text-decoration-color: #3DDC84; }
.eccf-modal__cal { position: relative; min-height: 640px; background: #fff; }
.eccf-modal__cal iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; opacity: 0; transition: opacity .4s ease; }
.eccf-modal__cal.is-loaded iframe { opacity: 1; }
.eccf-modal__skeleton { position: absolute; inset: 0; padding: 70px 36px; display: grid; align-content: start; gap: 14px; }
.eccf-modal__skeleton span { display: block; height: 18px; border-radius: 8px; background: linear-gradient(110deg, #F1F4EF 30%, #E2E8E0 50%, #F1F4EF 70%); background-size: 200% 100%; animation: eccf-skl 1.6s ease-in-out infinite; }
.eccf-modal__skeleton span:nth-child(1) { width: 45%; height: 26px; }
.eccf-modal__skeleton span:nth-child(2) { width: 80%; }
.eccf-modal__skeleton span:nth-child(3) { width: 100%; height: 260px; border-radius: 14px; }
.eccf-modal__cal.is-loaded .eccf-modal__skeleton { display: none; }
@keyframes eccf-skl { 0% { background-position: 0% 50%; } 100% { background-position: -200% 50%; } }
html.eccf-lock, html.eccf-lock body { overflow: hidden; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 980px) {
  .eccf { grid-template-columns: 1fr; }
  .eccf-side { position: static; }
  .eccf-card { order: -1; }
  .eccf-modal__dialog { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: start; overflow-y: auto; }
  .eccf-modal__intro { overflow: visible; }
  .eccf-modal__intro { padding: 28px 24px 22px; }
  .eccf-modal__intro h2 { font-size: 1.3rem; padding-right: 44px; }
  .eccf-modal__list, .eccf-modal__lead { margin-bottom: 16px !important; }
  .eccf-modal__close { background: rgba(255,255,255,.08); border-color: #34443A; color: #F1F5F2; }
  .eccf-modal__cal { min-height: 720px; }
}
@media (max-width: 640px) {
  body.eccf-wide .wp-block-post-content { padding-left: 16px; padding-right: 16px; }
  .eccf-card { padding: 6px 18px 24px; border-radius: 20px; }
  .eccf-tabs { margin: 0 -10px 22px; }
  .eccf-tabs button { padding: 16px 10px 14px; }
  .eccf-tabs__t { font-size: .95rem; }
  .eccf-tabs__s { display: none; }
  .eccf-grid, .eccf-choice { grid-template-columns: 1fr; }
  .eccf-side { padding: 28px 20px 24px; border-radius: 20px; }
  .eccf-submit { width: 100%; }
  .eccf-modal { padding: 0; }
  .eccf-modal__dialog { border-radius: 0; max-height: 100vh; max-height: 100dvh; height: 100%; }
  .eccf-modal__intro .eccf-modal__label, .eccf-modal__intro .eccf-modal__list { display: none; }
}

/* ── Tema scuro (bottone luna del tema) ─────── */
html[data-theme="dark"] .eccf, html[data-theme="dark"] .eccf-modal, html[data-theme="dark"] .eccf-card {
  --eccf-green: #00B140; --eccf-green-dark: #3DDC84; --eccf-ink: #F1F5F2; --eccf-muted: #95A39A;
  --eccf-line: #26332A; --eccf-line-strong: #34443A; --eccf-soft: #0F1812; --eccf-tint: rgba(0,177,64,.12); --eccf-card: #121C15;
  --eccf-danger: #FF8A80;
}
html[data-theme="dark"] .eccf-card { box-shadow: none; }
html[data-theme="dark"] .eccf-side { background-color: #0F1812; border: 1px solid #26332A; }
html[data-theme="dark"] .eccf-form input:focus, html[data-theme="dark"] .eccf-form select:focus, html[data-theme="dark"] .eccf-form textarea:focus { background: #0B120D; box-shadow: 0 0 0 4px rgba(0,177,64,.18); }
html[data-theme="dark"] .eccf-form select { color-scheme: dark; }
html[data-theme="dark"] .eccf-chip span, html[data-theme="dark"] .eccf-choice__box, html[data-theme="dark"] .eccf-chip span::before, html[data-theme="dark"] .eccf-choice__box::before { background-color: #0F1812; }
html[data-theme="dark"] .eccf-chip input:checked + span::before { background-color: #00B140; }
html[data-theme="dark"] .eccf-choice__opt input:checked + .eccf-choice__box::before { box-shadow: inset 0 0 0 4px #0F1812, inset 0 0 0 10px #00B140; }
html[data-theme="dark"] .eccf-submit, html[data-theme="dark"] .eccf-btn--primary { color: #0F1A12 !important; }
html[data-theme="dark"] .eccf-submit__spin { border-color: rgba(15,26,18,.3); border-top-color: #0F1A12; }
html[data-theme="dark"] .eccf-btn--outline { background: transparent; }
html[data-theme="dark"] .eccf-field.has-error input, html[data-theme="dark"] .eccf-field.has-error select, html[data-theme="dark"] .eccf-field.has-error textarea { background: #1E1413; }
html[data-theme="dark"] .eccf-status { background: #1E1413; border-color: #4A2622; }
html[data-theme="dark"] .eccf-modal__dialog { background: #121C15; }
html[data-theme="dark"] .eccf-modal__close { background: #121C15; }

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