:root {
  --navy: #1A3761;
  --blue: #0B62BE;
  --blue-deep: #063970;
  --blue-light: #8EB7D8;
  --green: #A9C64F;
  --orange: #F8AB28;
  --light: #F0F0F0;
  --grey: #5C5C5C;
  --dark: #343A40;
  --white: #FFFFFF;
  --radius: 10px;
  --st-recebida: #c4c4c4;
  --st-analise: #fdab3d;
  --st-concluida: #00c875;
  --st-descartada: #df2f4a;
  --font: "Montserrat", "Segoe UI", Arial, sans-serif;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/montserrat-400.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
}

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

body {
  font-family: var(--font);
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Header ---------- */
.topbar {
  background: var(--white);
  border-bottom: 3px solid var(--navy);
  padding: 14px 20px;
}
.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar img { height: 52px; width: auto; display: block; }
.topbar nav { display: flex; gap: 8px; }
.topbar nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.topbar nav a:hover { background: var(--light); }
.topbar nav a.active { background: var(--navy); color: var(--white); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--blue-deep), var(--blue));
  color: var(--white);
  padding: 40px 20px 88px;
  text-align: center;
}
.hero h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: 0.3px; }
.hero p { margin-top: 8px; font-size: 0.98rem; opacity: 0.92; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero .selo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Card ---------- */
main { flex: 1; padding: 0 16px 48px; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(26, 55, 97, 0.12);
  max-width: 760px;
  margin: -56px auto 0;
  padding: 34px 36px 38px;
}
@media (max-width: 600px) { .card { padding: 24px 18px 28px; } }

.card h2 { color: var(--navy); font-size: 1.2rem; margin-bottom: 4px; }
.card .sub { color: var(--grey); font-size: 0.9rem; margin-bottom: 24px; }

/* ---------- Form ---------- */
.grupo { margin-bottom: 22px; }
label.rotulo {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  margin-bottom: 7px;
}
label.rotulo .opcional {
  font-weight: 400;
  color: var(--grey);
  font-size: 0.8rem;
}
input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid #d4d9e0;
  border-radius: var(--radius);
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 98, 190, 0.14);
}
textarea { min-height: 130px; resize: vertical; }

.explicacao {
  display: none;
  margin-top: 9px;
  background: #eef4fb;
  border-left: 4px solid var(--blue-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--navy);
}
.explicacao.visivel { display: block; }

/* radios de identificação */
.radios { display: flex; gap: 12px; flex-wrap: wrap; }
.radios label {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid #d4d9e0;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}
.radios label:has(input:checked) {
  border-color: var(--blue);
  background: #eef4fb;
  font-weight: 600;
  color: var(--navy);
}
.radios input { accent-color: var(--blue); width: 17px; height: 17px; }

#campos-identificacao { display: none; margin-top: 14px; gap: 14px; flex-wrap: wrap; }
#campos-identificacao.visivel { display: flex; }
#campos-identificacao > div { flex: 1 1 240px; }

/* anexos */
.drop {
  border: 2px dashed #c3cbd6;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--grey);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.arrastando { border-color: var(--blue); background: #eef4fb; }
.drop strong { color: var(--blue); }
#lista-anexos { list-style: none; margin-top: 10px; }
#lista-anexos li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--light);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 6px;
}
#lista-anexos button {
  background: none;
  border: none;
  color: var(--st-descartada);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* aviso de privacidade */
.aviso-privacidade {
  display: flex;
  gap: 10px;
  background: #f4f8ec;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 0.84rem;
  color: #3d4a1e;
  margin-bottom: 24px;
}

/* botões */
.btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  padding: 14px 26px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primario { background: var(--navy); color: var(--white); width: 100%; }
.btn-primario:hover { filter: brightness(1.18); }
.btn-primario:disabled { background: #9aa7b8; cursor: wait; }
.btn-secundario { background: var(--white); color: var(--navy); border: 1.5px solid var(--navy); }
.btn-secundario:hover { background: var(--light); }

.erro-form {
  display: none;
  background: #fdecee;
  border: 1px solid var(--st-descartada);
  color: #8a1f30;
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.erro-form.visivel { display: block; }

/* ---------- Tela de protocolo ---------- */
#tela-sucesso { display: none; text-align: center; padding: 12px 0; }
#tela-sucesso.visivel { display: block; }
.check-ok {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--st-concluida);
  color: var(--white);
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
#tela-sucesso h2 { color: var(--navy); margin-bottom: 6px; }
.protocolo-box {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 18px 10px;
  margin: 20px auto 10px;
  max-width: 420px;
  user-select: all;
}
.aviso-guardar {
  background: #fdf3e0;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 0.86rem;
  color: #7a5410;
  max-width: 480px;
  margin: 14px auto 22px;
  text-align: left;
}
.acoes-sucesso { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.acoes-sucesso a { text-decoration: none; }

/* ---------- Página de acompanhamento ---------- */
.busca-protocolo { display: flex; gap: 10px; flex-wrap: wrap; }
.busca-protocolo input {
  flex: 1 1 240px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.busca-protocolo .btn { flex: 0 0 auto; }

#resultado { display: none; margin-top: 28px; }
#resultado.visivel { display: block; }
.status-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e3e7ec;
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.status-cabecalho .prot { font-weight: 700; color: var(--navy); font-size: 1.05rem; letter-spacing: 1px; }
.badge {
  display: inline-block;
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 7px 18px;
}

.linha-tempo { list-style: none; }
.linha-tempo li {
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}
.linha-tempo li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: #dfe4ea;
}
.linha-tempo li:last-child::before { display: none; }
.ponto {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfe4ea;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 1;
}
.linha-tempo .feito .ponto { background: var(--st-concluida); }
.linha-tempo .atual .ponto { background: var(--orange); }
.linha-tempo .titulo-etapa { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.linha-tempo .desc-etapa { font-size: 0.84rem; color: var(--grey); }

.nao-encontrado, .erro-consulta {
  display: none;
  margin-top: 24px;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.9rem;
}
.nao-encontrado { background: #fdf3e0; border: 1px solid var(--orange); color: #7a5410; }
.erro-consulta { background: #fdecee; border: 1px solid var(--st-descartada); color: #8a1f30; }
.nao-encontrado.visivel, .erro-consulta.visivel { display: block; }

.datas-meta { margin-top: 18px; font-size: 0.84rem; color: var(--grey); }

/* ---------- Footer ---------- */
footer {
  background: var(--navy);
  color: var(--blue-light);
  text-align: center;
  font-size: 0.8rem;
  padding: 18px 16px;
}
footer strong { color: var(--white); }
