/* ==========================================================================
   LVL FULLSCREEN DIAGNOSTIC MODAL — CYBER-LUXURY APPLE OFF-WHITE
   Triagem Interativa Guiada com Haptic Feedback & Hand-off WhatsApp
   Luís Visual Lab • 100% Fullscreen Immersive Experience
   ========================================================================== */

.lvl-diag-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background: rgba(251, 251, 253, 0.98);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.lvl-diag-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Fundo com Iluminação Radial Holográfica LVL */
.lvl-diag-ambient-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 520px;
  background: radial-gradient(circle, rgba(0, 199, 235, 0.12) 0%, rgba(94, 92, 230, 0.06) 40%, rgba(251, 251, 253, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Cabeçalho Fixo do Modal */
.lvl-diag-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  padding: 18px 36px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0;
  gap: 28px;
}

.lvl-diag-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.lvl-diag-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 113, 227, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 75, 170, 0.06);
  padding: 3px;
  box-sizing: border-box;
}

.lvl-diag-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lvl-diag-brand-text {
  display: flex;
  flex-direction: column;
}

.lvl-diag-brand-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary, #1d1d1f);
  line-height: 1.2;
}

.lvl-diag-brand-subtitle {
  font-size: 0.72rem;
  color: var(--apple-blue, #0071e3);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Indicador de Passo e Barra de Progresso no Header */
.lvl-diag-progress-wrap {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 220px;
  min-width: 180px;
  max-width: 260px;
}

.lvl-diag-step-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary, #86868b);
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 12px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.lvl-diag-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.lvl-diag-progress-bar {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #0071e3 0%, #00c7eb 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 199, 235, 0.6);
}

/* Botão Fechar Modal (Luxury Circular Badge com Respiro Generoso) */
.lvl-diag-close-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  height: 38px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: var(--text-secondary, #6e6e73);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lvl-diag-close-btn:hover {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.3);
  color: #ff3b30;
  transform: translateY(-1px);
}

.lvl-diag-close-btn kbd {
  font-family: inherit;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Corpo Principal do Modal com Scroll Fluido */
.lvl-diag-body {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 36px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scrollbar-width: none;
}

.lvl-diag-body::-webkit-scrollbar {
  display: none;
  width: 0;
}

.lvl-diag-stage-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cabeçalho da Etapa Atual */
.lvl-diag-stage-header {
  text-align: center;
  margin-bottom: 30px;
  animation: diagFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lvl-diag-badge-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apple-blue, #0071e3);
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.2);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.lvl-diag-badge-step .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apple-blue, #0071e3);
  box-shadow: 0 0 8px rgba(0, 113, 227, 0.8);
}

.lvl-diag-stage-title {
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 700;
  color: var(--text-primary, #1d1d1f);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.lvl-diag-stage-subtitle {
  font-size: clamp(0.88rem, 1.8vw, 1.02rem);
  color: var(--text-secondary, #6e6e73);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Grade de Opções Bento Card */
.lvl-diag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 32px;
}

.lvl-diag-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@keyframes diagCardIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lvl-diag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  text-align: left;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  animation: diagCardIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lvl-diag-card:nth-child(1) { animation-delay: 0.04s; }
.lvl-diag-card:nth-child(2) { animation-delay: 0.09s; }
.lvl-diag-card:nth-child(3) { animation-delay: 0.14s; }
.lvl-diag-card:nth-child(4) { animation-delay: 0.19s; }

.lvl-diag-card:hover {
  background: #ffffff;
  border-color: rgba(0, 113, 227, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 113, 227, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.lvl-diag-card.is-selected {
  background: #ffffff;
  border-color: var(--apple-blue, #0071e3);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.25), 0 12px 30px rgba(0, 113, 227, 0.14);
}

.lvl-diag-card-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.lvl-diag-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #1d1d1f);
  margin-bottom: 6px;
  line-height: 1.25;
}

.lvl-diag-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary, #6e6e73);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.lvl-diag-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--apple-blue, #0071e3);
  background: rgba(0, 113, 227, 0.07);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 113, 227, 0.14);
}

/* Barra de Ações Inferior (Voltar / Avançar) */
.lvl-diag-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 780px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.lvl-diag-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: var(--text-secondary, #6e6e73);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.lvl-diag-btn-prev:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary, #1d1d1f);
}

.lvl-diag-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill, 9999px);
  border: none;
  background: var(--apple-blue, #0071e3);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.32);
}

.lvl-diag-btn-next:hover:not(:disabled) {
  background: #0077ed;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.42);
}

.lvl-diag-btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   ETAPA 4: CARD EXECUTIVO DE CONCLUSÃO & HAND-OFF WHATSAPP
   ========================================================================== */
.lvl-diag-result-card {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: 26px;
  padding: 32px 30px;
  box-shadow: 0 16px 44px rgba(0, 113, 227, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  animation: diagCardIn 0.44s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}

.lvl-diag-result-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 199, 235, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.lvl-diag-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lvl-diag-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #25d366;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.24);
  padding: 4px 12px;
  border-radius: 999px;
}

.lvl-diag-result-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.8);
}

.lvl-diag-result-code {
  font-size: 0.74rem;
  font-family: monospace;
  color: var(--text-tertiary, #86868b);
  letter-spacing: 0.05em;
}

.lvl-diag-result-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary, #1d1d1f);
  margin-bottom: 10px;
  line-height: 1.25;
}

.lvl-diag-result-summary {
  font-size: 0.94rem;
  color: var(--text-secondary, #6e6e73);
  line-height: 1.55;
  margin-bottom: 22px;
}

/* Grade de Especificações da Arquitetura */
.lvl-diag-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.lvl-diag-spec-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
}

.lvl-diag-spec-label {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #86868b);
  margin-bottom: 3px;
}

.lvl-diag-spec-value {
  font-size: 0.90rem;
  font-weight: 600;
  color: var(--text-primary, #1d1d1f);
}

/* Entregáveis Chave */
.lvl-diag-deliverables {
  background: rgba(0, 113, 227, 0.03);
  border: 1px solid rgba(0, 113, 227, 0.10);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 28px;
}

.lvl-diag-deliverables-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--apple-blue, #0071e3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lvl-diag-deliverables-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lvl-diag-deliverables-list li {
  font-size: 0.85rem;
  color: var(--text-secondary, #48484a);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.lvl-diag-deliverables-list li svg {
  color: #34c759;
  flex-shrink: 0;
}

/* CTA WhatsApp de Alta Autoridade */
.lvl-diag-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.lvl-diag-btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  background: #25d366;
  color: #ffffff !important;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: var(--radius-pill, 9999px);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.32);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.lvl-diag-btn-whatsapp:hover {
  background: #20bd5a;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.44);
}

.lvl-diag-btn-whatsapp svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.lvl-diag-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lvl-diag-btn-copy,
.lvl-diag-btn-restart {
  background: transparent;
  border: none;
  color: var(--text-tertiary, #86868b);
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.lvl-diag-btn-copy:hover,
.lvl-diag-btn-restart:hover {
  color: var(--text-primary, #1d1d1f);
  background: rgba(0, 0, 0, 0.04);
}

/* Animações e Transições */
@keyframes diagFadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsividade Mobile Extrema */
@media (max-width: 768px) {
  .lvl-diag-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    padding: 12px 16px;
    align-items: center;
  }

  .lvl-diag-brand-subtitle {
    display: none;
  }

  .lvl-diag-progress-wrap {
    justify-self: center;
    width: 100%;
    max-width: 140px;
    min-width: 100px;
  }

  .lvl-diag-close-btn {
    justify-self: end;
    padding: 6px 12px;
    height: 34px;
    font-size: 0.78rem;
  }

  .lvl-diag-close-btn kbd {
    display: none;
  }

  .lvl-diag-body {
    padding: 24px 14px 40px;
  }

  .lvl-diag-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .lvl-diag-grid.cols-3 {
    grid-template-columns: 1fr !important;
  }

  .lvl-diag-card {
    padding: 16px 16px;
  }

  .lvl-diag-result-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .lvl-diag-specs-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lvl-diag-btn-whatsapp {
    font-size: 0.94rem;
    padding: 14px 18px;
  }
}
