/* ==========================================================================
   Hanspaul Universal Processing & Double-Click Guard Styles
   High-performance, lightweight styling: zero GPU lag, no heavy filters.
   ========================================================================== */

/* Top Viewport Animated Progress Bar */
.hp-top-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #f59e0b, #10b981);
  background-size: 200% 100%;
  animation: hpProgressGlow 1.8s ease infinite;
  z-index: 1000000;
  pointer-events: none;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.15s ease;
}
.hp-top-progress.active {
  opacity: 1;
  width: 80%;
  transition: width 6s cubic-bezier(0.1, 0.5, 0.1, 1);
}
.hp-top-progress.done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.2s ease 0.1s;
}

@keyframes hpProgressGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Central Processing Modal Window Overlay — only displayed when slow (>350ms) */
.hp-processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 32, 0.7);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.hp-processing-overlay.show {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Card */
.hp-processing-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.35);
  padding: 26px 22px 20px;
  text-align: center;
  overflow: hidden;
  transform: scale(0.96) translateY(6px);
  transition: transform 0.18s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] .hp-processing-card {
  background: #141d2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.65);
}

.hp-processing-overlay.show .hp-processing-card {
  transform: scale(1) translateY(0);
}

/* Top Shimmer Strip */
.hp-processing-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #f59e0b, #10b981, #2563eb);
  background-size: 300% 100%;
  animation: hpCardShimmer 2s linear infinite;
}

@keyframes hpCardShimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

/* Spinner Wrap */
.hp-proc-spinner-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-proc-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: #2563eb;
  border-right-color: #06b6d4;
  animation: hpSpin 0.85s linear infinite;
}

[data-theme="dark"] .hp-proc-spinner {
  border-color: rgba(56, 189, 248, 0.18);
  border-top-color: #38bdf8;
  border-right-color: #60a5fa;
}

@keyframes hpSpin {
  to { transform: rotate(360deg); }
}

.hp-proc-brand {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hp-proc-brand.hrm {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

.hp-proc-brand.inv {
  background: linear-gradient(135deg, #b91c1c, #e3262e);
  font-size: 13.5px;
  letter-spacing: 0.5px;
}

.hp-proc-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
  color: inherit;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.hp-proc-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.4;
}

[data-theme="dark"] .hp-proc-subtitle {
  color: #94a3b8;
}

.hp-proc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .hp-proc-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.hp-proc-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.hp-proc-dismiss {
  margin-top: 12px;
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}
.hp-proc-dismiss:hover {
  color: #0f172a;
}

/* Button & Form Locked States (double-click guard) */
.btn-processing,
button.is-submitting,
.cs-sys.is-submitting {
  pointer-events: none !important;
  opacity: 0.72 !important;
  cursor: wait !important;
}
