/* ==========================================================================
   LP Agendamento — Wizard styles (mobile-first)
   Consome: global.css + cadastro_megs.css
   Mantém IDs/classes usados por landing.js
   ========================================================================== */

#lp-form-start {
  scroll-margin-top: 1.5rem;
}

/* ----- Wizard wrap (dentro do meg-grid) ----- */
.lp-wrap.meg-card {
  padding: 1.5rem 1.25rem;
  overflow: visible; /* evita corte dos botões Continuar pelo overflow:hidden de .meg-card */
}
@media (min-width: 480px) {
  .lp-wrap.meg-card {
    padding: 2rem 1.5rem;
  }
}

/* ----- Progress ----- */
.lp-progress-wrap {
  margin-bottom: 1.25rem;
}
.lp-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.lp-progress-steps-spacer { flex: 1; }

.lp-progress {
  height: 6px;
  background: #f1f3f5;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.lp-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7ed321, #2d70cb);
  border-radius: 3px;
  transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lp-progress-steps {
  display: flex;
  justify-content: space-between;
  max-width: 12rem;
  margin: 0 auto;
  gap: 0.25rem;
}
.lp-step-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #f1f3f5;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.2s ease;
}
.lp-step-dot.active {
  background: #2d70cb;
  border-color: #2d70cb;
  color: #fff;
}
.lp-step-dot.done {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.lp-progress-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

/* ----- Steps ----- */
.lp-main { position: relative; }
.lp-step {
  display: none;
  animation: lpFadeIn 0.25s ease-out;
}
.lp-step.is-active {
  display: block;
}
.lp-block {
  margin-bottom: 1.25rem;
}
.lp-step-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a1a2e;
}
.lp-step-hint {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0 0 1rem;
}

/* Select (metragem) — usa meg-select, garantir altura */
.lp-wrap .meg-select {
  margin-bottom: 1rem;
}

