/* ========================================================
   POST-AHA ENHANCE — UI/UX upgrade del momento clave
   Estilos para success banner, action stack, cross-sell card,
   sticky mobile bar y micro-animaciones.
   Diseñado para integrarse sobre los 8 generadores existentes.
   ======================================================== */

/* Banner de éxito (success feedback explícito post-Aha) */
.pa-success {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
  border-radius: 14px;
  margin: 0 0 24px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
  animation: pa-slide-up 360ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pa-success__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pa-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms backwards;
}
.pa-success__icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}
.pa-success__text { flex: 1; min-width: 0; }
.pa-success__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #065f46;
  line-height: 1.25;
}
.pa-success__meta {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: #047857;
  font-weight: 500;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .pa-success { padding: 14px 16px; gap: 12px; }
  .pa-success__icon { width: 38px; height: 38px; }
  .pa-success__title { font-size: 1.02rem; }
  .pa-success__meta { font-size: 0.82rem; }
}

/* Action stack post-Aha — PDF primary + share/regenerate secondary */
.pa-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.5rem;
}
.pa-actions__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pa-btn {
  flex: 1 1 auto;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  background: none;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.pa-btn:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.35);
  outline-offset: 2px;
}
.pa-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
}
.pa-btn--primary {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  flex-basis: 100%;
  padding: 16px 24px;
  font-size: 1.05rem;
}
.pa-btn--primary:hover {
  background: #059669;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.42);
}
.pa-btn--secondary {
  background: #fff;
  color: #065f46;
  border-color: #6ee7b7;
}
.pa-btn--secondary:hover {
  background: #ecfdf5;
  border-color: #10b981;
}
.pa-btn--ghost {
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  border-color: transparent;
}
.pa-btn--ghost:hover {
  color: #065f46;
  background: rgba(16, 185, 129, 0.06);
}

/* Cross-sell del Pack Premium */
.pa-upsell {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  margin-top: 24px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.pa-upsell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f59e0b, #d97706);
}
.pa-upsell__star {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pa-upsell__star svg { width: 24px; height: 24px; stroke-width: 2; }
.pa-upsell__body { flex: 1; min-width: 0; }
.pa-upsell__tag {
  display: inline-block;
  padding: 3px 9px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 6px;
}
.pa-upsell__title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 800;
  color: #78350f;
  line-height: 1.3;
}
.pa-upsell__desc {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.45;
}
.pa-upsell__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #d97706;
  color: #fff;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.pa-upsell__cta:hover {
  background: #b45309;
  transform: translateX(2px);
}
.pa-upsell__cta svg { width: 14px; height: 14px; stroke-width: 2.5; }
@media (max-width: 600px) {
  .pa-upsell { flex-direction: column; align-items: flex-start; padding: 16px 18px; gap: 12px; }
  .pa-upsell__star { width: 40px; height: 40px; }
}

/* Sticky mobile action bar — aparece cuando el botón PDF se sale del viewport */
.pa-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(16, 185, 129, 0.1);
  z-index: 90;
  transform: translateY(150%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pa-sticky.is-visible { transform: translateY(0); }
.pa-sticky__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: background 160ms ease;
}
.pa-sticky__btn svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.pa-sticky__btn--primary { background: #10b981; color: #fff; }
.pa-sticky__btn--primary:hover { background: #059669; }
.pa-sticky__btn--upsell { background: #d97706; color: #fff; }
.pa-sticky__btn--upsell:hover { background: #b45309; }
@media (min-width: 768px) { .pa-sticky { display: none; } }

/* Animaciones */
@keyframes pa-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pa-pop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pa-success,
  .pa-success__icon,
  .pa-sticky,
  .pa-upsell__cta { animation: none !important; transition: none !important; }
}

/* Esconder los botones originales del HTML (los reemplazamos) */
#result .action-buttons[hidden] { display: none !important; }
