/* ============================================================
   IOCOS — Strumenti interattivi dentro gli articoli del blog
   (<div class="bp-tool bp-tool-NOME">, vedi BLOG_TOOLS in
   articles/_shared.php). Usa i token di services-public.css.
   ============================================================ */
.bp-body .bp-tool {
  margin: 28px 0 34px; padding: 22px 22px 20px;
  background: var(--surface); border: 1px solid var(--border-2); border-top: 4px solid var(--cat, var(--accent));
  border-radius: var(--radius-sm, 12px); box-shadow: var(--shadow-sm);
  font-size: 15px; line-height: 1.5;
}
.bp-body .bp-tool > p:only-child { margin: 0; color: var(--text-dim); }
.bpt-head { margin-bottom: 14px; }
.bp-body .bpt-kicker {
  margin: 0 0 4px; font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2);
}
.bp-body .bpt-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; line-height: 1.25; color: var(--text); }
.bp-body .bpt-intro { margin: 0; color: var(--text-dim); font-size: 14.5px; }

.bpt-form fieldset { border: 0; margin: 0 0 14px; padding: 14px 0 0; border-top: 1px solid var(--border); }
.bpt-form legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 14px; color: var(--text); }
.bpt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; }
.bpt-grid label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.bpt-grid label[hidden] { display: none; }
.bpt-form input:not([type=checkbox]):not([type=radio]), .bpt-form select {
  width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 10px; font: inherit; font-size: 14.5px; font-weight: 400;
  color: var(--text); background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px;
}
.bpt-form input:focus-visible, .bpt-form select:focus-visible, .bp-tool button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.bpt-check { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.bpt-check input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--accent-2); }
.bpt-check small, .bpt-grid small { color: var(--text-mute); font-weight: 400; }
.bpt-check.bpt-sub { margin-left: 26px; }
.bpt-check:has(input:disabled) { opacity: .5; cursor: default; }
.bp-body .bpt-q { margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.bpt-req { color: var(--accent-2); }
.bp-body .bpt-err { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #fdecea; color: #a12a1b; font-size: 14px; }

.bp-tool button { font: inherit; cursor: pointer; }
.bpt-go {
  min-height: 44px; padding: 10px 22px; border: 0; border-radius: 999px;
  background: var(--accent-2); color: #fff; font-weight: 700; font-size: 15px;
}
.bpt-go:hover { background: var(--accent); }

.bpt-result { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-2); scroll-margin-top: 90px; }
.bpt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bpt-tabs button {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-2);
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 600;
}
.bpt-tabs button[aria-selected=true] { background: var(--text); border-color: var(--text); color: var(--surface); }
.bp-body .bpt-note { margin: 0 0 8px; font-size: 13.5px; color: var(--text-dim); }
.bpt-out {
  max-height: 460px; overflow: auto; padding: 16px 18px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 14.5px;
}
.bp-body .bpt-out h3 { margin: 0 0 8px; font-size: 18px; }
.bp-body .bpt-out h4 { margin: 14px 0 6px; font-size: 15px; }
.bp-body .bpt-out p, .bp-body .bpt-out ul { margin: 0 0 10px; }
.bp-body .bpt-out table { font-size: 13px; }
.bpt-out.is-code { padding: 0; background: #1a1d29; border-color: #1a1d29; }
.bpt-out pre {
  margin: 0; padding: 14px 16px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono, monospace); font-size: 12.5px; line-height: 1.55; color: #f3efe9; background: none;
}
.bpt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bpt-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--accent-2);
  background: transparent; color: var(--accent-2); font-size: 13.5px; font-weight: 700;
}
.bpt-btn.is-ok { background: var(--teal); border-color: var(--teal); color: #fff; }
.bp-body .bpt-disclaimer { margin: 12px 0 0; font-size: 12.5px; color: var(--text-mute); }

.bpt-preview { margin-bottom: 14px; }
.bp-body .bpt-preview-t { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.bpt-preview-box { padding: 14px 16px; border: 1px dashed var(--border-2); border-radius: 10px; background: var(--bg); }
.bpt-preview-box .consensi { display: grid; gap: 10px; font-size: 14px; }
.bpt-preview-box .consenso { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.bpt-preview-box .consenso input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent-2); }
.bp-body .bpt-preview-box p { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.bp-body ul.bpt-ok { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; }
.bp-body ul.bpt-ok li { position: relative; padding-left: 24px; margin: 0; font-size: 13.5px; color: var(--text); }
.bp-body ul.bpt-ok li::before { content: '✓'; position: absolute; left: 4px; color: var(--teal); font-weight: 800; }

@media (max-width: 600px) {
  .bp-body .bp-tool { padding: 18px 14px 16px; margin-left: -4px; margin-right: -4px; }
  .bpt-check.bpt-sub { margin-left: 18px; }
  .bpt-go { width: 100%; }
}

/* ---------- CTA in cima all'articolo: scegli subito il generatore ---------- */
.bp-body .bp-tool { scroll-margin-top: 90px; transition: box-shadow .3s; }
.bp-body .bp-tool.is-flash { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow-sm); }
.bp-body .bpt-cta {
  margin: 22px 0 30px; padding: 18px; border-radius: var(--radius-sm, 12px);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.bp-body .bpt-cta-t { margin: 0 0 12px; font-weight: 800; font-size: 16px; color: var(--text); }
.bpt-cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.bp-body a.bpt-cta-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.bp-body a.bpt-cta-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.bp-body a.bpt-cta-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bpt-cta-ico { font-size: 26px; line-height: 1; }
.bp-body .bpt-cta-card strong { font-size: 16px; line-height: 1.3; color: var(--text); }
.bpt-cta-d { font-size: 14px; color: var(--text-dim); line-height: 1.45; }
.bpt-cta-go { margin-top: auto; padding-top: 4px; font-size: 14px; font-weight: 700; color: var(--accent-2); }
.bp-body .bpt-cta-n { margin: 10px 0 0; font-size: 12.5px; color: var(--text-mute); }
@media (prefers-reduced-motion: reduce) { .bp-body a.bpt-cta-card { transition: none; } .bp-body a.bpt-cta-card:hover { transform: none; } }
