/* ==========================================================================
   Cadastro MEGs — LP pública (MOBILE FIRST)
   Base: mobile (Android prioridade), media queries expandem para tablet/desktop.
   UX: didático, toques grandes (48px+), acessível.
   ========================================================================== */

:root {
  --meg-card-radius: 16px;
  --meg-touch-min: 48px;
  --meg-input-height: 48px;
  --meg-btn-height: 52px;
  --meg-transition: 0.2s ease;
  --meg-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.08);
  --meg-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ----- Base Mobile ----- */
.meg-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f4f8;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a2e;
  overflow-x: hidden;
}

.meg-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: #003366;
  box-shadow: var(--meg-shadow-light);
}

.meg-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.meg-brand__logo {
  height: 2.5rem;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.meg-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  overflow-x: hidden;
}

.meg-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.meg-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar vai embaixo no mobile */
.meg-sidebar {
  order: 1;
}

.meg-form-wrap {
  order: 0;
}

/* ----- Form ----- */
.meg-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.meg-form-header {
  margin-bottom: 0.25rem;
}

/* Hero bullets + CTA */
.meg-hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.meg-hero-bullets li {
  padding: 0.25rem 0;
  font-size: 1rem;
  color: #1a1a2e;
}
.meg-hero-bullets li::before {
  content: "✔ ";
  color: #7ed321;
}
.meg-cta-wrap {
  margin-bottom: 0.5rem;
}

/* Contraste: botão hero "Ver disponibilidade" — verde + texto claro */
.meg-cta-wrap .meg-btn--primary,
#lp-hero-cta.meg-btn--primary {
  background: #78BE20;
  color: #fff;
  box-shadow: 0 4px 14px rgba(120, 190, 32, 0.35);
}
.meg-cta-wrap .meg-btn--primary:hover,
#lp-hero-cta.meg-btn--primary:hover {
  background: #6aa91c;
  color: #fff;
}
.meg-cta-wrap .meg-btn {
  width: 100%;
  min-height: var(--meg-touch-min);
}
@media (min-width: 480px) {
  .meg-cta-wrap .meg-btn {
    width: auto;
  }
}
.meg-aux {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0;
}

/* Selos (prova social) */
.meg-selos .meg-card__body,
.meg-selos__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}
.meg-selo {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 8px;
  white-space: nowrap;
}

