/* styles/components/turnstile-gate.css
   Popup that runs the Cloudflare Turnstile check over a form on submit
   (js/components/turnstile-gate.js). Sits below the toast (120000). */

.turnstile-gate {
    position: fixed;
    inset: 0;
    z-index: 110000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.turnstile-gate.is-open {
    display: flex;
}

/* Check running silently: laid out (so Cloudflare's frame can run) but not
   visible or clickable. Switched to .is-open only if a click is needed. */
.turnstile-gate.is-pending {
    display: flex;
    visibility: hidden;
    pointer-events: none;
}

/* busy cursor while the silent check runs */
html.turnstile-checking,
html.turnstile-checking * {
    cursor: progress !important;
}

.turnstile-gate__dialog {
    width: 100%;
    max-width: 360px;
    padding: 24px 20px 20px;
    border-radius: 12px;
    background-color: var(--_primitives---colors--surface-darker, #1c1a19);
    border: 1px solid var(--_primitives---colors--neutral-darker, #34302d);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    color: var(--_primitives---colors--white, #f2f2f2);
    font-family: var(--_typography---font-styles--body, inherit);
    text-align: center;
}

.turnstile-gate__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
}

.turnstile-gate__text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--_primitives---colors--neutral-light, #b2b2b2);
}

/* Turnstile's own box is 300x65 */
.turnstile-gate__widget {
    min-height: 65px;
    display: flex;
    justify-content: center;
}

.turnstile-gate__checking {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: -45px; /* sits over the (hidden) Cloudflare box area */
    min-height: 45px;
    font-size: 14px;
    color: var(--_primitives---colors--neutral-light, #b2b2b2);
}

.turnstile-gate.is-slow .turnstile-gate__checking {
    display: flex;
}

.turnstile-gate__spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--_primitives---colors--primary, #a6d5c5) 25%, transparent);
    border-top-color: var(--_primitives---colors--primary, #a6d5c5);
    animation: turnstile-gate-spin 0.8s linear infinite;
}

@keyframes turnstile-gate-spin {
    to { transform: rotate(360deg); }
}

.turnstile-gate__error {
    display: none;
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--_primitives---colors--danger-light, #f19a9a);
}

.turnstile-gate__error.is-visible {
    display: block;
}

.turnstile-gate__cancel {
    margin-top: 16px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--_primitives---colors--neutral-dark, #4a4542);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.turnstile-gate__cancel:hover {
    border-color: var(--_primitives---colors--primary, #a6d5c5);
}
