/* PastePanel hCaptcha modal widget — self-contained, isolated under .pphc__.
   No bleed into / from page styles. Used on every form across platform + tenants. */

.pphc__overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Khmer", "Noto Sans Thai",
               "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.pphc__overlay.pphc__is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pphc__card {
  position: relative;
  background: #ffffff;
  color: #0f172a;
  border-radius: 18px;
  padding: 28px 26px 22px;
  width: min(380px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.32),
    0 4px 16px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.05);
  text-align: center;
  transform: translateY(8px) scale(0.96);
  transition: transform .22s cubic-bezier(.2, .7, .4, 1.1);
}
.pphc__overlay.pphc__is-open .pphc__card {
  transform: translateY(0) scale(1);
}

.pphc__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #0f172a;
  font-family: inherit;
}
.pphc__subtitle {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
  font-family: inherit;
}

.pphc__widget-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  margin: 0 0 18px;
}

/* loading spinner shown while hCaptcha's api.js / widget is still loading */
.pphc__load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pphc__spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  animation: pphc-spin .7s linear infinite;
}
@keyframes pphc-spin { to { transform: rotate(360deg); } }
.pphc__load-text {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}

/* timeout / load-failure state — offers retry, never auto-submits */
.pphc__err {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 2px 2px;
}
.pphc__err-text {
  font-size: 13px;
  color: #b91c1c;
  line-height: 1.5;
}
.pphc__retry {
  appearance: none;
  -webkit-appearance: none;
  background: #0f172a;
  color: #fff;
  border: 0;
  padding: 9px 18px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: opacity .15s ease;
}
.pphc__retry:hover,
.pphc__retry:focus-visible { opacity: .88; outline: 0; }
.pphc__retry:focus-visible { box-shadow: 0 0 0 2px #3b82f6; }
@media (prefers-reduced-motion: reduce) {
  .pphc__spin { animation-duration: 1.5s; }
}

.pphc__cancel {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  background: transparent;
  border: 0;
  margin: 0;
  padding: 9px 16px;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.pphc__cancel:hover,
.pphc__cancel:focus-visible {
  background: #f1f5f9;
  color: #334155;
  outline: 0;
}
.pphc__cancel:focus-visible {
  box-shadow: 0 0 0 2px #3b82f6;
}

@media (max-width: 480px) {
  .pphc__card { padding: 24px 20px 18px; border-radius: 16px; }
  .pphc__title { font-size: 16px; }
  .pphc__subtitle { font-size: 13px; margin-bottom: 16px; }
}

/* Card stays white in all themes / OS color schemes — no dark-mode override. */

@media (prefers-reduced-motion: reduce) {
  .pphc__overlay, .pphc__card { transition: none; }
}

/* ── Self-hosted slider-puzzle captcha ──────────────────────────────────── */
.ppsl { margin: 0 auto; max-width: 100%; }
.ppsl__board {
  position: relative;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 1px 3px rgba(15,23,42,.10);
  background: #eef2f7;
  max-width: 100%;
}
.ppsl__bg { position:absolute; inset:0; width:100%; height:100%; display:block; user-select:none; -webkit-user-drag:none; }
.ppsl__piece {
  position: absolute; left: 0; z-index: 2; user-select:none; -webkit-user-drag:none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
  will-change: left;
}
.ppsl__flash { position:absolute; inset:0; z-index:3; pointer-events:none; opacity:0; transition:opacity .2s ease; }
.ppsl__flash.is-ok  { background: rgba(22,163,74,.28);  opacity:1; }
.ppsl__flash.is-bad { background: rgba(220,38,38,.24);  opacity:1; }

.ppsl__track {
  position: relative; margin: 14px auto 2px; height: 40px;
  background: #eef2f7; border: 1px solid rgba(15,23,42,.10);
  border-radius: 21px; max-width: 100%;
}
.ppsl__fill {
  position:absolute; left:0; top:0; height:100%; width:40px;
  background: rgba(79,70,229,.16); border-radius: 21px;
}
.ppsl__hint {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: 12.5px; color:#64748b; pointer-events:none; padding:0 44px; line-height:1.3;
  font-family: inherit;
}
.ppsl__handle {
  position:absolute; left:0; top:0; width:40px; height:40px; z-index:2;
  display:flex; align-items:center; justify-content:center;
  background:#fff; border:1px solid rgba(15,23,42,.14); border-radius:9px;
  box-shadow: 0 1px 4px rgba(15,23,42,.18); color:#475569;
  cursor: grab; touch-action:none; box-sizing:border-box;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.ppsl__handle.is-grab { cursor:grabbing; border-color:#4f46e5; color:#4f46e5; }
.ppsl__handle.is-ok   { background:#16a34a; border-color:#16a34a; color:#fff; }
.ppsl__handle:focus-visible { outline:0; box-shadow:0 0 0 2px #4f46e5; }

.ppsl__board.is-shake { animation: ppsl-shake .5s ease; }
@keyframes ppsl-shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)}
}
@media (prefers-reduced-motion: reduce) {
  .ppsl__board.is-shake { animation: none; }
  .ppsl__flash { transition: none; }
}
