/* ==========================================================================
   styles.css — certificado.lummo.cc
   Um arquivo só, como no site da mentoria, para evitar várias requisições de
   CSS que bloqueiam a renderização. A arte do certificado usa unidades cqw,
   então escala junto com a largura de quem a contém (página, embed ou PDF).
   ========================================================================== */

/* ============================== tokens ============================== */
:root {
  --cor-fundo: #FAFAF7;
  --cor-superficie: #FFFFFF;
  --cor-texto: #191919;
  --cor-texto-2: #404040;
  --cor-texto-3: #5C5A55;
  --cor-verde: #2D6258;
  --cor-verde-escuro: #1F4740;
  --cor-borda: #DCD7CE;
  --cor-borda-campo: #8F8A80;
  --cor-borda-pilula: #C9C4BA;
  --cor-hover: #F1EEE7;
  --cor-base: #E5D8C3;
  --cor-painel: #F4F0E7;
  --cor-erro: #A4301F;
  --cor-erro-texto: #7E2A1B;
  --cor-erro-fundo: #F1DFD7;

  --fonte-sans: 'Onest', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fonte-serifa: 'STIX Two Text', 'Times New Roman', Times, serif;
  --fonte-mono: 'DM Mono', Menlo, Consolas, monospace;

  --pad-lateral: clamp(16px, 4vw, 48px);
  --pad-base: clamp(24px, 3vw, 36px);
  --sombra-botao: inset 0 1px 0 #ffffff59, inset 0 -2px 0 #0003, 0 1px 2px #0006, 0 8px 24px -6px #2D625899;
  --sombra-menu: 0 14px 30px -14px rgba(40, 30, 20, 0.35);
}

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

body {
  margin: 0;
  background: var(--cor-fundo);
  color: var(--cor-texto);
  font-family: var(--fonte-sans);
  font-size: 16px;
  line-height: 1.6;
}

img { display: block; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cor-verde);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================== componentes ============================== */
.botao {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background-color: var(--cor-verde);
  background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  box-shadow: var(--sombra-botao);
  color: #FFFFFF;
  font: 500 15px/1 var(--fonte-sans);
  white-space: nowrap;
  cursor: pointer;
}
.botao:hover { background-color: var(--cor-verde-escuro); }

.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.logo { display: flex; }
.logo img { height: 20px; width: auto; }

.rodape { border-top: 1px solid var(--cor-borda); }
.rodape__interno {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px var(--pad-lateral);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--fonte-mono);
  font-size: 12px;
  color: var(--cor-texto-3);
}

/* ============================== acesso ============================== */
.acesso {
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Logo e "Voltar" ficam fora do fluxo para que o campo seja o centro exato da tela. */
.acesso__caixa { position: relative; width: 100%; max-width: 480px; }

.acesso__logo {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 36px);
  transform: translateX(-50%);
}
.acesso__logo img { height: 28px; }

.campo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--cor-borda-campo);
  border-radius: 999px;
  background: var(--cor-superficie);
}
.campo:focus-within { outline: 2px solid var(--cor-verde); outline-offset: 2px; }

.campo input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: none;
  color: var(--cor-texto);
  font-family: var(--fonte-sans);
  font-size: 16px;
}
.campo input:focus { outline: none; }
.campo input::placeholder { color: var(--cor-borda-campo); opacity: 1; }

.voltar {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--cor-texto-2);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.voltar:hover { color: var(--cor-texto); }

/* ============================== verificando ============================== */
/* Tela de espera entre o código e o certificado: troca o campo no mesmo lugar e
   fica visível até o navegador pintar a página seguinte. */
.acesso--verificando .campo,
.acesso--verificando .voltar { visibility: hidden; }

.verificando {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--cor-texto-2);
  font-size: 16px;
}
.verificando[hidden] { display: none; }

.verificando__giro {
  width: 20px;
  height: 20px;
  border: 2px solid var(--cor-borda);
  border-top-color: var(--cor-verde);
  border-radius: 50%;
  animation: giro 0.8s linear infinite;
}

@keyframes giro {
  to { transform: rotate(360deg); }
}

/* ============================== erro de código ============================== */
/* O erro é um estado da tela de acesso: borda vermelha até a pessoa digitar de novo. */
.campo--erro { border-color: var(--cor-erro); }
.campo--erro:focus-within { outline: none; }

/* Some sozinho ao fim da animação; parar o mouse em cima pausa a contagem. */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 14px;
  background: var(--cor-erro-fundo);
  box-shadow: var(--sombra-menu);
  color: var(--cor-erro-texto);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transform: translateX(-50%);
  animation: snackbar 6s ease both;
}
.snackbar[hidden] { display: none; }
.snackbar:hover,
.snackbar:focus-within { animation-play-state: paused; }
.snackbar svg { flex: 0 0 auto; }
.snackbar a { color: inherit; }

@keyframes snackbar {
  0%, 100% { opacity: 0; }
  4%, 94% { opacity: 1; }
}

/* ============================== verificação ============================== */
.verificacao { overflow-x: clip; }

.cabecalho {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-lateral);
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}
.cabecalho__link { padding: 12px 0; color: var(--cor-texto-2); font-size: 14px; }

.verificacao main { flex: 1 1 auto; display: flex; flex-direction: column; }

.registro {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) var(--pad-lateral) var(--pad-base);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 56px;
}

.registro__arte {
  position: relative;
  isolation: isolate;
  flex: 7 1 520px;
  min-width: 0;
  align-self: stretch;
}

.registro__moldura {
  margin: 0;
  border: 1px solid var(--cor-borda);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(40, 30, 20, 0.35);
  background: var(--cor-superficie);
}

/* Base orgânica atrás da arte. Sai da coluna pela esquerda e encosta no rodapé;
   a forma muda a partir de 995px, quando as duas colunas viram uma só. */
