/* ============================================
   ARCANE SHIELD — Anti-Bot Captcha Overlay
   Dark Fantasy / Alchemy Themed
   ============================================ */

/* Full-screen overlay */
.captcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(5, 15, 5, 0.97) 0%, rgba(0, 0, 0, 0.99) 100%);
    backdrop-filter: blur(20px);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.captcha-overlay.verified {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Background mystical effects */
.captcha-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Rotating rune circles at corners */
.captcha-rune {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(57, 255, 20, 0.06);
    border-radius: 50%;
    animation: runeRotate 30s linear infinite;
}

.captcha-rune::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    border: 1px dashed rgba(57, 255, 20, 0.04);
    border-radius: 50%;
}

.rune-1 { top: -80px; left: -80px; animation-duration: 25s; }
.rune-2 { top: -80px; right: -80px; animation-duration: 35s; animation-direction: reverse; }
.rune-3 { bottom: -80px; left: -80px; animation-duration: 40s; }
.rune-4 { bottom: -80px; right: -80px; animation-duration: 28s; animation-direction: reverse; }

@keyframes runeRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ambient dark smoke */
.captcha-smoke {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    animation: smokeFloat 20s infinite ease-in-out alternate;
}

.smoke-1 {
    bottom: -200px;
    left: -100px;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.04) 0%, transparent 70%);
    animation-duration: 25s;
}

.smoke-2 {
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(20, 100, 57, 0.05) 0%, transparent 70%);
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes smokeFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(60px, -80px) scale(1.3); opacity: 0.8; }
}

/* ---- Captcha Box ---- */
.captcha-box {
    position: relative;
    width: 380px;
    max-width: 90vw;
    background: linear-gradient(180deg, rgba(8, 20, 10, 0.95) 0%, rgba(2, 8, 3, 0.98) 100%);
    border: 1px solid rgba(57, 255, 20, 0.25);
    padding: 35px 30px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow:
        0 0 40px rgba(57, 255, 20, 0.05),
        0 0 80px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: boxAppear 0.6s ease-out;
}

