/* ===== App de Emergência — protótipo =====
   Pensado para idosos: letras grandes, botões enormes, alto contraste */

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

:root {
  --azul: #1f3c88;
  --azul-escuro: #142a63;
  --vermelho: #d62828;
  --vermelho-escuro: #a31f1f;
  --verde: #2a9d4a;
  --verde-escuro: #1f7a38;
  --fundo: #f4f6fb;
  --texto: #1c1c1c;
  --cinza: #5f6672;
}

html { font-size: 19px; }
html.texto-grande { font-size: 23px; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  -webkit-tap-highlight-color: transparent;
}

/* ===== Telas (só uma aparece por vez) ===== */
.tela {
  display: none;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  flex-direction: column;
}
.tela.ativa { display: flex; }

/* ===== Tela de aceite (primeira vez) ===== */
.overlay-aceite {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(20,30,60,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.aceite-caixa {
  background: #fff; border-radius: 20px; padding: 24px 22px;
  max-width: 440px; width: 100%; max-height: 92vh; overflow-y: auto;
}
.aceite-caixa h2 { font-size: 1.4rem; color: var(--azul); margin: 8px 0 12px; }
.aceite-caixa p { font-size: 1.05rem; line-height: 1.5; margin-bottom: 12px; }
.aceite-lista { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.aceite-lista li { font-size: 1rem; line-height: 1.45; background: var(--fundo); border-radius: 12px; padding: 12px 14px; }
.aceite-leia { font-size: .95rem; }
.aceite-leia a { color: var(--azul); font-weight: 700; }
.btn-aceite {
  width: 100%; background: var(--verde); color: #fff; border: none;
  border-radius: 16px; padding: 18px; font-size: 1.2rem; font-weight: 800;
  font-family: inherit; cursor: pointer; box-shadow: 0 5px 0 var(--verde-escuro); margin-top: 6px;
}
.btn-aceite:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--verde-escuro); }

/* ===== Marca (identidade no topo) ===== */
.marca {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--azul);
  letter-spacing: .3px;
  padding: 6px 4px 2px;
}
.marca-coracao { color: var(--verde); font-size: 1.15rem; }

/* ===== Topo da tela principal ===== */
.topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 16px;
}
.topo-info { display: flex; flex-direction: column; }
.ola { font-size: 1rem; color: var(--cinza); }
#nome-usuario { font-size: 1.6rem; color: var(--azul); }
.topo-botoes { display: flex; gap: 10px; }
.btn-topo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--azul);
  background: #fff;
  border: 2px solid #d8dce6;
  border-radius: 14px;
  width: 56px; height: 56px;
  cursor: pointer;
  font-family: inherit;
}
.btn-topo:active { background: #eef1f8; }
.btn-topo.ativo { background: var(--azul); color: #fff; border-color: var(--azul); }
.btn-fonte { display: inline-flex; align-items: center; justify-content: center; gap: 2px; line-height: 1; }
.fonte-peq { font-size: .85rem; }
.fonte-gde { font-size: 1.35rem; }

/* ===== Aviso de check-in pendente ===== */
.aviso-checkin {
  background: #fff3cd;
  border: 2px solid #e8c96a;
  color: #7a5c00;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
}
.aviso-checkin.ok {
  background: #e3f6e9;
  border-color: #9ed8b0;
  color: var(--verde-escuro);
}

/* ===== Botão SOS gigante ===== */
.btn-sos {
  background: radial-gradient(circle at 30% 25%, #e94b4b, var(--vermelho) 60%);
  color: #fff;
  border: none;
  border-radius: 32px;
  width: 100%;
  padding: 44px 0 36px;
  cursor: pointer;
  box-shadow: 0 8px 0 var(--vermelho-escuro), 0 14px 28px rgba(214,40,40,.35);
  margin-bottom: 22px;
  transition: transform .1s;
}
.btn-sos:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--vermelho-escuro); }
.sos-texto {
  display: block;
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1;
}
.sos-sub { display: block; font-size: 1.3rem; margin-top: 10px; font-weight: 600; }

/* ===== Botão Estou bem ===== */
.btn-estoubem {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 22px 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--verde-escuro);
  margin-bottom: 22px;
  text-align: left;
  transition: transform .1s;
}
.btn-estoubem:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--verde-escuro); }
.btn-estoubem .icone { font-size: 2.6rem; }
.estoubem-textos { display: flex; flex-direction: column; }
.estoubem-textos strong { font-size: 1.5rem; }
.estoubem-textos small { font-size: 1rem; opacity: .92; }
.btn-estoubem.feito { background: #bcc4cf; box-shadow: 0 6px 0 #9aa3b0; }

/* ===== Grade: Ligar 192 / Ficha médica ===== */
.grade-acoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 26px;
}
.btn-acao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2px solid #d8dce6;
  border-radius: 24px;
  padding: 22px 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--texto);
  font-family: inherit;
}
.btn-acao:active { background: #eef1f8; }
.btn-acao .icone { font-size: 2.4rem; }
.btn-acao strong { font-size: 1.15rem; }
.btn-acao small { font-size: .9rem; color: var(--cinza); }
.btn-samu strong { color: var(--vermelho); }
.btn-ficha strong { color: var(--azul); }

/* ===== Rodapé da tela principal ===== */
.rodape-principal { margin-top: auto; }
.link-familia {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--azul);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 10px;
}
.rodape-confianca {
  text-align: center;
  font-size: .82rem;
  color: var(--cinza);
  margin-top: 8px;
  line-height: 1.4;
}

