/* diag-flow.css — modal in-page do diagnóstico (visual distinto da VSL: vidro, moldura, etapas) */

html.diag-flow-open,
html.diag-flow-open body {
  overflow: hidden;
}

.diag-flow {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.diag-flow[hidden] {
  display: none !important;
}

.diag-flow__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  cursor: pointer;
  background: rgba(2, 4, 8, 0.78);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.diag-flow__shell {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(22, 22, 24, 0.94), rgba(8, 8, 10, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(232, 231, 210, 0.07),
    0 28px 80px rgba(0, 0, 0, 0.65),
    0 0 120px -40px rgba(118, 112, 98, 0.35);
  overflow: hidden;
  animation: diag-flow-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.diag-flow__shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, var(--gradient-gold-end), var(--gradient-gold-start), transparent);
  opacity: 0.95;
  pointer-events: none;
}

@keyframes diag-flow-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.94);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.diag-flow__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.65rem 1.15rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.diag-flow__brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.diag-flow__brand-wayne {
  color: #fff;
}

.diag-flow__brand-system {
  background: linear-gradient(135deg, var(--gradient-gold-start), var(--gradient-gold-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.diag-flow__close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.diag-flow__close:hover,
.diag-flow__close:focus-visible {
  background: rgba(232, 231, 210, 0.1);
  color: #fff;
  border-color: rgba(232, 231, 210, 0.25);
  outline: none;
}

.diag-flow__eyebrow {
  margin: 0;
  padding: 0 1.15rem 0.5rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.52);
  text-transform: uppercase;
}

.diag-flow__progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.15rem 0.75rem;
  flex-shrink: 0;
}

.diag-flow__step-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 231, 210, 0.55);
  font-family: var(--font-display);
  white-space: nowrap;
}

.diag-flow__progress-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  max-width: 160px;
}

.diag-flow__progress-fill {
  height: 100%;
  width: 9.09%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gradient-gold-start), var(--gradient-gold-end));
  box-shadow: 0 0 14px rgba(232, 231, 210, 0.35);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.diag-flow__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 1rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 231, 210, 0.35) transparent;
}

.diag-flow__scroll::-webkit-scrollbar {
  width: 6px;
}
.diag-flow__scroll::-webkit-scrollbar-thumb {
  background: rgba(232, 231, 210, 0.25);
  border-radius: 999px;
}

/* Form steps (mesma semântica do quiz; escopado) */
.diag-flow .diagnostico-form {
  text-align: center;
}

.diag-flow .quiz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: diag-step-in 0.32s ease;
  padding: 0.25rem 0.15rem 0.5rem;
  width: 100%;
}

.diag-flow .quiz-step--hidden {
  display: none !important;
}

@keyframes diag-step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tremida ao erro de validação (padrão comum em formulários) */
@keyframes diag-field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-10px);
  }
  30% {
    transform: translateX(10px);
  }
  45% {
    transform: translateX(-8px);
  }
  60% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-4px);
  }
  90% {
    transform: translateX(4px);
  }
}

.diag-flow .quiz-step--shake {
  animation: diag-field-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.diag-flow .step-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.8vw, 1.28rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.32;
  background: linear-gradient(135deg, var(--gradient-gold-start), var(--gradient-gold-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.diag-flow .step-title .highlight-green,
.diag-flow .step-title .highlight-red,
.diag-flow .thanks-headline .highlight-green,
.diag-flow .thanks-subheadline .highlight-green {
  color: inherit;
}

.diag-flow .step-hint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 1rem;
  width: 100%;
}

.diag-flow .step-hint--bold {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.diag-flow .form-group {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 1rem;
  text-align: left;
}

.diag-flow .form-label--step {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 231, 210, 0.55);
  margin-bottom: 0.4rem;
}

.diag-flow .form-input--step {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  color: #f0f0f0;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.diag-flow .form-input--step:focus {
  outline: none;
  border-color: rgba(232, 231, 210, 0.45);
  box-shadow: 0 0 0 3px rgba(232, 231, 210, 0.12);
}

.diag-flow .form-input--step::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.diag-flow textarea.form-input--step {
  resize: vertical;
  min-height: 100px;
}

.diag-flow .form-radio-row--vertical {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.diag-flow .form-radio-option--faturamento {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.diag-flow .form-radio-option--faturamento:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.diag-flow .form-radio-option--faturamento:has(input:checked) {
  background: rgba(232, 231, 210, 0.08);
  border-color: rgba(232, 231, 210, 0.35);
  box-shadow: 0 0 0 1px rgba(232, 231, 210, 0.12);
}

.diag-flow .form-radio-option--faturamento input {
  margin-top: 0.2rem;
  accent-color: #c4b896;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.diag-flow .radio-bullet {
  display: none;
}

.diag-flow .form-radio-option--sim .option-text--green,
.diag-flow .form-radio-option--nao .option-text--red {
  font-weight: 700;
  font-size: 1.02rem;
}

.diag-flow .step-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  margin-top: 0.5rem;
}

.diag-flow .btn-continuar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--gradient-gold-start), var(--gradient-gold-end));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.diag-flow .btn-continuar:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(232, 231, 210, 0.15);
}

.diag-flow .btn-voltar {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  padding: 0.5rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.diag-flow .btn-voltar:hover {
  color: rgba(255, 255, 255, 0.75);
}

.diag-flow .step-followup-headline,
.diag-flow .step-followup-question {
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 3.5vw, 1.22rem);
  font-weight: 700;
  line-height: 1.32;
  margin: 0 0 0.85rem;
  background: linear-gradient(135deg, var(--gradient-gold-start), var(--gradient-gold-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.diag-flow .step-followup-sub {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.diag-flow .step-followup-headline .highlight-green,
.diag-flow .step-followup-headline .highlight-red,
.diag-flow .step-followup-question .highlight-green,
.diag-flow .step-followup-question .highlight-red {
  color: var(--gradient-gold-end);
  -webkit-text-fill-color: #e8e7d2;
}

.diag-flow .btn-followup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  min-height: 48px;
  font-size: 0.95rem;
  font-family: var(--font);
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.diag-flow .btn-followup:hover {
  border-color: rgba(232, 231, 210, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.diag-flow .thanks-headline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  line-height: 1.28;
  background: linear-gradient(135deg, var(--gradient-gold-start), var(--gradient-gold-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.diag-flow .thanks-subheadline {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  margin: 0;
}

.diag-flow .thanks-cta-lead {
  margin: 1.15rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.diag-flow .thanks-cta-lead .highlight-green {
  color: #e8e7d2;
  font-weight: 600;
}

.diag-flow__thanks-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1rem;
  padding: 0.95rem 1.15rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  color: #0a0a0a;
  background: linear-gradient(135deg, #25d366, #128c7e);
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(37, 211, 102, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.diag-flow__thanks-wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(37, 211, 102, 0.35);
  color: #0a0a0a;
}

.diag-flow .thanks-block--final {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.diag-flow .thanks-block--final .diag-flow__thanks-wa-btn {
  margin-top: 1.35rem;
  margin-bottom: 0;
}

@media (max-width: 380px) {
  .diag-flow__shell {
    border-radius: 18px;
  }
  .diag-flow__progress-meta {
    flex-wrap: wrap;
  }
  .diag-flow__progress-track {
    order: 2;
    width: 100%;
    max-width: none;
  }
}
