:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #17243b;
  background: #f2f5fa;
  --marinho: #12223e;
  --azul: #194dc8;
  --azul-escuro: #103da9;
  --azul-claro: #eaf0ff;
  --linha: #dce4ef;
  --texto-secundario: #526179;
  --papel: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
h1, h2, h3, p { margin: 0; }

button {
  min-height: 2.45rem;
  padding: .55rem .85rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.3;
}
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #4779ef; outline-offset: 3px; }

.barra {
  padding: 1rem max(1.25rem, calc((100% - 1180px) / 2));
  color: #fff;
  background: #0e1b31;
  border-bottom: 1px solid #344565;
}
.marca { display: flex; align-items: center; gap: .7rem; font-size: .95rem; font-weight: 720; }
.sinal {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: .55rem;
  background: #dce7ff;
  color: #173c90;
  font-size: 1.05rem;
  font-weight: 800;
}

.pagina { --margem: max(1.25rem, calc((100% - 1180px) / 2)); }
.introducao {
  padding: 2.85rem var(--margem) 4.65rem;
  color: #fff;
  background: radial-gradient(ellipse at 86% 30%, #254e96 0, transparent 56%), var(--marinho);
}
h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 740;
  letter-spacing: -.05em;
  line-height: 1.1;
}
.introducao > p { margin-top: .75rem; color: #d2def2; line-height: 1.55; }
.introducao .estado { font-weight: 650; }
.introducao .tempo { margin-top: .15rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.introducao .erro { color: #ffd2d4; font-weight: 650; }
.estado:empty, .erro:empty { margin: 0; }
.ocupado .estado:not(:empty)::before {
  content: "";
  display: inline-block;
  width: .72em;
  height: .72em;
  margin-right: .55em;
  border: 2px solid #7f9ace;
  border-top-color: #fff;
  border-radius: 50%;
  animation: rodar .8s linear infinite;
}
@keyframes rodar { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .ocupado .estado:not(:empty)::before { animation: none; }
}

.grelha {
  position: relative;
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.3rem;
  margin: -2.35rem var(--margem) 3rem;
}
.painel {
  min-width: 0;
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 1rem;
  box-shadow: 0 10px 24px #17243b0d;
}
.controlos { padding: 1.3rem; }
h2 { font-size: 1.04rem; letter-spacing: -.02em; }
.carregar { border-bottom: 1px solid var(--linha); padding-bottom: 1.2rem; margin-bottom: 1.1rem; }
#form-ficheiro { display: grid; gap: .7rem; margin-top: .85rem; }
.zona-ficheiro {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: .32rem;
  padding: 1.1rem .7rem;
  border: 1px dashed #90abe0;
  border-radius: .8rem;
  background: #f5f8ff;
  text-align: center;
}
.zona-ficheiro:hover:not(:has(:disabled)), .zona-ficheiro:focus-within { background: var(--azul-claro); }
.zona-ficheiro:focus-within { outline: 3px solid #4779ef; outline-offset: 3px; }
#ficheiro { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#ficheiro:disabled { cursor: default; }
.icone-envio {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  margin-bottom: .15rem;
  border: 1px solid #c9d8fa;
  border-radius: .6rem;
  background: #e5eeff;
  color: var(--azul);
  font-size: 1.28rem;
  font-weight: 700;
}
.rotulo-ficheiro { font-size: .9rem; font-weight: 700; color: var(--azul-escuro); }
.detalhe-ficheiro, .orientacao, .nome-ficheiro, #estado-exportacao {
  color: var(--texto-secundario);
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.nome-ficheiro, .orientacao { margin-top: .45rem; }
.cabecalho-seccoes { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.texto-botao { min-height: 2rem; padding: .3rem 0; background: transparent; color: var(--azul-escuro); }
.texto-botao:disabled { color: var(--texto-secundario); }
.texto-botao:hover:not(:disabled) { text-decoration: underline; }
.secundario { background: var(--papel); color: #23395a; border-color: #cfd9e8; }
.secundario:hover:not(:disabled) { background: #f3f6fd; border-color: #a7bcdf; }
.secundario:disabled { background: #f6f8fc; color: #607087; }
.primario { min-height: 2.75rem; background: var(--azul); color: #fff; width: 100%; }
.primario:hover:not(:disabled) { background: var(--azul-escuro); }
.primario:disabled { background: #dae5ff; color: #3a5075; }

.opcao-titulos, .seccao-opcao { display: flex; gap: .6rem; align-items: start; font-size: .875rem; }
.opcao-titulos { margin: .95rem 0; padding: .7rem; background: #f3f6fb; border-radius: .55rem; }
input[type="checkbox"] { accent-color: var(--azul); margin-left: 0; }
#seccoes { max-height: 15rem; overflow: auto; margin: .5rem 0 0; border: 0; padding: 0 .25rem .25rem; min-width: 0; }
.seccao-opcao { padding: .4rem .3rem; border-radius: .4rem; overflow-wrap: anywhere; }
.seccao-opcao:hover { background: #f3f6fb; }

.visualizador { overflow: hidden; }
.cabecalho-documento {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.25rem 1.35rem .85rem;
}
.exportacao { display: grid; justify-items: end; gap: .35rem; }
.botoes-exportacao { display: flex; flex-wrap: wrap; gap: .5rem; }
#estado-exportacao { text-align: right; }
.versoes { display: flex; gap: .25rem; padding: 0 1.35rem; border-bottom: 1px solid var(--linha); }
.versoes button {
  min-height: 2.55rem;
  color: var(--texto-secundario);
  background: transparent;
  border-bottom-width: 3px;
  border-radius: .5rem .5rem 0 0;
}
.versoes button:hover:not(:disabled) { background: #f1f5ff; }
.versoes button[aria-pressed="true"] { border-bottom-color: var(--azul); color: var(--azul-escuro); }
.conteudo {
  min-height: 25rem;
  padding: clamp(1.1rem, 4vw, 2.7rem);
  background: #f4f7fc;
  overflow-wrap: anywhere;
}
.vazio {
  min-height: 19rem;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: .55rem;
  background: radial-gradient(ellipse at center, #e8effb, transparent 65%);
}
.vazio h3 { font-size: 1.18rem; letter-spacing: -.025em; }
.vazio p { color: var(--texto-secundario); font-size: .9rem; }
.folha {
  position: relative;
  width: 3.55rem;
  height: 4.4rem;
  margin-bottom: .95rem;
  border: 1px solid #9db5e6;
  border-radius: .55rem;
  box-shadow: .48rem .38rem 0 -.03rem #d3e2fe, 0 9px 22px #244c9822;
  background: repeating-linear-gradient(to bottom, #6e91db 0 2px, transparent 2px 9px) center 61% / 1.65rem 1.2rem no-repeat, #fff;
}
.folha::before {
  content: "";
  position: absolute;
  top: .7rem;
  left: .85rem;
  width: .65rem;
  height: .45rem;
  border-radius: .12rem;
  background: var(--azul);
}
.seccao-texto {
  max-width: 48rem;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: .65rem;
}
.seccao-texto + .seccao-texto { margin-top: .85rem; }
.seccao-texto .origem { color: var(--azul-escuro); font-size: .78rem; font-weight: 700; margin-bottom: .65rem; }
.seccao-texto .bloco { font-size: 1rem; line-height: 1.7; white-space: pre-wrap; margin: 0 0 .65rem; }
.seccao-texto .bloco:last-child { margin-bottom: 0; }
.seccao-texto .titulo { font-size: 1.22rem; font-weight: 720; }
.seccao-texto .titulo-principal { font-size: 1.65rem; letter-spacing: -.03em; }

@media (max-width: 950px) {
  .cabecalho-documento { flex-wrap: wrap; }
  .exportacao { justify-items: start; }
  #estado-exportacao { text-align: left; }
}
@media (max-width: 730px) {
  .grelha { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .introducao { padding-top: 1.8rem; padding-bottom: 3.6rem; }
  .grelha { margin-top: -1.7rem; }
  .conteudo { min-height: 20rem; }
  .vazio { min-height: 15rem; }
}
