/* Giao diện Widget Captcha Kéo Thả - ShopXanh */
.sx-dcap-box {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 10px;
    color: #1f2937;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    text-align: left;
    margin: 0 auto 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sx-dcap-box.sx-dcap-error {
    border: 1px solid #b91c1c !important;
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}
.sx-dcap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.sx-dcap-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}
.sx-dcap-refresh {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sx-dcap-refresh:hover {
    background: #e5e7eb;
    color: #111827;
}
.sx-dcap-refresh.spinning i {
    animation: sxDcapSpin 0.6s linear infinite;
}
@keyframes sxDcapSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.sx-dcap-fit {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f4f6;
}
.sx-dcap-stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 340px;
    height: 170px;
    transform-origin: 0 0;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    outline: none;
}
.sx-dcap-bg {
    display: block;
    width: 340px;
    height: 170px;
    pointer-events: none;
}
.sx-dcap-piece {
    position: absolute;
    width: 120px;
    height: 120px;
    cursor: grab;
    touch-action: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
    transform-origin: 50% 50%;
    user-select: none;
    -webkit-user-drag: none;
}
.sx-dcap-piece.dragging {
    cursor: grabbing;
}
.sx-dcap-stick {
    position: absolute;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    transform-origin: 0 50%;
    pointer-events: none;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.45);
}
.sx-dcap-handle {
    position: absolute;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    cursor: alias;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
}
.sx-dcap-handle::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
}
.sx-dcap-stage.done::after {
    content: "✔ Xác minh thành công";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 163, 74, 0.78);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    z-index: 5;
}
.sx-dcap-actions {
    margin-top: 10px;
}
.sx-dcap-btn-verify {
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 600;
    background: #16a34a;
    color: #ffffff;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease;
}
.sx-dcap-btn-verify:hover {
    background: #15803d;
}
.sx-dcap-btn-verify:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.sx-dcap-msg {
    margin-top: 6px;
    font-size: 13px;
    text-align: center;
    line-height: 1.35;
}
.sx-dcap-msg:empty {
    display: none;
    margin-top: 0;
}
.sx-dcap-msg.ok {
    color: #15803d;
    font-weight: 600;
}
.sx-dcap-msg.bad {
    color: #b91c1c;
    font-weight: 600;
}
