/* ============================================================================
   HAON_DEEPSEC_V1 — Relatório Profundo de Segurança (casca / cliente).
   CTA piscando vermelho + modal de consentimento + barra de progresso + PDF/senha.
   Palantir-light, tema-aware (dark / stone-dark). Animações em GPU (<=260ms),
   prefers-reduced-motion safe. Verde do app = --green-*; vermelho SÓ no risco.
   ========================================================================== */

/* ---- CTA: botão piscando vermelho (elegante, dopamina sem cafonice) ------- */
.ds-cta-wrap { margin: 16px 0 4px; }
.ds-cta {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(214, 64, 64, .55);
  color: #fff;
  background: linear-gradient(135deg, #c4291f, #e0473d);
  box-shadow: 0 10px 26px rgba(200, 40, 40, .30);
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  animation: dsPulse 2.2s ease-in-out infinite;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.ds-cta:hover { filter: brightness(1.05); box-shadow: 0 14px 34px rgba(200, 40, 40, .42); }
.ds-cta:active { transform: translateY(1px) scale(.995); }
.ds-cta:focus-visible { outline: 3px solid rgba(255, 255, 255, .65); outline-offset: 2px; }

/* respiro de luz vermelha por trás (GPU: opacity/transform only) */
.ds-cta-glow {
  position: absolute; inset: -40%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 90, 80, .55), transparent 70%);
  opacity: .5;
  animation: dsGlow 2.2s ease-in-out infinite;
}
.ds-cta-ic {
  flex: 0 0 auto; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.ds-cta-ic .ds-i { width: 22px; height: 22px; }
.ds-cta-txt { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.ds-cta-txt b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.ds-cta-txt small { display: block; font-size: 12px; opacity: .92; margin-top: 2px; }
.ds-cta-arrow { flex: 0 0 auto; font-size: 26px; font-weight: 700; opacity: .85; line-height: 1; }

@keyframes dsPulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(200, 40, 40, .30), 0 0 0 0 rgba(224, 71, 61, .55); }
  50%      { box-shadow: 0 12px 30px rgba(200, 40, 40, .40), 0 0 0 8px rgba(224, 71, 61, 0); }
}
@keyframes dsGlow {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: .7;  transform: scale(1.06); }
}

