/* ========================================
   DevBatista - Diagnóstico Tecnológico (modal de captação)
   Reaproveita os tokens de css/style.css (:root).
   Carregado depois de style.css.
   ======================================== */

/* ========================================
   Overlay
   ======================================== */
.lq-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  animation: lqOverlayIn 0.25s ease both;
}

.lq-overlay[hidden] {
  display: none;
}

body.lq-open {
  overflow: hidden;
}

@keyframes lqOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lqModalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lqStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lqSpin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Modal
   ======================================== */
.lq-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(37rem, 100%);
  max-height: min(92vh, 46rem);
  max-height: min(92dvh, 46rem);
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.7);
  animation: lqModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

/* Fio de luz no topo, como as seções de destaque do site */
.lq-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-400), transparent);
  pointer-events: none;
}

/* ========================================
   Botão fechar
   ======================================== */
.lq-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  color: var(--slate-400);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.lq-close:hover {
  color: var(--white);
  border-color: var(--slate-600);
  background: rgba(30, 41, 59, 0.9);
}

.lq-close svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ========================================
   Cabeçalho
   ======================================== */
.lq-head {
  flex-shrink: 0;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(8, 51, 68, 0.28), transparent);
}

.lq-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cyan-400);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.625rem;
}

.lq-eyebrow::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
  flex-shrink: 0;
}

.lq-title {
  color: var(--white);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  padding-right: 2.75rem;
  text-wrap: balance;
}

.lq-subtitle {
  color: var(--slate-400);
  font-size: var(--fs-sm);
  line-height: 1.65;
  margin-top: 0.5rem;
}

.lq-subtitle:empty {
  display: none;
}

/* ========================================
   Progresso
   ======================================== */
.lq-progress {
  margin-top: 1.25rem;
}

.lq-progress[hidden] {
  display: none;
}

.lq-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--slate-400);
  font-size: var(--fs-xs);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.lq-progress-info strong {
  color: var(--cyan-400);
  font-weight: 700;
}

.lq-progress-track {
  height: 0.375rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden;
}

.lq-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-400), var(--blue-400), var(--teal-400));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Corpo
   ======================================== */
.lq-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem 1.75rem;
}

.lq-step {
  animation: lqStepIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lq-step[hidden] {
  display: none;
}

.lq-question {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.lq-question legend {
  display: block;
  width: 100%;
  color: var(--white);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  padding: 0;
}

/* ========================================
   Opções
   ======================================== */
.lq-options {
  display: grid;
  gap: 0.5rem;
}

.lq-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  color: var(--slate-300);
  font-size: var(--fs-sm);
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.lq-option:hover {
  border-color: rgba(8, 145, 178, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: var(--white);
}

.lq-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.lq-option-mark {
  position: relative;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--slate-600);
  border-radius: 999px;
  transition: border-color 0.25s, background 0.25s;
}

/* Marca de seleção: não depende só de cor */
.lq-option-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--bg-primary);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lq-option:has(input:checked) {
  border-color: var(--cyan-400);
  background: rgba(34, 211, 238, 0.09);
  color: var(--white);
  font-weight: 600;
}

.lq-option:has(input:checked) .lq-option-mark {
  border-color: var(--cyan-400);
  background: var(--cyan-400);
}

.lq-option:has(input:checked) .lq-option-mark::after {
  transform: translate(-50%, -50%) scale(1);
}

.lq-option:has(input:focus-visible) {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
}

/* Fallback para navegadores sem :has() */
.lq-option.is-checked {
  border-color: var(--cyan-400);
  background: rgba(34, 211, 238, 0.09);
  color: var(--white);
  font-weight: 600;
}

.lq-option.is-checked .lq-option-mark {
  border-color: var(--cyan-400);
  background: var(--cyan-400);
}

.lq-option.is-checked .lq-option-mark::after {
  transform: translate(-50%, -50%) scale(1);
}

.lq-option.is-focused {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
}

/* ========================================
   Campos
   ======================================== */
.lq-fields {
  display: grid;
  gap: 1rem;
}

.lq-field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--slate-300);
  margin-bottom: 0.375rem;
}

.lq-field input,
.lq-field textarea {
  width: 100%;
  min-height: 3rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--slate-700);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--white);
  font-size: 1rem; /* >=16px evita zoom automático no iOS */
  font-family: var(--font-sans);
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
}

.lq-field textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.6;
}

.lq-field input::placeholder,
.lq-field textarea::placeholder {
  color: var(--slate-500);
}

.lq-field input:focus,
.lq-field textarea:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.lq-field input[aria-invalid="true"] {
  border-color: #f87171;
}

.lq-error {
  display: block;
  color: #fca5a5;
  font-size: var(--fs-xs);
  line-height: 1.5;
  margin-top: 0.375rem;
}