/* Accordion (guia metragem) */
.lp-accordion {
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.lp-accordion summary {
  padding: 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #2d70cb;
  font-weight: 500;
  background: #fafbfc;
}
.lp-accordion summary:hover { background: #f1f3f5; }
.lp-accordion-content { padding: 1rem; background: #fff; }
.lp-table-guide {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}
.lp-table-guide th,
.lp-table-guide td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.lp-table-guide th { font-weight: 600; color: #1a1a2e; }

/* Toggles (botões de seleção) */
.lp-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.lp-toggles-inline { flex-direction: row; }
.lp-toggle,
.lp-toggle.meg-toggle {
  min-height: var(--meg-touch-min, 48px);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lp-toggle:hover,
.lp-toggle.meg-toggle:hover {
  border-color: #4a90e2;
  background: #f0f7ff;
}
.lp-toggle.active,
.lp-toggle.meg-toggle.active {
  border-color: #2d70cb;
  background: #2d70cb;
  color: #fff;
}

/* Microfeedback */
.lp-microfeedback {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.lp-microfeedback[hidden] { display: none; }
.lp-microfeedback-ok { color: #10b981; font-weight: 600; }

/* Erro e ações */
.lp-error-actions { margin-top: 0.5rem; }
.lp-error-actions[hidden] { display: none; }

/* CTA botões — garantir sempre visíveis */
.lp-step .lp-btn-cta {
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
}
/* Step 1 — botão Continuar: visibilidade + contraste WCAG */
#step-1 #lp-btn-next-1,
.lp-wrap .lp-btn-cta.meg-btn--primary {
  display: inline-flex;
  visibility: visible;
  background: #5a9a10 !important;
  color: #ffffff !important;
  border: 2px solid #5a9a10 !important;
  box-shadow: 0 4px 12px rgba(90, 154, 16, 0.4);
}
.lp-wrap .lp-btn-cta.meg-btn--primary:hover {
  background: #4d8510 !important;
  border-color: #4d8510 !important;
  color: #ffffff !important;
}
.lp-wrap .lp-btn-cta.meg-btn--primary:disabled {
  background: #9ca3af !important;
  border-color: #9ca3af !important;
  color: #ffffff !important;
  opacity: 1;
}
.lp-btn-cta {
  width: 100%;
  margin-top: 1rem;
}
@media (min-width: 480px) {
  .lp-btn-cta { width: auto; min-width: 12rem; }
}
.lp-btn-final {
  width: 100%;
  margin-top: 1.25rem;
}
.lp-btn-final:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Summary card (resumo antes de enviar) */
.lp-summary-card {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
}
.lp-summary-card .lp-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  gap: 0.75rem;
}
.lp-summary-card .lp-summary-row:last-child { border-bottom: none; }
.lp-summary-card .lp-summary-label { font-size: 0.875rem; color: #6b7280; flex-shrink: 0; }
.lp-summary-card .lp-summary-value { font-size: 1rem; font-weight: 600; color: #1a1a2e; text-align: right; }

/* Done screen */
.lp-done-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #10b981;
  margin: 0 0 1rem;
}
.lp-done-text {
  font-size: 1rem;
  color: #1a1a2e;
  margin: 0;
}

/* Lightbox "Fora da área" — destaque e elegância */
.lp-fora-area-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 51, 102, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 1rem;
  animation: lpForaOverlayIn 0.25s ease-out;
}
.lp-fora-area-overlay:not([hidden]) {
  display: flex;
}
.lp-fora-area-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 1.75rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  text-align: center;
  animation: lpForaModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lp-fora-area-modal--meg {
  display: flex;
  gap: 1.25rem;
  text-align: left;
  max-width: 26rem;
}

.lp-fora-area-modal__meg {
  flex-shrink: 0;
}

.lp-fora-area-modal__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lp-fora-area-modal__content {
  flex: 1;
  min-width: 0;
}

.lp-fora-area-modal__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.lp-fora-area-modal__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #003366;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.lp-fora-area-modal__text {
  font-size: 1rem;
  color: #4a4a5a;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.lp-fora-area-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lp-fora-area-modal__btn {
  width: 100%;
  min-height: 52px;
}

.lp-fora-area-modal__btn-secondary {
  min-height: 48px;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.lp-fora-area-modal__btn-secondary:hover {
  background: #f1f5f9;
}

.lp-fora-area-modal__aviso-form,
.lp-fora-area-modal__aviso-success {
  margin-top: 1rem;
}

.lp-fora-area-modal__aviso-intro {
  font-size: 0.9375rem;
  color: #4a4a5a;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.lp-fora-area-modal__label {
  display: block;
  font-size: 0.875rem;
  color: #4a4a5a;
  margin-bottom: 0.35rem;
}

.lp-fora-area-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #4a4a5a;
  margin: 0.75rem 0 1rem;
  cursor: pointer;
  line-height: 1.4;
}

.lp-fora-area-modal__consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.lp-fora-area-modal__input {
  width: 100%;
  margin-bottom: 0.75rem;
  min-height: 48px;
}

.lp-fora-area-modal__aviso-error {
  font-size: 0.875rem;
  color: #dc2626;
  margin: 0 0 0.5rem;
}

.lp-fora-area-modal__aviso-success p {
  font-size: 1rem;
  color: #059669;
  margin: 0 0 1rem;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .lp-fora-area-modal--meg {
    flex-direction: column;
    text-align: center;
  }
}

/* Notify-Me modal — contraste botões (evitar branco no branco) */
.lp-fora-area-overlay .lp-fora-area-modal__btn.meg-btn--primary {
  background: #78BE20;
  color: #fff;
  border: 2px solid #78BE20;
  box-shadow: 0 4px 12px rgba(120, 190, 32, 0.35);
  cursor: pointer;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn.meg-btn--primary:hover {
  background: #6aa91c;
  border-color: #6aa91c;
  color: #fff;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn.meg-btn--primary:focus-visible {
  outline: 2px solid #78BE20;
  outline-offset: 2px;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn-secondary {
  background: #fff;
  color: #003366;
  border: 2px solid #2d70cb;
  cursor: pointer;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn-secondary:hover {
  background: #f0f7ff;
  border-color: #2d70cb;
  color: #003366;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn-secondary:focus-visible {
  outline: 2px solid #2d70cb;
  outline-offset: 2px;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn.meg-btn--primary:disabled {
  background: #9ca3af;
  color: #fff;
  border-color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}
.lp-fora-area-overlay .lp-fora-area-modal__btn.meg-btn--primary:disabled:hover {
  background: #9ca3af;
  color: #fff;
}
@keyframes lpForaOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes lpForaModalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lp-fora-area-overlay,
  .lp-fora-area-modal { animation: none; }
}

/* Fora da área (fallback no step, mantido para acessibilidade) */
.lp-message {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 1rem;
  background: #eff6ff;
  color: #1e40af;
}

/* Animação */
.lp-step-highlight {
  animation: lpHighlight 0.8s ease-out;
}
@keyframes lpHighlight {
  0% { box-shadow: 0 0 0 0 rgba(45, 112, 203, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(45, 112, 203, 0.15); }
  100% { box-shadow: none; }
}
@keyframes lpFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-step { animation: none; }
  .lp-progress-bar { transition: none; }
}

/* ----- Modal Coreco ----- */
.coreco-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.coreco-modal-overlay:not([hidden]) {
  display: flex;
}
.coreco-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 22rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.coreco-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.coreco-modal__title { font-size: 1.125rem; font-weight: 700; margin: 0; color: #1a1a2e; }
.coreco-modal__body { margin-bottom: 1rem; }
.coreco-modal__loading { font-size: 0.875rem; color: #6b7280; margin: 0; }
.coreco-modal__content .coreco-modal__balance { font-size: 1.5rem; font-weight: 700; color: #003366; margin: 0 0 0.25rem; }
.coreco-modal__content .coreco-modal__brl,
.coreco-modal__content .coreco-modal__text { font-size: 0.9375rem; color: #1a1a2e; margin: 0 0 0.5rem; }
.coreco-modal__content .lp-coreco-explicativo__micro { font-size: 0.875rem; color: #6b7280; margin: 0; line-height: 1.4; }
.coreco-modal__close { display: block; width: 100%; }

/* Footer LP */
.lp-footer {
  flex-shrink: 0;
  padding: 1.5rem 1.25rem;
  background: #003366;
  color: rgba(255,255,255,0.9);
  text-align: center;
}
.footer-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.25rem; }
.lp-footer .lp-footer-text { font-size: 0.875rem; margin: 0; opacity: 0.9; }

/* FIX: CTA Continuar step1 + Notify-Me — fundo sempre envolve o texto */
.lp-wrap .lp-btn-cta,
.lp-fora-area-overlay .lp-fora-area-modal__btn,
.lp-fora-area-overlay .lp-fora-area-modal__btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 22px !important;
  min-height: 48px !important;
  min-width: 160px !important;
  width: 100% !important;
  max-width: 100%;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  border-radius: 14px;
  text-align: center;
  overflow: visible;
}
@media (min-width: 480px) {
  .lp-wrap .lp-btn-cta {
    width: auto !important;
    min-width: 180px !important;
  }
}