.base {
  position: absolute;
  z-index: -1;
  left: 0;
  top: -30px;
  width: 100%;
  height: calc(100% + 30px + var(--pad-base));
  overflow: visible;
  pointer-events: none;
}
.base__grao { mix-blend-mode: multiply; opacity: 0.5; }
.base__estreita { display: none; }

@media (max-width: 995px) {
  .base__larga { display: none; }
  .base__estreita { display: inline; }
}

.registro__dados {
  position: relative;
  z-index: 1;
  flex: 5 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline: -10px;
}

.acao {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--cor-texto);
  font: 500 14px/1 var(--fonte-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.acao:hover { background: var(--cor-hover); }

.menu-ancora { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  width: 200px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--cor-borda);
  border-radius: 8px;
  background: var(--cor-superficie);
  box-shadow: var(--sombra-menu);
}
.menu[hidden] { display: none; }
.menu--direita { left: auto; right: 0; }
.menu .acao { display: flex; gap: 10px; border-radius: 6px; }

.incorporar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--cor-borda);
  border-radius: 6px;
  background: var(--cor-superficie);
}
.incorporar[hidden] { display: none; }
.incorporar p { margin: 0; font-size: 14px; color: var(--cor-texto-2); }
.incorporar code {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--cor-borda);
  border-radius: 6px;
  background: var(--cor-fundo);
  font-family: var(--fonte-mono);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  user-select: all;
}

.pilula {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--cor-borda-pilula);
  border-radius: 999px;
  background: none;
  color: var(--cor-texto);
  font: 500 14px/1 var(--fonte-sans);
  cursor: pointer;
}
.pilula:hover { background: var(--cor-hover); }

.ficha {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 14px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--cor-texto);
  border-bottom: 1px solid var(--cor-borda);
}
.ficha dt { font-size: 13px; color: var(--cor-texto-3); }
.ficha dd { margin: 0; font-size: 15px; font-weight: 500; }
.ficha dd.ficha__codigo { font-family: var(--fonte-mono); font-size: 14px; }

.compartilhar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px 4px;
  border-radius: 8px;
  background: var(--cor-painel);
}
.compartilhar h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.compartilhar__icones {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-inline: -13px;
}

.redondo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--cor-texto);
  cursor: pointer;
}
.redondo:hover { background: rgba(25, 25, 25, 0.07); }

/* ============================== arte do certificado ============================== */
.arte {
  container-type: inline-size;
  width: 100%;
  font-family: var(--fonte-sans);
  color: var(--cor-texto);
}

.arte__folha {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1123 / 794;
  background: var(--cor-fundo);
  line-height: 1.5;
  print-color-adjust: exact;
}

.arte__imagem {
  position: absolute;
  left: 65cqw;
  top: 9.5cqw;
  width: 30cqw;
  height: auto;
  filter: drop-shadow(0 1cqw 1.4cqw rgba(40, 30, 20, 0.2));
}

.arte__coluna {
  position: absolute;
  left: 6.4cqw;
  top: 5.9cqw;
  bottom: 5.4cqw;
  width: 57cqw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.arte__logo { height: 2.05cqw; width: auto; align-self: flex-start; }

.arte__titulo { display: flex; flex-direction: column; gap: 1.5cqw; }

.arte__rotulo {
  margin: 0;
  font-family: var(--fonte-mono);
  font-size: 1.1cqw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cor-texto-3);
}

.arte__nome {
  margin: 0;
  font-family: var(--fonte-serifa);
  font-weight: 600;
  font-size: 6.2cqw;
  line-height: 1.03;
  letter-spacing: -0.012em;
}
/* Sem isto, nomes muito longos empurram a assinatura para fora da margem. */
.arte__nome--longo { font-size: 4.6cqw; }

.arte__texto {
  margin: 0.4cqw 0 0;
  max-width: 50cqw;
  font-size: 1.7cqw;
  line-height: 1.5;
  color: var(--cor-texto-2);
}
.arte__texto em {
  font-family: var(--fonte-serifa);
  font-size: 1.15em;
  color: var(--cor-verde);
}

.arte__base { display: flex; flex-direction: column; gap: 7.4cqw; }

.arte__dados {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.8cqw;
}
.arte__dado { display: flex; flex-direction: column; gap: 0.2cqw; }
.arte__dado-rotulo {
  font-family: var(--fonte-mono);
  font-size: 1.1cqw;
  color: var(--cor-texto-3);
}
.arte__dado-valor { font-size: 1.4cqw; font-weight: 500; }

.arte__assinatura { width: 22cqw; display: flex; flex-direction: column; gap: 0.5cqw; }
.arte__traco { position: relative; border-top: 1px solid var(--cor-texto); }
.arte__traco img {
  position: absolute;
  left: -0.4cqw;
  bottom: -1.5cqw;
  width: 18.5cqw;
  height: auto;
  max-width: none;
}
.arte__signatario { font-size: 1.3cqw; font-weight: 500; }
.arte__cargo { font-size: 1.15cqw; color: var(--cor-texto-3); }

.arte__selo {
  position: absolute;
  right: 6.4cqw;
  bottom: 5.4cqw;
  display: flex;
  align-items: flex-end;
  gap: 1.2cqw;
}
.arte__selo-texto {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1cqw;
  text-align: right;
}
.arte__codigo { font-family: var(--fonte-mono); font-size: 1.3cqw; font-weight: 500; }
.arte__endereco { font-size: 1.15cqw; color: var(--cor-texto-3); }
.arte__qr { display: block; width: 6cqw; height: 6cqw; }

/* No embed a arte inteira leva à página de verificação. */
.arte-link { display: block; color: inherit; text-decoration: none; }
