/* ══════════════════════════════════════════════════════════════════════════════════════════════
   O CERTIFICADO (Fase 6.5 — 04/11/2026) — o diploma, MOVIDO sem mudança de `curso-input.css` (o mock aprovado,
   design-lab/curso-lab.html), e as páginas públicas do certificado (/certificado/<código> e /validar-certificado).
   Um arquivo só para os três que mostram o certificado: a página do curso (o exemplo), a página do certificado e a
   impressora do servidor (`server/src/lib/impressora.ts`, que faz o PDF e o PNG). Carregado DEPOIS do
   `/css/public.css` (os tokens da home valem aqui). Compilado para `client/public/css/certificado.css` por
   `npm run build:css` — nunca edite o compilado. O acabamento visual é do Antigravity.
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* Mockup do Diploma Oficial */

.cert-mockup-wrapper {
  perspective: 1000px;
}

.cert-diploma-sheet {
  background: #FFFFFF;
  aspect-ratio: 1.414 / 1;
  border-radius: var(--radius-lg);
  padding: 28px 38px 30px 38px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08), 0 10px 24px rgba(35, 143, 232, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotateY(-3deg) rotateX(2deg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.cert-diploma-sheet:hover {
  transform: rotateY(0deg) rotateX(0deg) translateY(-4px);
  box-shadow: 0 32px 75px rgba(35, 143, 232, 0.22), 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Moldura e Cantoneiras de Segurança (Padrão Diplomas Oficiais) */

.diploma-frame {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  left: 14px;
  border: 1px solid rgba(35, 143, 232, 0.25);
  border-radius: 0;
  pointer-events: none;
}

.diploma-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--brand-blue);
  border-style: solid;
  pointer-events: none;
}

.diploma-corner.tl {
  top: 4px;
  left: 4px;
  border-width: 2px 0 0 2px;
}

.diploma-corner.tr {
  top: 4px;
  right: 4px;
  border-width: 2px 2px 0 0;
}

.diploma-corner.bl {
  bottom: 4px;
  left: 4px;
  border-width: 0 0 2px 2px;
}

.diploma-corner.br {
  bottom: 4px;
  right: 4px;
  border-width: 0 2px 2px 0;
}

/* Marca d'água geométrica no fundo */

.diploma-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  color: var(--brand-blue);
  opacity: 0.032;
  pointer-events: none;
  z-index: 1;
}

.diploma-watermark svg {
  width: 100%;
  height: 100%;
}

/* Topo do Certificado: Logo da Escola Maior ao Centro (Estilo LinkedIn) */

.diploma-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.diploma-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.diploma-logo-crop {
  height: 46px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diploma-logo-img {
  width: 146px;
  height: 146px;
  max-width: none;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
  margin-top: -2px;
}

.diploma-school-name {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Corpo Principal do Certificado */

.diploma-body {
  margin: 6px 0 8px 0;
  position: relative;
  z-index: 2;
  text-align: center;
}

.diploma-preamble {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-blue);
  font-weight: 700;
  margin-bottom: 3px;
  display: block;
  text-align: center;
}

.diploma-course-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  color: var(--brand-black);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
  text-align: center;
}

.diploma-student-statement {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
  text-align: center;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.diploma-student-statement strong {
  color: var(--brand-black);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Metadados Impacta: Carga Horária + Período de Início e Término */

.diploma-meta-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-main);
  margin: 0 auto 8px;
}

.diploma-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.diploma-meta-item svg {
  color: var(--brand-blue);
  flex-shrink: 0;
}

.diploma-meta-item strong {
  color: var(--brand-black);
  font-weight: 600;
}

.diploma-meta-divider {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Competências Desenvolvidas (LinkedIn style) */

.diploma-skills-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.diploma-skills-heading {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 2px;
}

.diploma-skills-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.diploma-skill-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 2.5px 8px;
  border-radius: 99px;
  font-weight: 500;
  white-space: nowrap;
}

/* Rodapé do Certificado: Assinatura Centralizada (Estilo LinkedIn) e Selo Roseta */

.diploma-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 2;
  width: 100%;
}

.diploma-signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.diploma-sig-wrapper {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.diploma-signature-svg {
  width: 154px;
  max-width: 100%;
  height: 40px;
  display: block;
}

.diploma-signer-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-black);
  line-height: 1.2;
}