/* Gothic corner ornaments on captcha box */
.captcha-box::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background:
        radial-gradient(circle, #39FF14 2px, transparent 2px) 0 0,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 100% 0,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 0 100%,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 100% 100%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.captcha-box::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    bottom: 7px;
    background:
        linear-gradient(to right, #39FF14 12px, transparent 12px) 0 0 / 100% 1px,
        linear-gradient(to bottom, #39FF14 12px, transparent 12px) 0 0 / 1px 100%,
        linear-gradient(to left, #39FF14 12px, transparent 12px) 100% 0 / 100% 1px,
        linear-gradient(to bottom, #39FF14 12px, transparent 12px) 100% 0 / 1px 100%,
        linear-gradient(to right, #39FF14 12px, transparent 12px) 0 100% / 100% 1px,
        linear-gradient(to top, #39FF14 12px, transparent 12px) 0 100% / 1px 100%,
        linear-gradient(to left, #39FF14 12px, transparent 12px) 100% 100% / 100% 1px,
        linear-gradient(to top, #39FF14 12px, transparent 12px) 100% 100% / 1px 100%;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

@keyframes boxAppear {
    0% { opacity: 0; transform: translateY(20px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sigil background behind captcha box content */
.captcha-sigil {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: sigilSpin 60s linear infinite;
    opacity: 0.3;
}

.sigil-svg {
    width: 100%;
    height: 100%;
}

@keyframes sigilSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---- Header Section ---- */
.captcha-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.captcha-icon-wrap {
    width: 40px;
    height: 40px;
    color: #39FF14;
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.5));
    margin-bottom: 4px;
    animation: shieldPulse 3s ease-in-out infinite;
}

.captcha-shield-icon {
    width: 100%;
    height: 100%;
}

@keyframes shieldPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.4)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 15px rgba(57, 255, 20, 0.7)); transform: scale(1.05); }
}

.captcha-title {
    font-family: 'Ruslan Display', serif;
    font-size: 1.1rem;
    color: #39FF14;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
    font-weight: 400;
}

.captcha-subtitle {
    font-family: 'Forum', serif;
    font-size: 0.75rem;
    color: rgba(57, 255, 20, 0.5);
    letter-spacing: 2px;
    font-weight: 400;
}

/* ---- Checkbox Area ---- */
.captcha-body {
    width: 100%;
    z-index: 2;
}

.captcha-checkbox-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(57, 255, 20, 0.12);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.captcha-checkbox-area:hover {
    border-color: rgba(57, 255, 20, 0.3);
    background: rgba(5, 15, 5, 0.6);
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.03);
}

.captcha-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* The Checkbox */
.captcha-checkbox {
    position: relative;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(57, 255, 20, 0.4);
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.captcha-checkbox:hover {
    border-color: rgba(57, 255, 20, 0.7);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.15);
}

.checkbox-border-glow {
    position: absolute;
    inset: -4px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    pointer-events: none;
}

.captcha-checkbox:hover .checkbox-border-glow {
    border-color: rgba(57, 255, 20, 0.1);
}

.captcha-checkmark {
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.captcha-checkmark.visible {
    opacity: 1;
    transform: scale(1);
}

/* Spinner */
.captcha-spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(57, 255, 20, 0.15);
    border-top: 2px solid #39FF14;
    border-radius: 50%;
    display: none;
    animation: spinnerRotate 0.8s linear infinite;
}

.captcha-spinner.active {
    display: block;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.captcha-label {
    font-family: 'Kelly Slab', serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.captcha-checkbox-area:hover .captcha-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Brand tag */
.captcha-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.captcha-brand:hover {
    opacity: 0.7;
}

.captcha-brand-icon {
    font-size: 1.1rem;
    color: #39FF14;
    filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.4));
}

.captcha-brand-text {
    font-family: 'Kelly Slab', serif;
    font-size: 0.5rem;
    color: rgba(57, 255, 20, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Status text */
.captcha-status {
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

#captcha-status-text {
    font-family: 'Forum', serif;
    font-size: 0.7rem;
    color: rgba(57, 255, 20, 0.5);
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
}

/* Error state */
.captcha-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 40, 40, 0.08);
    border: 1px solid rgba(255, 60, 60, 0.2);
    z-index: 2;
    width: 100%;
}

.captcha-error.visible {
    display: flex;
}

.error-icon {
    width: 18px;
    height: 18px;
    color: #ff4444;
    flex-shrink: 0;
}

#captcha-error-text {
    font-family: 'Forum', serif;
    font-size: 0.7rem;
    color: #ff6666;
    letter-spacing: 1px;
}

/* ---- Verified State ---- */
.captcha-checkbox.verified {
    border-color: #39FF14;
    background: rgba(57, 255, 20, 0.08);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

.captcha-checkbox-area.verified {
    border-color: rgba(57, 255, 20, 0.35);
    pointer-events: none;
}

.captcha-checkbox-area.verified .captcha-label {
    color: #39FF14;
}

/* ---- Success flash effect ---- */
.captcha-box.success-flash {
    animation: successFlash 0.6s ease-out;
}

@keyframes successFlash {
    0% { box-shadow: 0 0 40px rgba(57, 255, 20, 0.05), 0 0 80px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 0 80px rgba(57, 255, 20, 0.3), 0 0 120px rgba(57, 255, 20, 0.1), inset 0 0 40px rgba(57, 255, 20, 0.05); }
    100% { box-shadow: 0 0 40px rgba(57, 255, 20, 0.05), 0 0 80px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.5); }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .captcha-box {
        padding: 28px 18px 24px;
        gap: 16px;
    }

    .captcha-title {
        font-size: 0.9rem;
        letter-spacing: 3px;
    }

    .captcha-subtitle {
        font-size: 0.65rem;
    }

    .captcha-checkbox-area {
        padding: 14px 16px;
    }

    .captcha-label {
        font-size: 0.85rem;
    }

    .captcha-rune {
        width: 120px;
        height: 120px;
    }
}
