/* ═══════════════════════════════════════════════════════════════
   GasFlow — identidade institucional (branco e azul, padrão gov.br)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --blue: #1351B4;
  --blue-dark: #0C326F;
  --blue-darker: #071D41;
  --blue-soft: #E8EEF9;
  --blue-line: #C5D4EE;
  --gold: #FFCD07;
  --green: #168821;
  --red: #C81E1E;

  --bg: #FFFFFF;
  --surface: #F6F8FB;
  --surface-2: #FBFCFE;
  --text: #13233F;
  --text-2: #55617A;
  --border: #E6EBF3;
  --ring: rgba(19, 81, 180, 0.28);
  --shadow: 0 20px 44px -18px rgba(7, 29, 65, 0.16);
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Estrutura: rola quando o conteúdo cresce ─────────────────── */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Cabeçalho: banner institucional ──────────────────────────── */
.topbar {
  flex-shrink: 0;
  background: #fff;
  padding: clamp(8px, 1.6vh, 16px) clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--border);
}

.banner {
  display: block;
  width: 100%;
  max-width: 1160px;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.location-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 6px;
  padding: 7px 13px;
  max-width: 58vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 136, 33, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(22, 136, 33, 0); }
}

.topbar-phone {
  display: none;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}

.topbar-phone strong { color: var(--text); }

@media (min-width: 920px) {
  .topbar-phone { display: block; }
}

/* ── Hero (mobile-first) ──────────────────────────────────────── */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(20px, 4vh, 40px) clamp(16px, 5vw, 48px);
  max-width: 1160px;
  width: 100%;
  margin-inline: auto;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Mobile: coluna única. O pitch (headline) aparece antes do formulário. */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.hero-copy { order: 2; }
.hero-art { order: 1; }

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: 1.04fr 0.96fr;
    align-items: center;
    gap: clamp(40px, 6vw, 88px);
  }

  .hero-copy { order: 1; }
  .hero-art { order: 2; }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 20px);
}

.eyebrow {
  align-self: start;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  padding: 5px 12px;
  border-radius: 6px;
}

h1 {
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--blue-darker);
  text-wrap: balance;
}

.lede {
  font-size: clamp(15px, 3.6vw, 17px);
  color: var(--text-2);
  max-width: 46ch;
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
  font-size: 12.5px;
  color: var(--text-2);
}

.proof-row li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.proof-check { color: var(--green); font-weight: 800; }

.buy-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding-top: clamp(2px, 1vh, 8px);
}

.price-block { display: flex; flex-direction: column; }

.price-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
}

.price {
  font-size: clamp(27px, 4.4vh, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--blue-darker);
  font-variant-numeric: tabular-nums;
}

.price small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
}

.branch-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.branch-note svg { flex-shrink: 0; }
.branch-note strong { color: var(--text); font-weight: 600; }

.hero-art {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.hero-art h1 em {
  font-style: normal;
  color: var(--blue);
}

.hero-image {
  width: 100%;
  max-width: 440px;
  max-height: 300px;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 18px;
}

/* No celular a arte decorativa é escondida para o formulário ficar em foco. */
@media (max-width: 619px) {
  .hero-image { display: none; }
}

/* ── Selos de confiança ───────────────────────────────────────── */
.trust-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-ic {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  font-size: 19px;
  line-height: 1;
}

.trust-list li div {
  display: flex;
  flex-direction: column;
}

.trust-list strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-darker);
  line-height: 1.25;
}

.trust-list li div span {
  font-size: 13px;
  color: var(--text-2);
}

.social-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-2);
}

.social-proof .stars {
  color: #E6A700;
  letter-spacing: 2px;
  font-size: 15px;
  flex-shrink: 0;
}

.social-proof strong { color: var(--text); font-weight: 700; }

/* ── Cartão de consulta do benefício (hero) ───────────────────── */
.benefit-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.4vh, 26px);
}

.benefit-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--blue-darker);
  margin-bottom: 16px;
}

.benefit-title svg { color: var(--blue); flex-shrink: 0; }

.benefit-info {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  font-size: 13.5px;
  color: var(--blue-dark);
  line-height: 1.45;
}

.benefit-info-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

.benefit-info strong { color: var(--blue-darker); }

.benefit-approved {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 4px;
}

.benefit-approved .qualified-badge {
  width: 44px;
  height: 44px;
  margin: 0;
  font-size: 20px;
  flex-shrink: 0;
}

.benefit-approved strong {
  display: block;
  font-size: 17px;
  color: var(--blue-darker);
}

.benefit-approved span {
  font-size: 13px;
  color: var(--text-2);
}

.benefit-fees { margin-top: 16px; margin-bottom: 0; }

.free-tag {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.03em;
}

/* Familiares vinculados */
.benefit-relatives {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.rel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}

.benefit-relatives ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.benefit-relatives li {
  font-size: 14px;
  padding-left: 16px;
  position: relative;
}

.benefit-relatives li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.benefit-note {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.benefit-note span { color: var(--green); font-weight: 800; }

/* Endereço de entrega (CEP autopreenche) */
.addr-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}

.addr-field { display: flex; flex-direction: column; }
.addr-field label { margin-bottom: 6px; }
.addr-field input { width: 100%; }

