/**
 * RMGCaptcha Math Guard - Public CAPTCHA Styles
 * Premium, polished design with micro-animations.
 */

/* ── Container ───────────────────────────────────────── */
.rmgc-captcha-container {
    margin: 14px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Label ───────────────────────────────────────────── */
.rmgc-captcha-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: #f5f3ff;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid #ede9fe;
}
.rmgc-captcha-label::before {
    content: "🛡️";
    font-size: 11px;
}

/* ── Math Question Box ───────────────────────────────── */
.rmgc-captcha-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6d28d9 100%);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow:
        0 4px 15px rgba(79, 70, 229, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
    animation: rmgc-fade-in 0.4s ease;
}

/* Shimmer sweep effect */
.rmgc-captcha-question::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.12) 50%,
        transparent 60%
    );
    animation: rmgc-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

/* Decorative circles */
.rmgc-captcha-question::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}

@keyframes rmgc-shimmer {
    0%   { left: -60%; }
    60%  { left: 120%; }
    100% { left: 120%; }
}

@keyframes rmgc-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Numbers ─────────────────────────────────────────── */
.rmgc-captcha-number {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
    background: none;
    -webkit-text-fill-color: #ffffff;
    position: relative;
    z-index: 1;
}

.rmgc-captcha-operator {
    font-size: 20px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.65);
    position: relative;
    z-index: 1;
}

/* ── Input ───────────────────────────────────────────── */
.rmgc-captcha-input-wrapper {
    position: relative;
}

.rmgc-captcha-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    font-size: 14px;
    color: #1d2327;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s, background .2s;
    box-sizing: border-box;
}

.rmgc-captcha-input:focus {
    outline: none;
    border-color: #7c3aed;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.rmgc-captcha-input::placeholder {
    color: #a78bfa;
    font-style: italic;
    font-size: 13px;
}

.rmgc-captcha-input.error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

/* ── Error ───────────────────────────────────────────── */
.rmgc-captcha-error {
    margin-top: 6px;
    font-size: 12px;
    color: #d63638;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: rmgc-fade-in 0.25s ease;
}

/* ── WordPress login ─────────────────────────────────── */
.login .rmgc-captcha-container {
    margin: 16px 0;
}

/* ── WooCommerce ─────────────────────────────────────── */
.woocommerce .rmgc-captcha-container {
    margin: 16px 0;
}

/* ── CF7 ─────────────────────────────────────────────── */
.wpcf7 .rmgc-captcha-container {
    margin: 16px 0;
}

/* ── Accessibility ───────────────────────────────────── */
.rmgc-captcha-input:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .rmgc-captcha-input,
    .rmgc-captcha-question,
    .rmgc-captcha-question::before {
        animation: none;
        transition: none;
    }
}