/* PuzzleCaptcha — Temu-style theme. Override the variables to re-brand. */
.pzc, .pzc-trigger, .pzc-overlay {
    --pzc-accent: #fb7701;
    --pzc-accent-dark: #e46a00;
    --pzc-accent-soft: #fff1e6;
    --pzc-success: #12a150;
    --pzc-success-soft: #e7f7ee;
    --pzc-error: #e5372d;
    --pzc-error-soft: #fdecea;
    --pzc-text: #222;
    --pzc-muted: #777;
    --pzc-bg: #fff;
    --pzc-line: #e6e6e6;
    --pzc-radius: 12px;
    --pzc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pzc {
    box-sizing: border-box;
    width: 100%;
    max-width: 372px;
    padding: 16px;
    background: var(--pzc-bg);
    border-radius: var(--pzc-radius);
    box-shadow: 0 6px 28px rgba(0, 0, 0, .12);
    font-family: var(--pzc-font);
    color: var(--pzc-text);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.pzc *, .pzc *::before, .pzc *::after { box-sizing: border-box; }

/* ---------- header ---------- */
.pzc-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.pzc-title { flex: 1; font-size: 15px; font-weight: 600; line-height: 1.35; }
.pzc-actions { display: flex; gap: 4px; }
.pzc-icon-btn {
    display: grid; place-items: center;
    width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--pzc-muted);
    cursor: pointer; transition: background .2s, color .2s, transform .4s;
}
.pzc-icon-btn:hover { background: #f3f3f3; color: var(--pzc-text); }
.pzc-icon-btn:active svg { transform: rotate(-180deg); transition: transform .4s; }
.pzc-icon-btn:focus-visible, .pzc-handle:focus-visible, .pzc-trigger:focus-visible {
    outline: 2px solid var(--pzc-accent); outline-offset: 2px;
}

/* ---------- stage ---------- */
.pzc-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 340 / 200;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    touch-action: none;
}
.pzc-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: opacity .35s ease, filter .35s ease;
}
.pzc-piece {
    position: absolute; left: 0; top: 0;
    z-index: 2;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
    will-change: transform;
    pointer-events: none;
    transition: filter .25s ease, opacity .3s ease;
}
.pzc--interactive .pzc-piece { pointer-events: auto; cursor: grab; touch-action: none; }
.pzc--interactive.pzc-dragging .pzc-piece {
    cursor: grabbing;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)) brightness(1.06);
}
.pzc-piece.pzc-animate { transition: transform .45s cubic-bezier(.22, 1.2, .36, 1), filter .25s ease; }
.pzc-piece.pzc-pop { animation: pzc-pop .45s cubic-bezier(.22, 1.4, .36, 1); }
@keyframes pzc-pop {
    0% { opacity: 0; scale: .6; }
    100% { opacity: 1; scale: 1; }
}
/* Interactive: ελαφρύ "ανάσα" για να φανεί ότι σύρεται */
.pzc--interactive.pzc-idle .pzc-piece { animation: pzc-breathe 2.4s ease-in-out .6s infinite; }
@keyframes pzc-breathe {
    0%, 100% { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45)); }
    50% { filter: drop-shadow(0 0 9px rgba(251, 119, 1, .95)); }
}