.lq-error:empty {
  display: none;
}

/* Honeypot: invisível para pessoas, preenchível por bots */
.lq-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Campo condicional ("Outro") */
.lq-conditional {
  margin-top: 1rem;
  animation: lqStepIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lq-conditional[hidden] {
  display: none;
}

/* ========================================
   Introdução
   ======================================== */
.lq-intro-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.lq-intro-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--slate-400);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.lq-intro-item svg {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  color: var(--cyan-400);
}

.lq-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--slate-500);
  font-size: var(--fs-xs);
  line-height: 1.6;
  margin-top: 1.25rem;
}

.lq-note svg {
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.1875rem;
}

/* ========================================
   Estados de envio
   ======================================== */
.lq-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.lq-state[hidden] {
  display: none;
}

.lq-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--cyan-400);
  border-radius: 999px;
  animation: lqSpin 0.8s linear infinite;
  margin-bottom: 1.25rem;
}

.lq-state h3 {
  color: var(--white);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.lq-state p {
  color: var(--slate-400);
  font-size: var(--fs-sm);
  line-height: 1.65;
  max-width: 26rem;
}

.lq-state-icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  margin-bottom: 1rem;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

/* ========================================
   Resultado
   ======================================== */
.lq-result-card {
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(8, 51, 68, 0.38), rgba(15, 23, 42, 0.5));
  padding: 1.5rem;
  text-align: center;
}

.lq-result-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  color: var(--cyan-300);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--border-accent);
  margin-bottom: 1rem;
}

.lq-gauge {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  margin-bottom: 0.625rem;
}

.lq-gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-400), var(--blue-400), var(--teal-400));
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.lq-gauge-scale {
  display: flex;
  justify-content: space-between;
  color: var(--slate-500);
  font-size: var(--fs-xs);
  margin-bottom: 1.25rem;
}

.lq-result-title {
  color: var(--white);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.625rem;
  text-wrap: balance;
}

.lq-result-copy {
  color: var(--slate-400);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.lq-result-points {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  text-align: left;
}

.lq-result-point {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  color: var(--slate-300);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.lq-result-point svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1875rem;
  color: var(--cyan-400);
}

.lq-result-next {
  color: var(--slate-400);
  font-size: var(--fs-sm);
  line-height: 1.7;
  text-align: center;
  margin-top: 1.25rem;
}

/* ========================================
   Rodapé
   ======================================== */
.lq-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.125rem 1.75rem;
  padding-bottom: max(1.125rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  background: rgba(11, 17, 32, 0.75);
}

.lq-foot[hidden] {
  display: none;
}

.lq-btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.75rem 1.125rem;
  background: transparent;
  border: 1px solid var(--slate-700);
  border-radius: 0.5rem;
  color: var(--slate-300);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.lq-btn-back:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--slate-600);
  color: var(--white);
}

.lq-btn-back[hidden] {
  display: none;
}

.lq-btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-left: auto;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background: var(--cyan-400);
  color: var(--bg-primary);
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;
}

.lq-btn-next:hover:not(:disabled) {
  background: var(--cyan-300);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.2);
}

.lq-btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lq-btn-next svg,
.lq-btn-back svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.lq-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-left: auto;
  min-height: 3rem;
  padding: 0.875rem 1.5rem;
  background: var(--emerald-500);
  color: #04150f;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
}

.lq-btn-wa:hover {
  background: var(--emerald-400);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.24);
}

.lq-btn-wa svg {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
}

.lq-btn-wa.lq-grow,
.lq-btn-next.lq-grow {
  flex: 1;
}

/* Live region para leitores de tela */
.lq-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Mobile
   ======================================== */
@media (max-width: 640px) {
  .lq-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .lq-modal {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .lq-head {
    padding: 1.25rem 1.25rem 1rem;
  }

  .lq-title {
    font-size: 1.1875rem;
  }

  .lq-body {
    padding: 1.25rem;
  }

  .lq-foot {
    padding: 0.875rem 1.25rem;
    padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
  }

  .lq-btn-next {
    flex: 1;
  }

  .lq-question legend {
    font-size: 1rem;
  }

  .lq-result-card {
    padding: 1.25rem;
  }

  .lq-result-title {
    font-size: 1.25rem;
  }
}

/* Telas baixas / teclado aberto: comprime o cabeçalho */
@media (max-height: 640px) {
  .lq-head {
    padding-top: 1rem;
    padding-bottom: 0.875rem;
  }

  .lq-progress {
    margin-top: 0.875rem;
  }

  .lq-body {
    padding-top: 1.125rem;
    padding-bottom: 1.125rem;
  }
}
