:root {
  --navy: #1D2553;
  --navy-2: #262f6b;
  --accent: #5F66D8;
  --bg: #F6F7FB;
  --papel: #FFFFFF;
  --tinta: #151827;
  --mudo: #5B6172;
  --borda: #E3E5EF;
  --suave: #EDEEFC;
  --ok: #17804F;
  --ok-bg: #E3F4EC;
  --erro: #B42335;
  --erro-bg: #FBE4E7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--tinta);
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.topo {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 18px 16px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
}
.topo img { height: 28px; }

.envolucro {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 14px 100px;
}

.cartao {
  background: var(--papel);
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 22px 18px;
  box-shadow: 0 1px 3px rgba(29, 37, 83, 0.06);
}

@media (min-width: 480px) {
  .envolucro { padding: 28px 16px 60px; }
  .cartao { padding: 26px 22px; }
}

.cartao + .cartao { margin-top: 16px; }

h1 {
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--navy);
  line-height: 1.25;
}
.subtitulo {
  color: var(--mudo);
  font-size: 14.5px;
  margin: 0 0 22px;
}

label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tinta);
  margin-bottom: 6px;
}
label .opcional {
  font-weight: 400;
  color: var(--mudo);
  font-size: 12.5px;
}

.campo { margin-bottom: 18px; }

input[type=text], input[type=tel], input[type=password], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--tinta);
  background: #fff;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 96px; }

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%235B6172' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.grade-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) {
  .grade-2 { grid-template-columns: 1fr; }
}

.zonas { display: flex; gap: 10px; }
.zonas input { position: absolute; opacity: 0; pointer-events: none; }
.zonas label.opcao {
  flex: 1;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-weight: 600;
  color: var(--mudo);
  cursor: pointer;
  transition: all .15s;
}
.zonas input:checked + label.opcao {
  border-color: var(--accent);
  background: var(--suave);
  color: var(--navy);
}

.botao {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.botao:hover { background: var(--navy-2); }
.botao:disabled { opacity: .6; cursor: default; }

/* Botão de enviar fixo no rodapé da tela em celular: sempre à mão, sem precisar
   rolar até o fim de um formulário longo numa conexão instável. */
.barra-enviar { margin-top: 22px; }
@media (max-width: 480px) {
  .barra-enviar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(0deg, var(--papel) 70%, rgba(255,255,255,0));
    box-shadow: 0 -6px 16px rgba(29, 37, 83, 0.10);
    z-index: 20;
  }
}

.link-secundario {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--mudo);
  font-size: 13.5px;
  text-decoration: none;
}
.link-secundario:hover { color: var(--accent); }

.alerta {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alerta.erro { background: var(--erro-bg); color: var(--erro); }
.alerta.ok { background: var(--ok-bg); color: var(--ok); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- tela de sucesso --- */
.sucesso { text-align: center; padding: 12px 4px 4px; }
.sucesso .selo {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 50%; background: var(--ok-bg);
  display: flex; align-items: center; justify-content: center;
}
.sucesso .selo svg { width: 30px; height: 30px; }
.sucesso h1 { text-align: center; }
.sucesso p { color: var(--mudo); font-size: 14.5px; max-width: 46ch; margin: 8px auto 22px; }
.resumo {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.resumo div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--borda); }
.resumo div:last-child { border-bottom: none; }
.resumo span:first-child { color: var(--mudo); }
.resumo span:last-child { font-weight: 600; text-align: right; }

/* --- rodapé --- */
.rodape {
  text-align: center;
  color: #9AA0B5;
  font-size: 12px;
  margin-top: 26px;
}

/* --- login: réplica pixel a pixel da tela de auth do SysCalmed/Plataforma 2.0 ---
   (mesmo fundo, mesmo cartão, mesmo logo 200px, mesmas classes bootstrap: card
   rounded-4 + card-body p-5 pt-4 pb-4, .auth-logo, .btn-primary, .form-control) */
body.pagina-login {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(95, 102, 216, 0.45), transparent 32%),
    linear-gradient(135deg, #1D2553 0%, #020204 100%);
}

.auth-basic-wrapper {
  min-height: 100vh;
  padding: 48px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(2, 2, 4, 0.24);
  border-radius: 1rem;
}

.auth-card-body {
  background: linear-gradient(180deg, #ffffff 0%, #FAFAFC 100%);
  border-radius: 1rem;
  padding: 24px 48px;
}

.auth-logo { display: block; width: 210px; max-width: 100%; height: auto; margin: 0 auto 1.5rem; }

.auth-card-body h4 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #020204;
  text-align: center;
}
.auth-card-body p { margin: 0; color: #020204; text-align: center; }

.auth-alerta {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--erro-bg);
  color: var(--erro);
  font-size: 14px;
}

.form-body { margin: 3rem 0; }
.auth-campo { margin-bottom: 1rem; }
.auth-campo .form-label { margin-bottom: 0.5rem; font-weight: 400; color: #020204; }

.auth-card-body .form-control {
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #020204;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card-body .form-control:focus {
  outline: none;
  border-color: rgba(95, 102, 216, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(95, 102, 216, 0.16);
}

.auth-senha-grupo { display: flex; }
.auth-senha-grupo .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.auth-olho {
  display: flex; align-items: center; justify-content: center;
  width: 46px;
  border: 1px solid #dee2e6;
  border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
}
.auth-senha-grupo:focus-within .form-control,
.auth-senha-grupo:focus-within .auth-olho { border-color: rgba(95, 102, 216, 0.55); }

.auth-botao-linha { display: grid; }
.auth-card-body .btn-primary {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  background: #1D2553;
  border: 1px solid #1D2553;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color .15s;
}
.auth-card-body .btn-primary:hover { background: #141B3E; border-color: #141B3E; }