/* loading skeleton */
.pzc-skeleton {
    position: absolute; inset: 0; z-index: 5;
    background: linear-gradient(100deg, #ececec 30%, #f8f8f8 50%, #ececec 70%);
    background-size: 300% 100%;
    animation: pzc-skeleton 1.2s linear infinite;
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
}
.pzc-is-loading .pzc-skeleton { opacity: 1; }
.pzc-is-loading .pzc-bg, .pzc-is-loading .pzc-piece { opacity: 0; }
@keyframes pzc-skeleton { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* success shine sweep */
.pzc-shine {
    position: absolute; inset: 0; z-index: 3;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%);
    transform: translateX(-120%);
    pointer-events: none;
}
.pzc-success .pzc-shine { animation: pzc-shine .9s ease .15s; }
@keyframes pzc-shine { to { transform: translateX(120%); } }

/* big animated check */
.pzc-success-layer {
    position: absolute; inset: 0; z-index: 4;
    display: grid; place-items: center;
    background: rgba(18, 161, 80, .0);
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease, background .3s ease;
}
.pzc-success .pzc-success-layer { opacity: 1; background: rgba(18, 161, 80, .18); transition-delay: .35s; }
.pzc-bigcheck { width: 64px; height: 64px; border-radius: 50%; background: var(--pzc-success); box-shadow: 0 6px 18px rgba(18, 161, 80, .45); transform: scale(.4); }
.pzc-bigcheck circle { stroke: transparent; }
.pzc-bigcheck path { stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.pzc-success .pzc-bigcheck { animation: pzc-bounce .5s cubic-bezier(.22, 1.6, .36, 1) .35s forwards; }
.pzc-success .pzc-bigcheck path { animation: pzc-draw .45s ease .65s forwards; }
@keyframes pzc-bounce { to { transform: scale(1); } }
@keyframes pzc-draw { to { stroke-dashoffset: 0; } }

/* status banner (slides up from bottom of the image) */
.pzc-banner {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
    padding: 8px 12px;
    font-size: 13px; font-weight: 600; text-align: center; color: #fff;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.pzc-banner.pzc-show { transform: translateY(0); }
.pzc-banner--info { background: rgba(0, 0, 0, .62); }
.pzc-banner--success { background: rgba(18, 161, 80, .94); }
.pzc-banner--error { background: rgba(229, 55, 45, .94); }

/* error shake */
.pzc-error .pzc-piece { animation: pzc-shake .45s cubic-bezier(.36, .07, .19, .97); }
.pzc-error .pzc-stage { animation: pzc-shake-sm .45s; }
@keyframes pzc-shake {
    10%, 90% { translate: -2px 0; }
    20%, 80% { translate: 4px 0; }
    30%, 50%, 70% { translate: -6px 0; }
    40%, 60% { translate: 6px 0; }
}
@keyframes pzc-shake-sm { 30% { translate: -2px 0; } 60% { translate: 2px 0; } }

/* ---------- slider track ---------- */
.pzc-track {
    position: relative;
    margin-top: 14px;
    height: 44px;
    border-radius: 22px;
    background: #f2f2f2;
    border: 1px solid var(--pzc-line);
    overflow: hidden;
    touch-action: none;
}
.pzc-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 22px;
    background: var(--pzc-accent-soft);
    border-right: 0;
    border-radius: 22px;
}
.pzc-track-text {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    padding-left: 40px;
    font-size: 13.5px;
    color: transparent;
    background: linear-gradient(90deg, #999 0%, #999 40%, #fff 50%, #999 60%, #999 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    animation: pzc-text-shine 2.2s linear infinite;
    pointer-events: none;
    transition: opacity .2s;
}
@keyframes pzc-text-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pzc-dragging .pzc-track-text, .pzc-success .pzc-track-text, .pzc-error .pzc-track-text, .pzc-verifying .pzc-track-text { opacity: 0; }

.pzc-handle {
    position: absolute; left: 0; top: 0; z-index: 2;
    display: grid; place-items: center;
    width: 56px; height: 42px;
    border-radius: 21px;
    background: var(--pzc-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(251, 119, 1, .45);
    cursor: grab;
    touch-action: none;
    transition: background .2s, box-shadow .2s, scale .15s;
}
.pzc-handle:hover { background: var(--pzc-accent-dark); }
.pzc-dragging .pzc-handle { cursor: grabbing; scale: 1.04; box-shadow: 0 4px 14px rgba(251, 119, 1, .6); }
.pzc-track.pzc-animate .pzc-handle { transition: transform .45s cubic-bezier(.22, 1.2, .36, 1), background .2s; }
.pzc-track.pzc-animate .pzc-fill { transition: width .45s cubic-bezier(.22, 1.2, .36, 1); }
.pzc-stage.pzc-is-loading ~ .pzc-track .pzc-handle { opacity: .6; pointer-events: none; }

/* verifying spinner on the handle */
.pzc-verifying .pzc-handle svg { display: none; }
.pzc-verifying .pzc-handle::after {
    content: ""; width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    border-radius: 50%; animation: pzc-spin .7s linear infinite;
}
@keyframes pzc-spin { to { transform: rotate(360deg); } }

.pzc-success .pzc-handle { background: var(--pzc-success); box-shadow: 0 2px 10px rgba(18, 161, 80, .5); cursor: default; }
.pzc-success .pzc-fill { background: var(--pzc-success-soft); }
.pzc-success .pzc-track { border-color: #bfe8cf; }
.pzc-error .pzc-handle { background: var(--pzc-error); box-shadow: 0 2px 10px rgba(229, 55, 45, .5); }
.pzc-error .pzc-fill { background: var(--pzc-error-soft); }

/* interactive hint */
.pzc-hint {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--pzc-accent-soft);
    color: #8a4a12;
    font-size: 12.5px;
    line-height: 1.4;
}
.pzc-success .pzc-hint { background: var(--pzc-success-soft); color: #0d6b36; }

.pzc-foot {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    margin-top: 12px;
    font-size: 11.5px; color: #a0a0a0;
}

/* ---------- popup mode ---------- */
.pzc-trigger {
    display: inline-flex; align-items: center; gap: 12px;
    min-width: 260px;
    padding: 12px 16px;
    border: 1px solid #ddd; border-radius: 10px;
    background: #fafafa;
    font: 500 14.5px var(--pzc-font, system-ui);
    color: #333;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.pzc-trigger:hover { border-color: var(--pzc-accent); box-shadow: 0 0 0 3px rgba(251, 119, 1, .12); }
.pzc-trigger-box {
    display: grid; place-items: center;
    width: 26px; height: 26px;
    border: 2px solid #c8c8c8; border-radius: 50%;
    background: #fff; color: #fff;
    transition: all .3s cubic-bezier(.22, 1.4, .36, 1);
}
.pzc-trigger-box svg { width: 16px; height: 16px; }
.pzc-trigger--ok { border-color: #bfe8cf; background: var(--pzc-success-soft); cursor: default; }
.pzc-trigger--ok:hover { box-shadow: none; border-color: #bfe8cf; }
.pzc-trigger--ok .pzc-trigger-box { border-color: var(--pzc-success); background: var(--pzc-success); animation: pzc-pop .4s cubic-bezier(.22, 1.6, .36, 1); }
.pzc-trigger--ok .pzc-trigger-text { color: #0d6b36; font-weight: 600; }

.pzc-overlay {
    position: fixed; inset: 0; z-index: 2147483000;
    display: grid; place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.pzc-overlay.pzc-open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.pzc-modal { width: 100%; max-width: 372px; transform: translateY(18px) scale(.94); transition: transform .32s cubic-bezier(.22, 1.3, .36, 1); }
.pzc-overlay.pzc-open .pzc-modal { transform: none; }

@media (prefers-reduced-motion: reduce) {
    .pzc *, .pzc-trigger *, .pzc-overlay, .pzc-modal { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