/* Como funciona (steps numerados) */
.meg-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}
.meg-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  font-size: 1rem;
  border-bottom: 1px solid #f1f3f5;
}
.meg-steps li:last-child { border-bottom: none; }
.meg-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #2d70cb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Bloco IA */
.meg-ia .meg-card__body { padding: 1.25rem; }
.meg-ia-text { font-size: 1rem; margin: 0 0 0.75rem; line-height: 1.5; color: #1a1a2e; }
.meg-ia-bullets { list-style: none; padding: 0; margin: 0 0 1rem; }
.meg-ia-bullets li { padding: 0.25rem 0; font-size: 1rem; }
.meg-ia-bullets li::before { content: "✔ "; color: #7ed321; }
.meg-ia-tagline { font-size: 1.0625rem; font-weight: 600; margin: 0 0 0.5rem; color: #003366; }
.meg-ia-micro { font-size: 0.9375rem; color: #6b7280; margin: 0; line-height: 1.45; }

/* FAQ */
.meg-faq .meg-card__body { padding: 1.25rem; }
.meg-faq-list { list-style: none; padding: 0; margin: 0; }
.meg-faq-list li { margin-bottom: 0.5rem; border-bottom: 1px solid #f1f3f5; }
.meg-faq-list li:last-child { border-bottom: none; }
.meg-faq-list details summary { padding: 0.75rem 0; cursor: pointer; font-weight: 600; color: #1a1a2e; }
.meg-faq-list details[open] summary { margin-bottom: 0.5rem; }
.meg-faq-list details p { margin: 0 0 0.75rem; font-size: 0.9375rem; color: #6b7280; line-height: 1.5; }

/* CTA final */
.meg-cta-final { padding: 1.5rem 0; }
.meg-cta-final .meg-btn { width: 100%; }
@media (min-width: 480px) {
  .meg-cta-final .meg-btn { width: auto; }
}

/* LP Nav (header right) */
.lp-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lp-nav-label { font-size: 0.875rem; color: rgba(255,255,255,0.9); }
.lp-coreco-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.lp-coreco-badge:hover { background: rgba(255,255,255,0.25); }
.lp-coreco-badge img { width: 1.25rem; height: 1.25rem; object-fit: contain; }

/* Coreco hero (sidebar LP) */
.meg-coreco-hero__foot { font-size: 0.875rem; margin: 0 0 0.75rem; opacity: 0.95; line-height: 1.4; }
.meg-coreco-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--meg-touch-min);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  background: transparent;
  color: #fff;
  cursor: pointer;
  width: 100%;
  transition: background var(--meg-transition), border-color var(--meg-transition);
}
.meg-coreco-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }

.meg-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35em;
  line-height: 1.25;
  color: #003366;
}

.meg-subtitle {
  font-size: 1rem;
  color: #4a4a5a;
  margin: 0;
  line-height: 1.5;
}

/* ----- Alerts ----- */
.meg-alerts {
  margin-bottom: 0.25rem;
}

.meg-alert {
  margin: 0 0 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.45;
}

.meg-alert:last-child {
  margin-bottom: 0;
}

.meg-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 2px solid #dc2626;
}

.meg-alert--success {
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid #059669;
}

/* ----- Cards ----- */
.meg-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.meg-card {
  background: #fff;
  border-radius: var(--meg-card-radius);
  box-shadow: var(--meg-shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.meg-card__header {
  padding: 1.25rem 1.25rem 0.5rem;
  background: #fafbfc;
  border-bottom: 1px solid #f1f3f5;
}

.meg-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #2d70cb;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.meg-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #1a1a2e;
}

.meg-card__desc {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.meg-card__body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ----- Fields (Android: font-size 16px evita zoom) ----- */
.meg-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meg-label {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
}

.meg-required {
  color: #dc2626;
}

.meg-input,
.meg-select {
  width: 100%;
  max-width: 100%;
  min-height: var(--meg-input-height);
  height: var(--meg-input-height);
  padding: 0 1rem;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #1a1a2e;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.meg-input:focus,
.meg-select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.meg-input::placeholder {
  color: #9ca3af;
}

.meg-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.meg-hint--block {
  margin-bottom: 0.25rem;
}

/* Erro com contraste forte */
.meg-error {
  font-size: 0.9375rem;
  color: #b91c1c;
  margin: 0;
  font-weight: 600;
}

.meg-error[hidden] {
  display: none;
}

/* ----- Checkboxes (toque grande) ----- */
.meg-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meg-checkbox-group--horarios {
  gap: 0.75rem;
}

.meg-checkbox-group--distritos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.meg-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--meg-touch-min);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fafbfc;
}

.meg-checkbox-label:has(.meg-checkbox:checked) {
  border-color: #4a90e2;
  background: #eff6ff;
}

.meg-checkbox-label .meg-checkbox {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  accent-color: #2d70cb;
  cursor: pointer;
}

/* ----- Actions ----- */
.meg-actions {
  margin-top: 0.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid #f1f3f5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meg-actions-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  text-align: center;
}

.meg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--meg-btn-height);
  padding: 1rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.meg-btn--primary {
  background: #7ed321;
  color: #003366;
  box-shadow: var(--meg-shadow-light);
}

.meg-btn--primary:hover {
  background: #8fde34;
}

.meg-btn--primary:active {
  transform: scale(0.98);
}

.meg-btn--ghost {
  background: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}
.meg-btn--ghost:hover { background: #f9fafb; color: #1a1a2e; }

.meg-btn-back {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 0.9375rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: color var(--meg-transition), background var(--meg-transition);
}
.meg-btn-back:hover { color: #003366; background: #f1f3f5; }

/* ----- Sidebar ----- */
.meg-sidebar__card {
  background: linear-gradient(180deg, #003366 0%, #002244 100%);
  color: #fff;
  border-radius: var(--meg-card-radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--meg-shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meg-sidebar__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}

.meg-sidebar__lead {
  font-size: 0.9375rem;
  margin: 0 0 1rem;
  opacity: 0.92;
}

.meg-sidebar__list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.7;
  font-size: 0.9375rem;
}

.meg-sidebar__list li {
  margin-bottom: 0.5rem;
}

.meg-sidebar__list li::marker {
  color: #7ed321;
}

.meg-sidebar__cta {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

/* Sidebar: Segurança e suporte / FAQ (objeções) */
.meg-sidebar-seguranca,
.meg-sidebar-faq {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.meg-sidebar-seguranca .meg-sidebar__list {
  margin-bottom: 0;
}
.meg-sidebar-faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.95;
}
.meg-sidebar-faq-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.meg-sidebar-faq-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.meg-sidebar-faq-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
}

/* Coreco (sidebar MEG) */
.meg-coreco-hero {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.meg-coreco-hero__logo {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
}
.meg-coreco-hero__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}
.meg-coreco-hero__sub {
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
  opacity: 0.92;
  line-height: 1.4;
}
.meg-coreco-hero__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  opacity: 0.95;
}
.meg-coreco-hero__bullets li { margin-bottom: 0.35rem; }
.meg-coreco-hero__destaque {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.95;
}
.meg-coreco-explicativo {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.meg-coreco-explicativo__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}
.meg-coreco-explicativo__text {
  font-size: 0.875rem;
  margin: 0 0 0.5rem;
  opacity: 0.92;
  line-height: 1.45;
}
.meg-coreco-explicativo__exemplo {
  font-size: 0.8125rem;
  margin: 0;
  opacity: 0.9;
}
.meg-coreco-stats {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.875rem;
}
.meg-coreco-stats__saldo,
.meg-coreco-stats__impacto { margin: 0 0 0.35rem; }
.meg-coreco-tooltip-trigger {
  cursor: help;
  margin-left: 0.25rem;
  opacity: 0.85;
}
.meg-coreco-tooltip {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* ----- Media: Tablet (expandir) ----- */
@media (min-width: 480px) {
  .meg-checkbox-group--distritos {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----- Media: Desktop ----- */
@media (min-width: 768px) {
  .meg-main {
    padding: 1.5rem;
  }

  .meg-brand__logo {
    height: 3rem;
    max-width: 140px;
  }

  .meg-title {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .meg-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
  }

  .meg-form-wrap {
    order: 0;
  }

  .meg-sidebar {
    order: 0;
    position: sticky;
    top: 1rem;
  }

  .meg-checkbox-group--distritos {
    grid-template-columns: repeat(3, 1fr);
  }

  .meg-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .meg-card,
  .meg-input,
  .meg-btn,
  .meg-checkbox-label {
    transition: none;
  }
}

/* ----- Screen reader only ----- */
.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
