/* ---------------------------------------------------------------
   Gerador de Certificado — estilos
   Cores medidas do layout:
   fundo #0A2332 · card #E6F4FF · título #0B2737 · apoio #565656
   divisor #CFDCE5 · verde #85B245 · check #0095FF
   --------------------------------------------------------------- */

/* Peso 800 local: é o que o canvas usa pra desenhar o nome.
   Fica no próprio domínio pra não depender de rede externa na hora de gerar. */
@font-face {
  font-family: 'Barlow';
  src: url('../fonts/Barlow-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

:root {
  --fundo: #0A2332;
  --card: #E6F4FF;
  --titulo: #0B2737;
  --apoio: #565656;
  --divisor: #CFDCE5;
  --verde: #85B245;
  --verde-hover: #74A03A;
  --borda-input: #DCE6EE;
  --placeholder: #9EA5AA;
}

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

body {
  min-height: 100vh;
  margin: 0;
  padding: 40px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--fundo);
  color: var(--apoio);
  -webkit-font-smoothing: antialiased;
}

.palco {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.logo {
  display: block;
  width: 180px;
  height: auto;
  margin-bottom: 40px;
}

/* ----------------------------- card ----------------------------- */

.card {
  width: 100%;
  max-width: 588px;
  padding: 40px 56px;
  background: var(--card);
  border-radius: 24px;
  text-align: center;
}

.estado {
  transition: opacity .2s ease;
}

.estado.oculto { opacity: 0; }

/* -------------------------- estado 1 ---------------------------- */

.check {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto;
}

.titulo {
  margin: 20px 0 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--titulo);
}

.divisor {
  width: 338px;
  max-width: 100%;
  height: 1px;
  margin: 22px auto;
  border: 0;
  background: var(--divisor);
}

.apoio {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--apoio);
}

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

#nome {
  width: 100%;
  height: 53px;
  padding: 0 24px;
  margin-bottom: 14px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--titulo);
  text-align: left;
  background: #fff;
  border: 1px solid var(--borda-input);
  border-radius: 999px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#nome::placeholder {
  color: var(--placeholder);
  font-weight: 400;
}

#nome:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(133, 178, 69, .2);
}

.botao {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--verde);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}

.botao:hover:not(:disabled) { background: var(--verde-hover); }

.botao:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.aviso {
  margin: 16px 0 0;
  font-size: 14px;
  color: #b3261e;
}

/* -------------------------- estado 2 ---------------------------- */

#certificado {
  display: block;
  width: 100%;
  height: auto;          /* o atributo width/height do canvas continua 1024 */
  margin-bottom: 20px;
  border-radius: 12px;
}

/* --------------------------- mobile ----------------------------- */

@media (max-width: 640px) {
  body { padding: 40px 24px; }

  .card {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .titulo { font-size: 24px; }

  .apoio { font-size: 16px; }
}