/* Business Process & AI Diagnostic page styles (page-scoped: loaded only on
   /{en,pt}/consulting/business-optimisation/). Reuses shared tokens and shared
   components (.section-inner, .section-sub, .btn, .faq-section, .tier-cta-bottom,
   .gradient-heading, .hero-kicker, .demo-label, .cta-note from style.css /
   consulting.css); all new selectors are diag-* scoped. */

.diag-hero { padding: 3rem 1.5rem 2rem; text-align: center; }
.diag-hero h1 { margin-bottom: 0.9rem; }

.diag-glance { max-width: 640px; margin: 1.6rem auto 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.4rem; }
.diag-glance-title { font-family: var(--font-heading); font-size: 1.05rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.diag-price { font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.diag-price-unit { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); }
.diag-glance-list { list-style: none; margin: 0.9rem 0 1.2rem; text-align: left; }
.diag-glance-list li { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; color: var(--text); }
.diag-glance-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--amber); font-weight: 700; }
.diag-glance .btn { width: 100%; }
.diag-glance-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.8rem; line-height: 1.5; }

.diag-why { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.diag-why-list { list-style: none; max-width: 640px; margin: 0 auto; text-align: left; }
.diag-why-list li { padding: 0.55rem 0 0.55rem 1.6rem; position: relative; color: var(--text); line-height: 1.5; }
.diag-why-list li::before { content: "\2192"; position: absolute; left: 0; color: var(--indigo-hover); font-weight: 700; }

.diag-scope-list { list-style: none; max-width: 640px; margin: 0 auto 1.6rem; text-align: left; }
.diag-scope-list li { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; }
.diag-scope-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--amber); font-weight: 700; }
.diag-limits { max-width: 640px; margin: 0 auto; background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.diag-limits h3 { font-family: var(--font-heading); font-size: 0.95rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; }
.diag-limits ul { text-align: left; margin: 0; }
.diag-limits li { color: var(--text-muted); line-height: 1.5; padding: 0.2rem 0; }

.diag-steps { max-width: 700px; margin: 0 auto; counter-reset: diagstep; list-style: none; text-align: left; }
.diag-steps li { position: relative; padding: 0 0 1.4rem 3rem; }
.diag-steps li::before { counter-increment: diagstep; content: counter(diagstep); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  color: var(--amber); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.diag-steps h3 { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.3rem; }
.diag-steps p { color: var(--text-muted); line-height: 1.55; margin: 0; }

.diag-example { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.diag-ex-process { max-width: 640px; margin: 0 auto 1.4rem; text-align: left; }
.diag-ex-process h3 { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.5rem; }
.diag-ex-process ul { margin: 0; }
.diag-ex-process li { color: var(--text-muted); line-height: 1.55; padding: 0.2rem 0; }
.diag-findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.diag-finding { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; text-align: left; }
.diag-finding h3 { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 0.45rem; }
.diag-finding p { color: var(--text-muted); line-height: 1.55; margin: 0 0 0.6rem; }
.diag-next { font-size: 0.9rem; color: var(--text); border-top: 1px solid var(--border); padding-top: 0.6rem; margin-bottom: 0; }
.diag-ex-note { max-width: 700px; margin: 1.4rem auto 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.diag-ex-close { max-width: 700px; margin: 0.8rem auto 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }

.diag-diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; max-width: 760px; margin: 0 auto; }
.diag-diff-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; text-align: left; background: var(--bg); }
.diag-diff-paid { border-color: var(--indigo); background: var(--surface); }
.diag-diff-card h3 { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.5rem; }
.diag-diff-card p { color: var(--text-muted); line-height: 1.55; margin: 0; }

.diag-close { text-align: center; }
.diag-close p { max-width: 640px; margin: 0 auto 0.7rem; color: var(--text-muted); line-height: 1.6; }
.diag-close .cta-note { font-size: 0.85rem; margin-top: 1rem; }


/* Diagnostic-scoped visual treatment (consulting.css equivalents; the diagnostic
   page loads only style.css + optimisation.css, so these rules are page-scoped
   copies, not shared edits). */
.diag-hero .hero-kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 0.9rem;
}
.gradient-heading {
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--text) 0%, #c4b5fd 50%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}
@supports not (-webkit-background-clip: text) {
  .gradient-heading { background: none; -webkit-text-fill-color: currentColor; }
}
.diag-example .demo-label {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--amber); border: 1px solid var(--amber);
  border-radius: 999px; padding: 0.3rem 0.9rem; margin-bottom: 1.1rem;
}
.diag-close .cta-note, .diag-glance-note { font-size: 0.82rem; }

/* Text enlargement (WCAG 1.4.4): long tokens (URLs, email addresses, prices)
   must wrap, not overflow. Applies at any zoom/text scale. */