.diploma-signer-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.diploma-cert-id {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.diploma-cert-id strong {
  color: var(--text-main);
  font-weight: 600;
}

@media (max-width: 680px) {
  .diploma-cert-id {
    font-size: 0.54rem;
    max-width: 300px;
    overflow-wrap: break-word;
  }
}

/* A CONFERÊNCIA NO RODAPÉ (17/11/2026 — decisões do operador): o código em grupos de 4 e a linha "Confira em…" à
       esquerda, a assinatura no meio, o QR Code à direita. Acabamento fino (item 51): o tamanho do QR é fixo em 72 px
       na folha (24,3 mm no PDF A4 — aprovado pelo operador em 18/11/2026), com a margem branca de 4 módulos do próprio
       SVG, escuro sobre branco, sem girar nem distorcer. A folha continua numa A4 só. */

.diploma-footer-conferencia {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  -moz-column-gap: 16px;
       column-gap: 16px;
  padding-top: 10px;
}

.diploma-footer-conferencia .diploma-signature-block {
  width: auto;
}

.diploma-verify-text {
  justify-self: start;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.diploma-verify-text .diploma-cert-id {
  margin-top: 0;
  font-size: 0.55rem;
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.diploma-verify-text .diploma-cert-id strong {
  display: block;
  margin-top: 1.5px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-black);
}

.diploma-verify-line {
  font-family: var(--font-body);
  font-size: 0.56rem;
  line-height: 1.35;
  color: var(--text-muted);
  margin-top: 1px;
}

.diploma-qr {
  justify-self: end;
  width: 72px;
  height: 72px;
  line-height: 0;
  border-radius: 6px;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(35, 143, 232, 0.2), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  flex-shrink: 0;
}

.diploma-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media print {
  .diploma-qr {
    box-shadow: 0 0 0 1px rgba(35, 143, 232, 0.22);
  }
}

/* Na página do curso (2 colunas, acima de 1100 px), a folha é mais estreita que os 880 px da página do certificado:
       dá um pouco mais de largura à coluna do código e da linha "Confira em…" sem apertar a assinatura nem o QR de 72 px. */

@media (min-width: 1101px) {
  .cert-section .cert-diploma-sheet {
    padding: 24px 30px 26px 30px;
  }

  .cert-section .diploma-footer-conferencia {
    grid-template-columns: minmax(0, 1.35fr) auto minmax(72px, 0.65fr);
    -moz-column-gap: 14px;
         column-gap: 14px;
  }
}

@media (max-width: 680px) {
  .diploma-footer-conferencia {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    row-gap: 12px;
    padding-top: 12px;
  }

  .diploma-footer-conferencia .diploma-signature-block {
    order: 1;
  }

  .diploma-qr {
    order: 2;
    justify-self: center;
  }

  .diploma-verify-text {
    order: 3;
    justify-self: center;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .cert-diploma-sheet {
    padding: 22px 18px;
    transform: none;
    aspect-ratio: auto;
  }

  .diploma-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .diploma-meta-divider {
    display: none;
  }

  .diploma-auth-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .diploma-student-name {
    font-size: 1.25rem;
  }
}

/* ─── As páginas públicas do certificado (04/11/2026 — acabamento Antigravity) ─── */

.certificado-pagina {
  padding: 40px 0 80px;
}

.certificado-pagina .section-header {
  margin-bottom: 36px;
  text-align: center;
}

.certificado-pagina .section-header .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.certificado-pagina .section-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--brand-black);
  margin: 8px 0 12px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-align: center;
}

.certificado-pagina .section-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.certificado-pagina .cert-mockup-wrapper {
  max-width: 880px;
  margin: 0 auto;
}

.certificado-acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

.certificado-aviso {
  max-width: 680px;
  margin: 0 auto 28px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: rgba(35, 143, 232, 0.06);
  border: 1px solid rgba(35, 143, 232, 0.18);
  color: var(--text-main);
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.5;
}

.validar-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 580px;
  margin: 0 auto;
  align-items: flex-end;
}

.validar-form label {
  flex-basis: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.validar-form input {
  flex: 1 1 280px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--brand-black);
  background: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.validar-form input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(35, 143, 232, 0.15);
}

.validar-form .btn {
  min-height: 48px;
  border-radius: 99px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.95rem;
}

.validar-resultado {
  max-width: 580px;
  margin: 36px auto 0;
  padding: 32px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  text-align: left;
}

.validar-resultado .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 99px;
}

.validar-resultado dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 20px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.validar-resultado dt {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  align-self: baseline;
}

.validar-resultado dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-black);
  align-self: baseline;
}

.validar-resultado .certificado-acoes {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  justify-content: center;
}

.validar-resultado[role="alert"] {
  background: #FFFDFD;
  border-color: rgba(229, 72, 77, 0.25);
  box-shadow: 0 8px 24px rgba(229, 72, 77, 0.06);
  text-align: center;
  padding: 24px 32px;
}

.validar-resultado[role="alert"] p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #B91C1C;
  font-weight: 500;
}
