/*
 * Order form UI (mirror pages only).
 *
 * Mirror pages are streamed as raw HTML and never run wp_head()/wp_footer(), so nothing enqueued
 * with wp_enqueue_style() reaches them — the theme's own style.css included. This file is injected
 * straight into the mirrored markup next to the order scripts (see
 * neworder_mirror_append_order_submit_script), which is the only way styling arrives on the page
 * that actually hosts #formWrap.
 */

/* CF7 gif is fetched from the original host and 404s on the mirror; the spinner below replaces it. */
#formWrap img.ajax-loader,
.formWrap img.ajax-loader {
  display: none !important;
}

.neworder-submit-spinner {
  display: none;
  vertical-align: middle;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.65rem;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.72);
  border-radius: 50%;
  animation: neworder-submit-spin 0.65s linear infinite;
}

.neworder-submit-spinner.is-active {
  display: inline-block;
}

@keyframes neworder-submit-spin {
  to {
    transform: rotate(360deg);
  }
}

/*
 * Submitting spans several requests (design image upload, then the order itself). A disabled
 * button alone reads as "nothing happened", so the whole screen states that work is in progress
 * and blocks a second submit.
 */
.neworder-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.neworder-loading-overlay.is-active {
  display: flex;
}

.neworder-loading-box {
  box-sizing: border-box;
  max-width: 20rem;
  width: 100%;
  padding: 28px 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.neworder-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 16px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.72);
  border-radius: 50%;
  animation: neworder-submit-spin 0.65s linear infinite;
}

.neworder-loading-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: #111;
}

.neworder-loading-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #6b7280;
}

body.neworder-is-submitting {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .neworder-submit-spinner.is-active,
  .neworder-loading-spinner {
    animation: none;
    border-color: rgba(0, 0, 0, 0.35);
    border-top-color: rgba(0, 0, 0, 0.72);
  }
}
