/* ==========================================================================
   captcha-modal.css
   滑块验证弹窗样式（配合 loginbow.js 的 sliderCaptcha 插件 + captcha-modal.js 使用）
   - 所有样式限定在 .captcha-mask / .captcha-modal 下，不影响页面其他元素
   - 已包含插件所需的全部基础样式，不再依赖 loginstyle.css
   ========================================================================== */

/* ===== 遮罩 ===== */
.captcha-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}

    .captcha-mask.is-open {
        opacity: 1;
        visibility: visible;
    }

/* ===== 弹窗 =====
   默认宽度 = 280 画布 + 左右内边距各 20；
   实际宽度由 captcha-modal.js 根据 width 参数自动设置 */
.captcha-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 320px;
    max-width: calc(100vw - 16px);
    padding: 18px 20px 22px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
    z-index: 1002;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -46%) scale(.96);
    transition: opacity .2s, transform .2s, visibility .2s;
}

    .captcha-modal.is-open {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }

/* 弹窗打开时锁定页面滚动 */
body.captcha-open {
    overflow: hidden;
}

/* ===== 标题栏 ===== */
.captcha-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.captcha-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
}

.captcha-modal__close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

    .captcha-modal__close:hover {
        background: #f1f5f9;
        color: #1e293b;
    }

    .captcha-modal__close:focus-visible {
        outline: 2px solid #1a56db;
        outline-offset: 2px;
    }

/* ===== 拼图区域（插件生成的元素） ===== */
.captcha-modal__body {
    user-select: none;
}

    .captcha-modal__body > canvas:first-child {
        display: block;
        border-radius: 10px;
        background: #f1f5f9;
    }

.captcha-modal .block {
    position: absolute;
    left: 0;
    top: 0;
    cursor: grab;
}

.captcha-modal .refreshIcon {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 5;
    width: 30px;
    height: 30px;
    margin: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #64748b;
    font-size: 13px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: color .2s, transform .4s;
}

    .captcha-modal .refreshIcon:hover {
        color: #1a56db;
        transform: rotate(180deg);
    }

/* ===== 胶囊滑动条（高度保持 40，与插件 JS 计算一致） ===== */
.captcha-modal .sliderContainer {
    position: relative;
    margin-top: 16px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
}

.captcha-modal .sliderbg {
    position: absolute;
    inset: 0;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    box-sizing: border-box;
}

.captcha-modal .sliderMask {
    position: absolute;
    left: 0;
    top: 0;
    height: 40px;
    border: 0 solid #1a56db;
    border-radius: 999px;
    background: #dbeafe;
    box-sizing: border-box;
}

.captcha-modal .slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #475569;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
    box-sizing: border-box;
    cursor: pointer;
    transition: background .2s linear, color .2s;
}

    .captcha-modal .slider:hover {
        background: #1a56db;
        color: #fff;
    }

.captcha-modal .sliderText {
    position: relative;
}

/* 箭头图标统一换成 chevron-right（FA4 / FA5 编码相同） */
.captcha-modal .sliderIcon:before {
    content: "\f054";
}

/* 拖动中 */
.captcha-modal .sliderContainer_active .slider {
    border: 1px solid #1a56db;
}

.captcha-modal .sliderContainer_active .sliderMask {
    border-width: 1px 0 1px 1px;
}

/* 成功 */
.captcha-modal .sliderContainer_success .slider {
    border: 1px solid #10b981;
    background: #10b981 !important;
    color: #fff;
}

.captcha-modal .sliderContainer_success .sliderMask {
    border: 1px solid #10b981;
    border-width: 1px 0 1px 1px;
    background: #d1fae5;
}

.captcha-modal .sliderContainer_success .sliderIcon:before {
    content: "\f00c";
}

/* 失败 */
.captcha-modal .sliderContainer_fail .slider {
    border: 1px solid #ef4444;
    background: #ef4444 !important;
    color: #fff;
}

.captcha-modal .sliderContainer_fail .sliderMask {
    border: 1px solid #ef4444;
    border-width: 1px 0 1px 1px;
    background: #fee2e2;
}

.captcha-modal .sliderContainer_fail .sliderIcon:before {
    content: "\f00d";
}

/* 拖动 / 成功 / 失败时隐藏提示文字 */
.captcha-modal .sliderContainer_active .sliderText,
.captcha-modal .sliderContainer_success .sliderText,
.captcha-modal .sliderContainer_fail .sliderText {
    display: none;
}
