/* ============================================
   Certificados Trenzando Feminismos
   certificate-widget.css
   ============================================ */

/* -- BOTÓN PRINCIPAL -- */
.cert-btn-container {
  text-align: center;
  margin: 2rem 0;
}

.cert-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #7B2D8B;          /* morado del certificado */
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
  font-family: inherit;
}

.cert-btn:hover {
  background: #5a1f6b;
  transform: translateY(-2px);
}

.cert-btn:active {
  transform: translateY(0);
}

/* -- OVERLAY (fondo oscuro detrás del popup) -- */
#cert-overlay {
  display: none;               /* oculto por defecto */
  position: fixed;
  inset: 0;                    /* cubre toda la pantalla */
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#cert-overlay.active {
  display: flex;               /* se muestra al abrir popup */
}

/* -- POPUP MODAL -- */
#cert-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- ENCABEZADO DEL MODAL -- */
#cert-modal .modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

#cert-modal .modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #7B2D8B;
  margin-bottom: 0.4rem;
}

#cert-modal .modal-header p {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

/* -- BOTÓN CERRAR (X) -- */
#cert-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0;
}

#cert-close:hover { color: #333; }

/* -- CAMPOS DEL FORMULARIO -- */
.cert-field {
  margin-bottom: 1rem;
}

.cert-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cert-field input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  color: #222;
}

.cert-field input:focus {
  outline: none;
  border-color: #7B2D8B;
}

/* -- MENSAJE DE ERROR -- */
#cert-error {
  display: none;
  background: #fff0f7;
  border-left: 4px solid #E91E8C;
  color: #7a0045;
  font-size: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

#cert-error.visible { display: block; }

/* -- BOTÓN SUBMIT -- */
#cert-submit {
  width: 100%;
  background: #7B2D8B;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

#cert-submit:hover { background: #5a1f6b; }

#cert-submit:disabled {
  background: #b39dbc;
  cursor: not-allowed;
}

/* -- ESTADO DE CARGA -- */
#cert-submit.loading::after {
  content: ' ⏳';
}

/* -- CANVAS (invisible, solo para generar imagen) -- */
#cert-canvas {
  display: none;
}