@media (min-width: 460px) {
  .addr-grid { grid-template-columns: repeat(4, 1fr); }
  .addr-street,
  .addr-district { grid-column: 1 / -1; }
  .addr-number { grid-column: span 1; }
  .addr-complement { grid-column: span 3; }
  .addr-city { grid-column: span 3; }
  .addr-uf { grid-column: span 1; }
}

.addr-uf input { text-transform: uppercase; }

/* ── Ajustes mobile: hero cheio e conteúdo maior ──────────────── */
@media (max-width: 619px) {
  .topbar { padding: 10px 12px; }
  main { padding: 16px 12px 32px; gap: 16px; }
  .hero-grid { gap: 18px; }

  /* Hero ocupa toda a largura disponível */
  .hero-copy, .hero-art, .benefit-card { width: 100%; }
  .benefit-card { padding: 20px 16px; border-radius: 12px; }

  h1 { font-size: clamp(26px, 8.5vw, 34px); }
  .lede { font-size: 15.5px; }
  .benefit-title { font-size: 20px; }
  .benefit-info { font-size: 14px; }

  label { font-size: 12.5px; }
  input[type="text"] { font-size: 17px; padding: 16px; }
  .btn-full { font-size: 16.5px; padding: 17px; }

  .customer-row,
  .benefit-relatives li,
  .benefit-note { font-size: 14.5px; }

  .benefit-approved strong { font-size: 18px; }
}

/* ── Rodapé ───────────────────────────────────────────────────── */
.legal {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 22px;
  padding: 11px clamp(20px, 5vw, 48px);
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
}

/* ── Botões ───────────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.btn:hover:not(:disabled) { background: var(--blue-dark); }
.btn:disabled { opacity: 0.65; cursor: wait; }

.btn-buy {
  font-size: 16px;
  padding: 15px 34px;
  box-shadow: 0 10px 24px -10px rgba(19, 81, 180, 0.6);
}

.btn-buy:hover { transform: translateY(-2px); }
.btn-buy:active { transform: translateY(0); }

.btn-full {
  width: 100%;
  margin-top: 18px;
  font-size: 15.5px;
  padding: 16px;
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(7, 29, 65, 0.55);
  backdrop-filter: blur(5px);
}

.modal[open] {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal[open] { align-items: center; padding: 24px; }
}

.modal-card {
  position: relative;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: 440px;
  max-height: 92dvh;
  overflow-y: auto;
  border-top: 4px solid var(--blue);
  border-radius: 18px 18px 0 0;
  padding: 32px 26px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow);
  animation: rise 0.3s cubic-bezier(0.32, 0.72, 0.35, 1);
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: 4px;
    padding: 40px 36px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
  .status-dot { animation: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover { color: var(--text); }
.modal-close:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.step { display: none; }
.step.is-active { display: block; }

.step-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.modal-card h2 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--blue-darker);
  margin-bottom: 6px;
  text-wrap: balance;
}

.hint {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}

.center { text-align: center; }

/* ── Formulário ───────────────────────────────────────────────── */
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 15px 16px;
  font-family: inherit;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--ring);
}

.field-msg {
  display: none;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13.5px;
}

.field-msg.is-error {
  display: block;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
}

.field-msg.is-info {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-2);
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Etapa: confirmando dados (loading) ───────────────────────── */
.loading-box { padding: 14px 0 6px; }

.loader-ring {
  display: block;
  width: 54px;
  height: 54px;
  margin: 6px auto 20px;
  border: 4px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-steps {
  list-style: none;
  text-align: left;
  max-width: 320px;
  margin: 22px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading-steps li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  color: var(--text-2);
  opacity: 0.5;
  transition: opacity 0.25s, color 0.25s;
}

.loading-steps li.is-active { opacity: 1; color: var(--text); }

.ls-dot {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  position: relative;
  transition: border-color 0.25s, background 0.25s;
}

.loading-steps li.is-active .ls-dot { border-color: var(--blue); }

.loading-steps li.is-done .ls-dot {
  border-color: var(--green);
  background: var(--green);
}

.loading-steps li.is-done .ls-dot::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .loader-ring { animation-duration: 2s; }
}

/* ── Etapa 2: qualificado ─────────────────────────────────────── */
.qualified-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  font-size: 26px;
  font-weight: 800;
}

.customer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 18px;
  margin: 20px 0 6px;
}

.customer-row,
.pay-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.customer-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.customer-row:last-child { border-bottom: none; }
.customer-row dt { color: var(--text-2); }
.customer-row dd { font-weight: 600; text-align: right; }

.product-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 4px;
  border: none;
  padding: 0;
}

.product-option {
  padding: 14px 8px;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.product-option .kg {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.product-option .val {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.product-option[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--ring);
}

.product-option:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* ── Etapa 3: pagamento ───────────────────────────────────────── */
.pay-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.pay-line {
  padding: 4px 0;
  color: var(--text-2);
}

.pay-line dd { color: var(--text); }

.pay-line.total {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1.5px solid var(--border);
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-darker);
  font-variant-numeric: tabular-nums;
}

.pay-line.total dd { color: inherit; }

#mpContainer { min-height: 54px; }

/* ── Toast de retorno do checkout ─────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 4px solid var(--blue);
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: rise 0.3s ease-out;
}

.toast.is-success { border-left-color: var(--green); }
.toast.is-error { border-left-color: var(--red); }