.diag-hero, .diag-glance, .diag-scope, .diag-how, .diag-example,
.diag-diff, .diag-faq, .diag-close {
  overflow-wrap: break-word; word-break: break-word;
}
.diag-glance { max-width: min(640px, 100%); }

/* Mobile: reserve dedicated space for the chat launcher on the right edge of
   the hero (at-a-glance panel) and the closing block, so the raised launcher
   never covers price-unit, scope, booking button or closing copy. */
@media (max-width: 768px) {
  /* Reading-width pins (rem paddings double with text size and shatter the
     panel into narrow columns at 200%). */
  .diag-hero, .diag-close { padding-left: 8px; padding-right: 8px; }
  .diag-hero .section-inner, .diag-close .section-inner { padding-left: 8px; padding-right: 8px; }
  .diag-glance .btn, .diag-close .btn { padding-left: 18px; padding-right: 18px; }
  .diag-glance { padding: 20px 16px; }
  .diag-glance-list li { padding-left: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .diag-steps li::before, .diag-finding, .diag-glance { transition: none; }
}

/* ── Coherent mobile arrangement (diagnostic page only) ──────────────────
   .diag-controls is a sticky-bottom strip in normal document flow: booking +
   chat side by side, no floating launcher over the reading column. Body
   bottom padding is kept equal to the strip's rendered height by the
   page-local follower in the template, so clearance follows the control
   height at ANY text size. */
@media (max-width: 768px) {
  /* the shared sticky bar is replaced by this strip on the diagnostic page */
  .mobile-cta { display: none !important; }

  /* reading-width pins (these paddings double with text size) */
  .diag-hero, .diag-close { padding-left: 8px; padding-right: 8px; }
  .diag-hero .section-inner, .diag-close .section-inner { padding-left: 8px; padding-right: 8px; }
  .diag-glance { padding: 20px 16px; }
  .diag-glance-list li { padding-left: 24px; }
  .diag-glance .btn { padding-left: 18px; padding-right: 18px; }

  /* the control strip */
  .diag-controls {
    /* fixed to the viewport bottom - the proven shared-bar pattern. Sticky at
       body-end left an 89px padding gap below the strip at max scroll; fixed
       glues the strip to the bottom edge in every scroll state (gap 0). Body
       padding from the follower reserves scrolling room above it. */
    position: fixed; bottom: 0; left: 0; right: 0;
    /* above nav (z 100) so the strip is never trapped beneath it; the open
       chat panel inside the relocated widget sits at z 300, above both */
    z-index: 200;
    background: rgba(9, 9, 13, 0.97);
    border-top: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
  }
  .diag-controls-inner {
    display: flex; align-items: stretch; justify-content: center;
    gap: 0.6rem; flex-wrap: wrap;
  }
  .diag-controls-book {
    flex: 1 1 240px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 1rem; line-height: 1.25;
    padding: 0.55rem 1rem; white-space: normal;
  }
  /* relocated chat widget: fixed-corner styles neutralised on this page */
  .diag-controls .chat-widget { position: static; bottom: auto; right: auto; display: flex; align-items: stretch; }
  .diag-controls .chat-toggle { width: auto; min-width: 54px; min-height: 44px; border-radius: var(--radius-sm); padding: 0 1rem; flex: 0 0 auto; }
  .diag-controls .chat-panel {
    position: fixed; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; top: 0.5rem;
    width: auto; max-width: none; height: auto; max-height: none;
    display: none; flex-direction: column; overflow: hidden;
  }
  .diag-controls .chat-panel.open { display: flex; }
  .diag-controls .chat-messages { flex: 1 1 auto; min-height: 140px; overflow-y: auto; }
  .diag-controls .chat-human { flex: 0 0 auto; overflow-y: auto; max-height: 25vh; border-top: 1px solid var(--border); padding-top: 0.4rem; }
  .diag-controls .chat-input-area { flex: 0 0 auto; flex-wrap: wrap; }
  .diag-controls .chat-input-area input { min-width: 0; flex: 1 1 150px; }
  .diag-controls .chat-input-area button { flex: 0 0 auto; }

  /* base document clearance; follower keeps it matched to the real height */
}


/* Correction 2: the relocated widget's open panel must never be trapped
   beneath navigation (z 100) or the strip's siblings. */
@media (max-width: 768px) {
  .diag-controls .chat-widget { position: static; z-index: 300; }
  .diag-controls .chat-widget .chat-panel { z-index: 300; }
}

/* Correction 3: lifecycle. The strip exists only at <=768px. Outside the
   breakpoint it is display:none and the follower removes body padding,
   restoring shared desktop spacing. */
@media (min-width: 769px) {
  .diag-controls { display: none; }
}