/* ===== Telas de confirmação (SOS / check-in) ===== */
.tela-vermelha { background: var(--vermelho); color: #fff; justify-content: center; text-align: center; }
.tela-verde { background: var(--verde); color: #fff; justify-content: center; text-align: center; }

.confirma-titulo { font-size: 2.2rem; line-height: 1.2; margin-bottom: 14px; }
.confirma-sub { font-size: 1.25rem; margin-bottom: 36px; opacity: .95; }
.icone-gigante { font-size: 5rem; margin-bottom: 18px; }

.btn-confirma-sim {
  background: #fff;
  color: var(--vermelho);
  border: none;
  border-radius: 28px;
  width: 100%;
  padding: 34px 10px;
  font-size: 2rem;
  font-weight: 900;
  font-family: inherit;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,.25);
  margin-bottom: 26px;
}
.btn-confirma-sim:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }

.btn-confirma-nao, .btn-voltar-claro {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 20px;
  width: 100%;
  padding: 20px 10px;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.btn-acao-grande {
  display: block;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 22px;
  padding: 22px 10px;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  margin-bottom: 16px;
  box-shadow: 0 5px 0 rgba(0,0,0,.22);
  cursor: pointer;
}
.btn-ligar-192 { color: var(--vermelho); }
.btn-ligar-familia { color: var(--azul); }
.btn-ligar-familia small {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--cinza);
  margin-top: 6px;
}

/* Botão verde de avisar no WhatsApp (ação principal do SOS) */
.btn-whatsapp {
  background: #25d366;
  color: #fff;
  font-size: 1.6rem;
  padding: 28px 10px;
  box-shadow: 0 7px 0 #1aa14c;
}
.btn-whatsapp:active { transform: translateY(5px); box-shadow: 0 2px 0 #1aa14c; }
.status-loc {
  font-size: 1rem;
  font-weight: 600;
  margin: -4px 0 18px;
  opacity: .95;
}
.tela-vermelha .btn-voltar-claro { margin-top: 14px; }

/* ===== Telas claras (ficha, config, família) ===== */
.tela-clara { background: var(--fundo); }
.topo-interno {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}
.topo-interno h2 { font-size: 1.45rem; color: var(--azul); }
.btn-voltar {
  background: #fff;
  border: 2px solid #d8dce6;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--azul);
  cursor: pointer;
}

/* ===== Formulários ===== */
.formulario { display: flex; flex-direction: column; gap: 16px; }
.formulario label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--azul-escuro);
}
.formulario input, .formulario select, .formulario textarea {
  font-family: inherit;
  font-size: 1.15rem;
  padding: 14px;
  border: 2px solid #d8dce6;
  border-radius: 14px;
  background: #fff;
  color: var(--texto);
}
.formulario input:focus, .formulario select:focus, .formulario textarea:focus {
  outline: none;
  border-color: var(--azul);
}
.btn-salvar {
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 20px;
  font-size: 1.3rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--azul-escuro);
  margin-top: 6px;
}
.btn-salvar:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--azul-escuro); }
.nota-config { font-size: .95rem; color: var(--cinza); margin-top: 18px; line-height: 1.5; }
.aviso-local {
  font-size: .9rem;
  font-weight: 600;
  color: #7a5c00;
  background: #fff3cd;
  border: 2px solid #e8c96a;
  border-radius: 12px;
  padding: 10px 14px;
  line-height: 1.4;
  display: none;
}
.aviso-local.mostrar { display: block; }
.btn-testar-voz {
  align-self: flex-start;
  background: #fff;
  color: var(--azul);
  border: 2px solid #d8dce6;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: -6px;
}
.btn-testar-voz:active { background: #eef1f8; }
.config-secao { font-size: 1.1rem; color: var(--azul); margin-top: 10px; }
.opcional { font-weight: 400; color: var(--cinza); font-size: .85rem; }
.aviso-medico {
  font-size: .9rem;
  font-weight: 600;
  color: #7a5c00;
  background: #fff3cd;
  border: 2px solid #e8c96a;
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.45;
  margin-top: 16px;
}
.link-privacidade { text-align: center; margin-top: 16px; }
.link-privacidade a { color: var(--azul); font-weight: 700; font-size: .95rem; }
.versao-app { text-align: center; font-size: .8rem; color: var(--cinza); margin-top: 16px; }

/* ===== Painel da família ===== */
.tag-demo {
  background: #e8ecf7;
  color: var(--azul);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 18px;
}
.cartao-status {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #e3f6e9;
  border: 2px solid #9ed8b0;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}
.cartao-status.alerta { background: #fdecea; border-color: #f0a9a3; }
.status-icone { font-size: 2.2rem; }
.cartao-status strong { display: block; font-size: 1.25rem; }
.cartao-status small { color: var(--cinza); font-size: .95rem; }

.cartao-info {
  background: #fff;
  border: 2px solid #e2e6ef;
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.cartao-info h3 { font-size: 1.05rem; color: var(--azul); margin-bottom: 8px; }
.cartao-info p { font-size: 1rem; line-height: 1.5; }
.cartao-info small { color: var(--cinza); }
.lista-avisos { list-style: none; }
.lista-avisos li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: .98rem;
  border-bottom: 1px solid #eef1f6;
}
.lista-avisos li:last-child { border-bottom: none; }
