/* Continuous page, action and result feedback in the established green/ink palette. */
:root { --pcba-loading-ease: cubic-bezier(.22,1,.36,1); }
main.pcba-page-arrive { animation: pcba-page-arrive 500ms var(--pcba-loading-ease) both; }
main { transition: opacity 300ms ease; }
body.pcba-page-pending main { opacity: .9; transition: opacity 300ms ease; }
@keyframes pcba-page-arrive {
  from { opacity: .86; transform: translate3d(0,12px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

.pcba-page-feedback[hidden] { display: none !important; }
.pcba-page-feedback {
  position: fixed; inset: 0; z-index: 9500; pointer-events: none;
  opacity: 0; transition: opacity 400ms var(--pcba-loading-ease);
}
.pcba-page-feedback.is-visible { opacity: 1; }
.pcba-page-feedback.is-leaving { opacity: 0; }
.pcba-page-feedback-track {
  position: absolute; inset: 0 0 auto; height: 3px; overflow: hidden;
  background: rgba(11,111,105,.1);
}
.pcba-page-feedback-track::after {
  content: ""; display: block; width: 34%; height: 100%;
  border-radius: 2px; background: #0b6f69;
  animation: pcba-page-sweep 1100ms var(--pcba-loading-ease) infinite;
}
@keyframes pcba-page-sweep {
  from { transform: translate3d(-110%,0,0); }
  to { transform: translate3d(400%,0,0); }
}
.pcba-page-feedback-toast, .pcba-ao-waiting {
  position: fixed; top: 76px; left: 50%; width: max-content;
  max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 12px 18px; border: 1px solid rgba(11,111,105,.18);
  border-radius: 16px; background: rgba(250,248,241,.96);
  box-shadow: 0 8px 32px rgba(24,39,34,.12);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transform: translate3d(-50%,-8px,0);
  transition: transform 400ms var(--pcba-loading-ease), opacity 300ms ease;
  pointer-events: none;
}
.pcba-page-feedback.is-visible .pcba-page-feedback-toast {
  transform: translate3d(-50%,0,0);
  animation: pcba-toast-arrive 400ms var(--pcba-loading-ease) both;
}
@keyframes pcba-toast-arrive {
  from { opacity: .3; transform: translate3d(-50%,-8px,0); }
  to { opacity: 1; transform: translate3d(-50%,0,0); }
}
.pcba-page-feedback-toast .pp-feedback-status, .pcba-ao-waiting .pp-feedback-status {
  font-size: 14px; line-height: 1.55; font-weight: 500; color: #252927;
  gap: 12px; max-width: 100%;
}
.pcba-ao-waiting {
  z-index: 9400; min-height: 48px; margin: 0; opacity: 0; visibility: hidden;
  transition: transform 400ms var(--pcba-loading-ease), opacity 300ms ease, visibility 0s linear 300ms;
}
body.pcba-ao-busy .pcba-ao-waiting {
  visibility: visible; opacity: 1; transform: translate3d(-50%,0,0);
  transition-delay: 0s;
}
body.pcba-page-pending .pcba-ao-waiting { visibility: hidden; opacity: 0; }
.pcba-page-feedback-toast .pp-feedback-spinner, .pcba-ao-waiting .pp-feedback-spinner {
  border-width: 2.5px !important; --pp-accent: #0b6f69;
}

/* The application's disabled/busy state still controls interaction. */
main button[type="submit"], #ao-review, main .btn-primary {
  transition: transform 160ms ease, box-shadow 300ms var(--pcba-loading-ease), background-color 300ms ease;
}
main button[type="submit"]:active, #ao-review:active, main .btn-primary:active { transform: translateY(1px); }
.pp-feedback-button[aria-busy="true"], .pcba-rfq-loading, body.pcba-ao-busy #ao-review {
  opacity: 1 !important; cursor: wait;
  box-shadow: 0 0 0 3px rgba(11,111,105,.15), 0 4px 14px rgba(11,111,105,.1);
}
.pcba-async-spinner { animation: pcba-adapter-spin 900ms linear infinite !important; }
.pcba-async-feedback .pcba-async-spinner { width: 20px !important; height: 20px !important; flex-basis: 20px !important; }
.pp-feedback-button-content .pp-feedback-spinner {
  width: 16px !important; height: 16px !important; flex-basis: 16px !important; border-width: 1.8px !important;
}
/* Reserve enough room before the action so both the busy and completion text remain legible. */
#search #submit { min-width: 176px !important; }
body.pcba-ao-busy #ao-review::after {
  opacity: 1; border-top-color: currentColor; border-right-color: currentColor;
  animation: pcba-adapter-spin 900ms linear infinite;
}
.pcba-ao-complete {
  position: static; display: inline-flex; align-items: center;
  width: auto; height: auto; max-width: 100%; min-height: 28px;
  margin-top: 10px; padding: 4px 10px; box-sizing: border-box;
  border-radius: 20px; border: 1px solid rgba(11,111,105,.15);
  background: rgba(11,111,105,.07); color: #0b6f69;
  font-size: 12px; font-weight: 600; line-height: 18px;
  text-align: start; transition: opacity 400ms var(--pcba-loading-ease);
}
#ao-output.pcba-ao-completed #ao-result { animation: pcba-result-arrive 500ms var(--pcba-loading-ease) both; }
@keyframes pcba-result-arrive {
  from { opacity: .82; transform: translate3d(0,8px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

@media (max-width: 480px) {
  .pcba-page-feedback-toast, .pcba-ao-waiting { top: 68px; padding: 12px 14px; border-radius: 14px; }
  .pcba-page-feedback-toast .pp-feedback-status, .pcba-ao-waiting .pp-feedback-status { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  main.pcba-page-arrive, #ao-output.pcba-ao-completed #ao-result,
  .pcba-page-feedback.is-visible .pcba-page-feedback-toast,
  .pcba-page-feedback-track::after, .pcba-async-spinner,
  body.pcba-ao-busy #ao-review::after { animation: none !important; }
  .pcba-page-feedback, .pcba-page-feedback-toast, .pcba-ao-waiting, .pcba-ao-complete,
  main, main button[type="submit"], #ao-review, main .btn-primary, body.pcba-page-pending main { transition: none !important; }
  main button[type="submit"]:active, #ao-review:active, main .btn-primary:active { transform: none; }
}
@media print {
  .pcba-page-feedback, .pcba-ao-waiting { display: none !important; }
  main.pcba-page-arrive, #ao-output.pcba-ao-completed #ao-result { animation: none !important; }
}
