/* ===== 滑塊驗證碼樣式（Apple UI 風格）===== */

/* 外框 — Apple Liquid Glass */
.captcha-checkbox-wrapper {
    width: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.35) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.5);
    overflow: hidden;
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.captcha-checkbox-wrapper:hover {
    box-shadow:
        0 6px 30px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transform: translateY(-1px);
}

/* Checkbox 行 */
.captcha-checkbox-row {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s;
}

.captcha-checkbox-row:hover {
    background: rgba(255,255,255,0.15);
}

.captcha-checkbox-box {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 7px;
    background: rgba(255,255,255,0.8);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.captcha-checkbox-row:hover .captcha-checkbox-box {
    border-color: rgba(0,0,0,0.3);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

/* Spinner */
.captcha-checkbox-box .captcha-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,122,255,0.8);
    border-top-color: transparent;
    border-radius: 50%;
    animation: captcha-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: none;
}

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

/* 成功勾勾 */
.captcha-checkbox-box .captcha-checkmark {
    display: none;
    width: 18px;
    height: 18px;
}

.captcha-checkmark-svg {
    width: 18px;
    height: 18px;
}

.captcha-checkmark-svg .checkmark-path {
    stroke: #34c759;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: captcha-draw-check 0.4s 0.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes captcha-draw-check {
    to { stroke-dashoffset: 0; }
}

.captcha-checkbox-label {
    margin-left: 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0,0,0,0.7);
    line-height: 1;
    letter-spacing: -0.1px;
}

/* 面板展開 */
.captcha-slider-panel {
    display: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: rgba(248,248,248,0.6);
    overflow: hidden;
    animation: captcha-slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes captcha-slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 260px; }
}

.captcha-slider-panel.show {
    display: block;
}

/* 圖片區域 */
.captcha-image-area {
    position: relative;
    width: 300px;
    height: 160px;
    margin: 10px auto 0;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0,0,0,0.04);
    user-select: none;
    -webkit-user-select: none;
    box-shadow:
        0 2px 12px rgba(0,0,0,0.08),
        inset 0 0 0 1px rgba(0,0,0,0.04);
}

.captcha-image-area .captcha-bg {
    display: block;
    width: 300px;
    height: 160px;
}

.captcha-image-area .captcha-piece {
    position: absolute;
    top: 0;
    left: 0;
    height: 160px;
    width: auto;
    cursor: grab;
    filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.35));
    z-index: 5;
    transition: filter 0.2s ease;
}

.captcha-image-area .captcha-piece:hover {
    filter: drop-shadow(2px 2px 6px rgba(0,0,0,0.5));
}

.captcha-image-area .captcha-piece:active {
    cursor: grabbing;
}

.captcha-image-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #fff;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 14px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 8;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.captcha-refresh-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.25s ease;
    padding: 0;
}

.captcha-refresh-btn:hover {
    background: rgba(0,0,0,0.5);
    transform: rotate(90deg);
}

.captcha-refresh-btn i {
    font-size: 12px;
}

/* 成功遮罩 — 綠色圓圈勾勾動畫 */
.captcha-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 199, 89, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
    animation: captcha-fadeIn 0.3s ease;
}

@keyframes captcha-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.captcha-success-overlay.show {
    display: flex;
}

.captcha-success-circle {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(52,199,89,0.3);
    animation: captcha-pop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes captcha-pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.captcha-success-check {
    width: 28px;
    height: 28px;
}

.captcha-success-check .success-check-path {
    stroke: #34c759;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: captcha-draw-check 0.5s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 失敗遮罩 */
.captcha-fail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 59, 48, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
    animation: captcha-fadeIn 0.3s ease;
}

.captcha-fail-overlay.show {
    display: flex;
}

.captcha-fail-circle {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255,59,48,0.25);
    animation: captcha-shake 0.4s ease;
}

@keyframes captcha-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.captcha-fail-x {
    width: 24px;
    height: 24px;
}

.captcha-fail-x line {
    stroke: #ff3b30;
    stroke-width: 3;
    stroke-linecap: round;
}

/* 底部文字 */
.captcha-panel-footer {
    text-align: center;
    padding: 8px 0 10px;
    font-size: 11px;
    color: rgba(0,0,0,0.3);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 載入中 */
.captcha-panel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 190px;
    width: 300px;
    margin: 10px auto 10px;
    color: rgba(0,0,0,0.35);
    font-size: 13px;
    font-weight: 500;
}

.captcha-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(0,0,0,0.08);
    border-top-color: rgba(0,122,255,0.7);
    border-radius: 50%;
    animation: captcha-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 10px;
}

/* 驗證成功 checkbox */
.captcha-checkbox-wrapper.verified .captcha-checkbox-box {
    border-color: #34c759;
    background: rgba(52,199,89,0.08);
}

.captcha-checkbox-wrapper.verified .captcha-checkbox-row {
    cursor: default;
}

.captcha-checkbox-wrapper.verified .captcha-checkbox-row:hover {
    background: transparent;
}

.captcha-checkbox-wrapper.verified .captcha-checkbox-label {
    color: rgba(0,0,0,0.5);
}
