body {
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
  padding: 20px;
}
.container {
  max-width: 1000px;
  margin: 0 auto;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
h1 {
  text-align: center;
  margin-bottom: 12px;
  color: #23282c;
  margin-top: 40px;
}
h2,
h3,
h4 {
  color: #23282c;
}
.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
input[type="email"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 300px !important;
}
button,
.btn {
  background: #007bff;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.messages {
  margin-bottom: 12px;
}
.msg {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.error {
  background: #fdecea;
  border-left: 4px solid #e74c3c;
}
.preview-wrap {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
} /* Adicionado margin-bottom */
.preview {
  flex: 1;
  min-width: 320px;
  max-width: 640px;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
}
.preview .cert-bg {
  width: 100%;
  height: auto;
  display: block;
}
.preview .overlay-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 90%;
  pointer-events: none;
  font-family: "DejaVu Sans", Arial, sans-serif;
  font-weight: 700;
  color: #111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

#logo_pfox {
  width: 200px;
  display: block;
  margin: 0 auto 20px auto;
}
.form-row {
  width: 500px;
  margin: 0 auto;
  margin-top: 40px;
}

#btn-procurar {
  background: #fd911a;
  font-weight: bold;
}

/*logos absolutes*/
.logo2 {
  position: absolute;
  top: 0px;
  right: 0px;
  z-index: 1000;
}

@media (max-width: 768px) {
  .container {
    background: #ffffff !important; /* força fundo branco */
  }
  .form-row {
    display: flex; /* usa flexbox para controlar alinhamento */
    flex-direction: column; /* empilha os filhos verticalmente */
    align-items: center; /* centra os itens horizontalmente */
    gap: 8px; /* espaço entre input e botão */
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px; /* margem interna para evitar colar nas bordas */
  }

  /* input centralizado e responsivo */
  .form-row input[type="email"] {
    width: 90% !important; /* ocupa 100% do container (.form-row) */
    max-width: 420px; /* limite opcional para telas maiores */
    display: block; /* garante comportamento block-level para margin funcionar */
    margin: 0 auto; /* centraliza caso o max-width atue */
    box-sizing: border-box;
  }

  /* opção A: botão com mesmo tamanho do input (estética de "full width") */
  .form-row button#btn-procurar {
    width: 60% !important;
    max-width: 420px;
    display: inline-block;
    margin: 0 auto;
    padding: 10px 14px;
    box-sizing: border-box;
    cursor: pointer;
    margin-top: 10px !important; /* espaço extra acima do botão */
  }

  .logo2 {
    display: none !important; /* esconde logo superior direita */
  }
  .preview .overlay-name {
    font-size: 8px !important; /* reduz fonte do nome */
  }
  .preview .overlay-date {
    font-size: 8px !important; /* reduz fonte da data */
  }

  .preview {
    max-width: 100% !important;
    width: 100% !important;
    padding: 8px !important;
    box-sizing: border-box;
  }

  .preview-wrap {
    gap: 12px;
  } /* menos gap em mobile */
  .preview .cert-bg {
    width: 100%;
    height: auto;
    display: block;
    max-height: none;
  }

  /* overlays: permitir quebra de linha e limitar largura para caber na tela */
  .preview .overlay-name,
  .preview .overlay-date {
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 88% !important; /* respeita as margens */
    padding: 0 6% !important;
    box-sizing: border-box;
    white-space: normal !important; /* permite quebra */
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
  }

  /* diminuir o nome apenas na PREVIEW (ajuste global de preview) */
  .preview .overlay-name {
    font-size: 8px !important; /* menor que em desktop — ajuste se quiser mais/menos */
    line-height: 1.05;
  }
  .preview .overlay-date {
    font-size: 8px !important;
    line-height: 1;
  }

  .preview.f14 .overlay-name {
    top: calc(40% - 10px) !important; /* = calc(45% - 50px + 40px) */
    font-size: 8px !important; /* um pouco menor só para F14 na preview */
  }
  .preview.f14 .overlay-date {
    top: calc(
      47% + 15px
    ) !important; /* = calc(45% - 50px + 95px - 30px) => calc(45% + 15px) */
    font-size: 8px !important;
  }

  /* Pequeno ajuste para evitar que a logo absoluta sobreponha conteúdo em telas muito pequenas */
  .logo2 {
    max-width: 120px;
  }
  .logo2 img {
    width: 100%;
    height: auto;
    display: block;
  }
}
