@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --vermelho: #e60000;
  --vermelho-escuro: #b80000;
  --vermelho-profundo: #7a0000;
  --vermelho-claro: #fdecec;
  --dourado: #c9a227;
  --dourado-claro: #fbf5de;

  --texto: #1a1a1f;
  --texto-suave: #6b6b76;
  --fundo: #f5f5f7;
  --branco: #ffffff;
  --borda: #e4e4e9;

  --verde: #0e9f6e;
  --verde-claro: #e3f6ef;
  --azul: #2563eb;
  --azul-claro: #e6eefd;
  --amarelo: #b7791f;
  --amarelo-claro: #fdf3dc;

  --emola: #0e9f6e;
  --mpesa: #2563eb;

  --raio: 14px;
  --raio-pequeno: 10px;
  --sombra: 0 1px 2px rgba(20, 20, 30, 0.06), 0 4px 16px rgba(20, 20, 30, 0.06);
  --sombra-forte: 0 8px 30px rgba(20, 20, 30, 0.16);
  --fonte: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--vermelho); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
button { font-family: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(230, 0, 0, 0.35);
  outline-offset: 2px;
}

.icone { flex-shrink: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.container-estreito { max-width: 460px; }
.linha { display: flex; align-items: center; gap: 12px; }
.linha-entre { justify-content: space-between; }
.coluna { display: flex; flex-direction: column; gap: 12px; }
.grelha { display: grid; gap: 14px; }
.grelha-2 { grid-template-columns: repeat(2, 1fr); }
.grelha-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.espaco { margin-top: 16px; }
.espaco-grande { margin-top: 28px; }
.texto-suave { color: var(--texto-suave); }
.texto-pequeno { font-size: 13px; }
.texto-centro { text-align: center; }
.negrito { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  font-size: 15px; font-weight: 600;
  border: 1.5px solid transparent; border-radius: var(--raio-pequeno);
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.carregando { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.btn-primario { background: var(--vermelho); color: #fff; box-shadow: 0 2px 10px rgba(230, 0, 0, 0.28); }
.btn-primario:hover { background: var(--vermelho-escuro); }
.btn-secundario { background: var(--branco); color: var(--texto); border-color: var(--borda); }
.btn-secundario:hover { border-color: #c9c9d1; background: #fafafb; }
.btn-contorno { background: transparent; color: var(--vermelho); border-color: var(--vermelho); }
.btn-contorno:hover { background: var(--vermelho-claro); }
.btn-fantasma { background: transparent; color: var(--texto-suave); }
.btn-fantasma:hover { background: rgba(0, 0, 0, 0.05); }
.btn-sucesso { background: var(--verde); color: #fff; }
.btn-sucesso:hover { background: #0b8760; }
.btn-perigo { background: #fff; color: #c81e1e; border-color: #f3c3c3; }
.btn-perigo:hover { background: #fdecec; }
.btn-whatsapp { background: #128c4a; color: #fff; }
.btn-whatsapp:hover { background: #0e7a40; }
.btn-bloco { width: 100%; }
.btn-pequeno { min-height: 36px; padding: 0 14px; font-size: 13px; }

.btn.carregando::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: girar 0.7s linear infinite;
}

/* ---------- Formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--texto); }
.campo .ajuda { font-size: 12px; color: var(--texto-suave); }
.campo .erro { font-size: 12px; color: #c81e1e; font-weight: 500; }

.entrada, select.entrada, textarea.entrada {
  width: 100%; min-height: 48px; padding: 0 14px;
  font-family: inherit; font-size: 16px; color: var(--texto);
  background: var(--branco); border: 1.5px solid var(--borda);
  border-radius: var(--raio-pequeno); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.entrada { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.45; }
.entrada:focus { border-color: var(--vermelho); box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.1); }
.entrada.invalida { border-color: #c81e1e; }
.entrada::placeholder { color: #a3a3ad; }

/* Campo com prefixo (bandeira + +258) */
.entrada-grupo {
  display: flex; align-items: stretch;
  background: var(--branco); border: 1.5px solid var(--borda);
  border-radius: var(--raio-pequeno); overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entrada-grupo:focus-within { border-color: var(--vermelho); box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.1); }
.entrada-grupo.invalida { border-color: #c81e1e; }
.bandeira { font-size: 20px; line-height: 1; 
  background: #f7f7f9; border-right: 1.5px solid var(--borda);
  font-weight: 600; font-size: 15px; white-space: nowrap; user-select: none;
}
.entrada-prefixo img { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); }
.entrada-grupo .entrada { border: 0; border-radius: 0; box-shadow: none; min-height: 48px; }
.entrada-grupo .entrada:focus { box-shadow: none; }
.entrada-botao {
  display: flex; align-items: center; justify-content: center; width: 48px;
  background: none; border: 0; color: var(--texto-suave); cursor: pointer;
}
.entrada-botao:hover { color: var(--texto); }

/* ---------- Cartões ---------- */
.cartao {
  background: var(--branco); border: 1px solid var(--borda);
  border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px;
}
.cartao-titulo { font-size: 13px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }

/* ---------- Selos de estado ---------- */
.selo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 700;
  border-radius: 999px; white-space: nowrap;
}
.selo-pendente { background: var(--amarelo-claro); color: var(--amarelo); }
.selo-concluido { background: var(--verde-claro); color: #0b7a56; }
.selo-rejeitado { background: #fdecec; color: #b42323; }
.selo-neutro { background: #eeeef2; color: var(--texto-suave); }
.selo-destaque { background: var(--dourado-claro); color: #8a6d0b; }

/* ---------- Janela (modal) ---------- */
.modal-fundo {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 15, 20, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-fundo.aberto { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--branco); border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--sombra-forte);
  transform: translateY(24px); transition: transform 0.2s;
}
.modal-fundo.aberto .modal { transform: none; }
.modal-cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-fechar {
  width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f0f0f3; border: 0; border-radius: 50%; color: var(--texto-suave); cursor: pointer;
}
.modal-fechar:hover { background: #e4e4e9; }

@media (min-width: 640px) {
  .modal-fundo { align-items: center; }
  .modal { border-radius: 20px; padding: 26px; }
}

/* ---------- Mensagens (toasts) ---------- */
.toasts {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: calc(100% - 32px); max-width: 420px; pointer-events: none;
}
.toast {
  padding: 12px 18px; font-size: 14px; font-weight: 500; color: #fff;
  background: #25252d; border-radius: 12px; box-shadow: var(--sombra-forte);
  opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s;
}
.toast.visivel { opacity: 1; transform: none; }
.toast-sucesso { background: #0b7a56; }
.toast-erro { background: #b42323; }

/* ---------- Carregamento ---------- */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #ececf0; border-top-color: var(--vermelho);
  animation: girar 0.8s linear infinite;
}
.carregamento-pagina {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
}
.esqueleto {
  background: linear-gradient(90deg, #ececf0 25%, #f6f6f8 37%, #ececf0 63%);
  background-size: 400% 100%; animation: brilho 1.3s ease infinite;
  border-radius: var(--raio-pequeno);
}

.vazio { text-align: center; padding: 40px 16px; color: var(--texto-suave); }

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brilho { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.bandeira { font-size: 20px; line-height: 1; }

/* ---------- Campo com prefixo (+258) e botão do olho: bloco completo ---------- */
.entrada-grupo {
  display: flex; align-items: stretch;
  background: var(--branco); border: 1.5px solid var(--borda);
  border-radius: var(--raio-pequeno); overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entrada-grupo:focus-within { border-color: var(--vermelho); box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.1); }
.entrada-grupo.invalida { border-color: #c81e1e; }
.entrada-prefixo {
  display: flex; align-items: center; flex-shrink: 0; gap: 8px; padding: 0 12px;
  background: #f7f7f9; border-right: 1.5px solid var(--borda);
  font-weight: 600; font-size: 15px; white-space: nowrap; user-select: none;
}
.bandeira { font-size: 20px; line-height: 1; }
.entrada-grupo .entrada { flex: 1; min-width: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 48px; }
.entrada-grupo .entrada:focus { box-shadow: none; }
.entrada-botao {
  display: flex; align-items: center; justify-content: center; width: 48px; flex-shrink: 0;
  background: none; border: 0; color: var(--texto-suave); cursor: pointer;
}
.entrada-botao:hover { color: var(--texto); }