/* Print rules + HTMX loading states (complement Tailwind). */

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  main { margin: 0 !important; padding: 0 !important; }
}

/* HTMX indicator (top progress bar) */
.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator { opacity: 1; }

#kp-progress { transform: scaleX(0); transform-origin: left; }
#kp-progress.htmx-request,
.htmx-request #kp-progress { animation: kp-bar 1.4s ease-out forwards; }
@keyframes kp-bar {
  0%   { transform: scaleX(.08); }
  60%  { transform: scaleX(.6); }
  100% { transform: scaleX(.92); }
}

/* Loading buttons: any submit button inside an in-flight HTMX form/boosted form
   shows a spinner and disables, automatically — no per-button markup. */
form.htmx-request button[type="submit"] {
  opacity: .75; pointer-events: none; position: relative;
}
form.htmx-request button[type="submit"]::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px;
  vertical-align: -2px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: kp-spin .6s linear infinite;
}
@keyframes kp-spin { to { transform: rotate(360deg); } }

/* Active sidebar link */
.kp-active { background: #065f46 !important; color: #fff !important; box-shadow: inset 4px 0 0 #34d399; }

/* Modal animations (consent + void + any #kp-modal content) */
.kp-overlay { animation: kp-fade .15s ease-out; }
.kp-pop { animation: kp-pop .16s cubic-bezier(.2,.8,.3,1); }
@keyframes kp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kp-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