/* ---- backdrop + modal ----------------------------------------------------- */
.ds-backdrop {
  position: fixed; inset: 0; z-index: 9460;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(8, 14, 30, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .16s ease;
}
.ds-backdrop.show { opacity: 1; }
.ds-modal {
  position: relative;
  width: min(500px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: var(--panel, #fff);
  color: var(--ink, #142033);
  border-radius: 22px;
  padding: 24px;
  border: 1px solid rgba(15, 40, 80, .1);
  box-shadow: 0 30px 80px rgba(16, 38, 76, .32);
  transform: translateY(8px) scale(.985);
  opacity: 0;
  transition: transform .2s var(--ease-out, cubic-bezier(.16,1,.3,1)), opacity .2s ease;
}
.ds-backdrop.show .ds-modal { transform: none; opacity: 1; }
.ds-x {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: none; color: var(--muted, #98a2b3);
  cursor: pointer; transition: background .14s ease, color .14s ease;
}
.ds-x:hover { background: rgba(15, 40, 80, .06); color: var(--ink, #1b2330); }
.ds-x .ds-i { width: 18px; height: 18px; }

/* ---- header --------------------------------------------------------------- */
.ds-head { display: flex; align-items: center; gap: 12px; margin: 2px 30px 18px 0; }
.ds-ic {
  flex: 0 0 auto; width: 42px; height: 42px;
  border-radius: 12px; display: grid; place-items: center; color: #fff;
}
.ds-ic .ds-i { width: 22px; height: 22px; }
.ds-ic-green { background: linear-gradient(135deg, var(--green-700, #1f6a4a), var(--green-500, #3fa875)); box-shadow: 0 6px 16px rgba(31, 106, 74, .3); }
.ds-ic-amber { background: linear-gradient(135deg, var(--orange-700, #b65318), var(--orange-500, #f28a32)); box-shadow: 0 6px 16px rgba(182, 83, 24, .28); }
.ds-ic-red   { background: linear-gradient(135deg, #c4291f, #e0473d); box-shadow: 0 6px 16px rgba(200, 40, 40, .3); }
.ds-head b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.ds-head span { font-size: 12.5px; color: var(--muted, #667085); }

/* ---- aviso legal ---------------------------------------------------------- */
.ds-legal {
  display: flex; gap: 11px;
  background: var(--green-050, #f5fbf7);
  border: 1px solid rgba(47, 143, 98, .22);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
}
.ds-legal-ic { flex: 0 0 auto; color: var(--green-700, #1f6a4a); margin-top: 1px; }
.ds-legal-ic .ds-i { width: 20px; height: 20px; }
.ds-legal p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--soft, #475467); }
.ds-legal b { color: var(--ink, #142033); }

/* ---- roteiro da ligação --------------------------------------------------- */
.ds-script {
  border: 1px solid var(--line, #e3e9ee);
  border-radius: 14px; padding: 13px 14px; margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(31,106,74,.04), transparent);
}
.ds-script-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--green-700, #1f6a4a); margin-bottom: 10px;
}
.ds-script-h small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted, #6f7a89); }
.ds-script-ic { display: inline-flex; }
.ds-script-ic .ds-i { width: 16px; height: 16px; }
.ds-script-body { position: relative; display: flex; gap: 8px; }
.ds-script-q { flex: 0 0 auto; color: rgba(31, 106, 74, .5); }
.ds-script-q .ds-i { width: 18px; height: 18px; }
.ds-script-body p {
  margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink, #20283a);
  font-style: italic;
}

/* ---- alvo (quando vem do lead) -------------------------------------------- */
.ds-target {
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(15, 40, 80, .04);
  border: 1px solid var(--line, #e3e9ee);
  border-radius: 12px; padding: 10px 13px; margin-bottom: 14px;
}
.ds-target-k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6f7a89); }
.ds-target-v { font-size: 13.5px; font-weight: 600; color: var(--ink, #142033); word-break: break-all; }

/* ---- campos --------------------------------------------------------------- */
.ds-field { display: grid; gap: 6px; margin-bottom: 14px; }
.ds-field > span {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted, #667085);
}
.ds-field-req > span::after { content: " *"; color: #d6403f; }
.ds-field input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--line, #d8deea);
  font-size: 14px; color: var(--ink, #1b2330);
  background: var(--white, #fff);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.ds-field input::placeholder { color: var(--muted, #98a2b3); }
.ds-field input:focus {
  outline: none; border-color: var(--green-600, #2f8f62);
  box-shadow: 0 0 0 3px rgba(47, 143, 98, .16);
}

/* ---- checkbox de consentimento ------------------------------------------- */
.ds-check {
  display: flex; align-items: flex-start; gap: 11px;
  cursor: pointer; user-select: none;
  padding: 12px 14px; border-radius: 13px;
  border: 1.5px solid var(--line, #e3e9ee);
  background: var(--white, #fff);
  margin-bottom: 18px;
  transition: border-color .14s ease, background .14s ease, box-shadow .2s ease;
}
.ds-check:hover { border-color: var(--green-500, #3fa875); }
.ds-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ds-check-box {
  flex: 0 0 auto; width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong, #cbd9e6);
  color: #fff; background: transparent;
  transition: background .14s ease, border-color .14s ease, transform .12s ease;
}
.ds-check-box .ds-i { width: 16px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .12s ease; }
.ds-check input:checked ~ .ds-check-box {
  background: var(--green-600, #2f8f62); border-color: var(--green-600, #2f8f62);
}
.ds-check input:checked ~ .ds-check-box .ds-i { opacity: 1; transform: scale(1); }
.ds-check input:focus-visible ~ .ds-check-box { box-shadow: 0 0 0 3px rgba(47, 143, 98, .25); }
.ds-check:has(input:checked) { border-color: var(--green-500, #3fa875); background: var(--green-050, #f5fbf7); }
.ds-check-txt { font-size: 13.5px; line-height: 1.45; color: var(--ink, #20283a); font-weight: 600; }

/* ---- footer / botões ------------------------------------------------------ */
.ds-foot { display: flex; gap: 10px; }
.ds-btn {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 800; cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: filter .15s ease, box-shadow .2s ease, transform .1s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}
.ds-btn .ds-i { width: 18px; height: 18px; flex: none; }
.ds-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green-700, #1f6a4a), var(--green-500, #3fa875));
  box-shadow: 0 8px 20px rgba(31, 106, 74, .3);
}
.ds-btn.primary:hover { filter: brightness(1.05); }
.ds-btn.primary:active { transform: translateY(1px); }
.ds-btn.primary:disabled {
  opacity: .5; cursor: not-allowed; filter: grayscale(.3);
  box-shadow: none; transform: none;
}
.ds-btn.ghost {
  flex: 0 0 auto;
  color: var(--soft, #4a5468);
  background: var(--white, #fff);
  border-color: var(--line, #e6e9f0);
}
.ds-btn.ghost:hover { background: rgba(15, 40, 80, .04); }
.ds-btn:focus-visible { outline: 3px solid rgba(47, 143, 98, .4); outline-offset: 2px; }

/* ---- progresso ------------------------------------------------------------ */
.ds-prog-stage {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 14px 0 18px;
}
.ds-prog-orb {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 28px;
}
.ds-prog-orb span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--green-500, #3fa875);
  animation: dsBounce 1.1s ease-in-out infinite;
}
.ds-prog-orb span:nth-child(2) { animation-delay: .15s; background: var(--green-600, #2f8f62); }
.ds-prog-orb span:nth-child(3) { animation-delay: .3s; background: var(--green-700, #1f6a4a); }
@keyframes dsBounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .5; }
  40%           { transform: scale(1);  opacity: 1; }
}
.ds-prog-phrase {
  font-size: 15px; font-weight: 700; color: var(--ink, #20283a);
  text-align: center; min-height: 20px;
}
.ds-phrase-in { animation: dsPhraseIn .26s ease; }
@keyframes dsPhraseIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.ds-bar {
  position: relative; height: 10px; border-radius: 999px;
  background: rgba(15, 40, 80, .08);
  overflow: hidden; margin-bottom: 10px;
}
.ds-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-600, #2f8f62), var(--green-500, #3fa875));
  transition: width .4s var(--ease-out, cubic-bezier(.16,1,.3,1));
}
/* brilho percorrendo a barra (GPU: transform) */
.ds-bar-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%);
  animation: dsShine 1.6s linear infinite;
}
@keyframes dsShine { to { transform: translateX(100%); } }
.ds-prog-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted, #6f7a89); margin-bottom: 14px;
}
.ds-prog-meta span:first-child {
  font-weight: 800; font-size: 14px; color: var(--green-700, #1f6a4a);
  font-variant-numeric: tabular-nums;
}

.ds-note { font-size: 12px; line-height: 1.45; border-radius: 12px; padding: 10px 12px; }
.ds-note-soft {
  color: var(--soft, #475467);
  background: var(--green-050, #f5fbf7);
  border: 1px solid rgba(47, 143, 98, .18);
}

/* ---- concluído: card + senha --------------------------------------------- */
.ds-done-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--green-050, #f5fbf7);
  border: 1px solid rgba(47, 143, 98, .22);
  border-radius: 14px; padding: 14px; margin-bottom: 14px;
}
.ds-done-ic {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 12px;
  color: var(--green-700, #1f6a4a);
  background: rgba(47, 143, 98, .12);
}
.ds-done-ic .ds-i { width: 24px; height: 24px; }
.ds-done-tx b { display: block; font-size: 15px; font-weight: 800; color: var(--ink, #142033); }
.ds-done-tx span { font-size: 12.5px; color: var(--soft, #475467); }

.ds-pwd {
  border: 1.5px dashed rgba(47, 143, 98, .4);
  border-radius: 14px; padding: 13px 14px; margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(47, 143, 98, .05), transparent);
}
.ds-pwd-lbl {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--green-700, #1f6a4a); margin-bottom: 9px;
}
.ds-pwd-ic { display: inline-flex; }
.ds-pwd-ic .ds-i { width: 15px; height: 15px; }
.ds-pwd-row { display: flex; gap: 8px; }
.ds-pwd-row input {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box;
  padding: 11px 13px; border-radius: 10px;
  border: 1.5px solid var(--line-strong, #cbd9e6);
  background: var(--white, #fff); color: var(--ink, #142033);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px; font-weight: 700; letter-spacing: .04em;
}
.ds-pwd-row input:focus { outline: none; border-color: var(--green-600, #2f8f62); box-shadow: 0 0 0 3px rgba(47, 143, 98, .16); }
.ds-copy {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 800;
  color: var(--green-700, #1f6a4a);
  background: var(--white, #fff);
  border: 1.5px solid var(--green-500, #3fa875);
  transition: background .14s ease, color .14s ease, transform .1s ease;
}
.ds-copy .ds-i { width: 16px; height: 16px; }
.ds-copy:hover { background: var(--green-050, #f5fbf7); }
.ds-copy:active { transform: translateY(1px); }
.ds-copy.ok { color: #fff; background: var(--green-600, #2f8f62); border-color: var(--green-600, #2f8f62); }
.ds-pwd-note { font-size: 12px; line-height: 1.45; color: var(--soft, #475467); margin-top: 9px; }

/* ---- erro ----------------------------------------------------------------- */
.ds-err {
  font-size: 13.5px; line-height: 1.5; color: var(--soft, #475467);
  background: rgba(214, 64, 64, .07);
  border: 1px solid rgba(214, 64, 64, .22);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 18px;
}

/* ---- toast (centro da tela) ----------------------------------------------- */
.ds-toast {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.9);
  z-index: 9999;
  display: flex; align-items: center; gap: 11px;
  background: rgba(15, 23, 41, .97); color: #fff;
  padding: 15px 22px; border-radius: 16px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 24px 70px rgba(31, 106, 74, .4), inset 0 0 0 1px rgba(63, 168, 117, .45);
  opacity: 0; transition: opacity .12s ease, transform .14s cubic-bezier(.2, .9, .3, 1.4);
  max-width: 90vw; pointer-events: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ds-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ds-toast.err { box-shadow: 0 24px 70px rgba(217, 69, 69, .4), inset 0 0 0 1px rgba(217, 69, 69, .5); }
.ds-toast-i { display: inline-flex; flex: none; color: #2bd576; }
.ds-toast-i .ds-i { width: 20px; height: 20px; }
.ds-toast.err .ds-toast-i { color: #ff6b6b; }

/* ---- responsivo ----------------------------------------------------------- */
@media (max-width: 480px) {
  .ds-modal { padding: 20px 18px; border-radius: 18px; }
  .ds-foot { flex-direction: column-reverse; }
  .ds-btn.ghost { width: 100%; }
  .ds-cta-txt b { font-size: 14px; }
}

/* ---- tema escuro (dark / stone-dark) -------------------------------------- */
[data-theme="dark"] .ds-modal,
[data-theme="stone-dark"] .ds-modal {
  background: #11201a;
  color: #e8f1ec;
  border-color: rgba(120, 160, 140, .2);
}
[data-theme="dark"] .ds-head span,
[data-theme="stone-dark"] .ds-head span,
[data-theme="dark"] .ds-script-h small,
[data-theme="stone-dark"] .ds-script-h small { color: #8ba096; }
[data-theme="dark"] .ds-x:hover,
[data-theme="stone-dark"] .ds-x:hover { background: rgba(255, 255, 255, .06); color: #e8f1ec; }
[data-theme="dark"] .ds-legal,
[data-theme="stone-dark"] .ds-legal,
[data-theme="dark"] .ds-done-card,
[data-theme="stone-dark"] .ds-done-card { background: rgba(63, 168, 117, .08); border-color: rgba(63, 168, 117, .25); }
[data-theme="dark"] .ds-legal p,
[data-theme="stone-dark"] .ds-legal p,
[data-theme="dark"] .ds-script-body p,
[data-theme="stone-dark"] .ds-script-body p,
[data-theme="dark"] .ds-done-tx span,
[data-theme="stone-dark"] .ds-done-tx span,
[data-theme="dark"] .ds-pwd-note,
[data-theme="stone-dark"] .ds-pwd-note { color: #b6c8be; }
[data-theme="dark"] .ds-legal b,
[data-theme="stone-dark"] .ds-legal b,
[data-theme="dark"] .ds-script-body p,
[data-theme="stone-dark"] .ds-script-body p,
[data-theme="dark"] .ds-done-tx b,
[data-theme="stone-dark"] .ds-done-tx b,
[data-theme="dark"] .ds-check-txt,
[data-theme="stone-dark"] .ds-check-txt,
[data-theme="dark"] .ds-target-v,
[data-theme="stone-dark"] .ds-target-v { color: #e8f1ec; }
[data-theme="dark"] .ds-script,
[data-theme="stone-dark"] .ds-script,
[data-theme="dark"] .ds-check,
[data-theme="stone-dark"] .ds-check,
[data-theme="dark"] .ds-field input,
[data-theme="stone-dark"] .ds-field input,
[data-theme="dark"] .ds-pwd-row input,
[data-theme="stone-dark"] .ds-pwd-row input,
[data-theme="dark"] .ds-copy,
[data-theme="stone-dark"] .ds-copy,
[data-theme="dark"] .ds-btn.ghost,
[data-theme="stone-dark"] .ds-btn.ghost {
  background: rgba(255, 255, 255, .05);
  color: #e8f1ec;
  border-color: rgba(150, 180, 160, .22);
}
[data-theme="dark"] .ds-field input::placeholder,
[data-theme="stone-dark"] .ds-field input::placeholder { color: #708a7e; }
[data-theme="dark"] .ds-target,
[data-theme="stone-dark"] .ds-target { background: rgba(255, 255, 255, .04); border-color: rgba(150, 180, 160, .18); }
[data-theme="dark"] .ds-bar,
[data-theme="stone-dark"] .ds-bar { background: rgba(255, 255, 255, .1); }
[data-theme="dark"] .ds-copy,
[data-theme="stone-dark"] .ds-copy { color: #6fe3a8; border-color: rgba(63, 168, 117, .5); }
[data-theme="dark"] .ds-check:has(input:checked),
[data-theme="stone-dark"] .ds-check:has(input:checked) { background: rgba(63, 168, 117, .12); }

/* ---- prefers-reduced-motion: corta TODA animação não-essencial ------------ */
@media (prefers-reduced-motion: reduce) {
  .ds-cta { animation: none; }
  .ds-cta-glow { animation: none; opacity: .45; }
  .ds-backdrop, .ds-backdrop .ds-modal { transition: none; }
  .ds-prog-orb span { animation: none; opacity: 1; transform: none; }
  .ds-bar-fill { transition: none; }
  .ds-bar-fill::after { animation: none; display: none; }
  .ds-phrase-in { animation: none; }
  .ds-toast { transition: opacity .12s ease; }
  .ds-toast.show { transform: translate(-50%, -50%) scale(1); }
}
/* ===== HAON_DEEPSEC_V1_END ===== */
