/* AssiSeek — капча «Собери запрос» */

.qc-widget {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 14px;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s, background 0.25s;
}

.qc-widget::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.14), transparent 70%);
    pointer-events: none;
}

.qc-widget.qc-solved {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.08), rgba(99, 102, 241, 0.04));
}

.qc-widget:not(.qc-compact) .qc-compact-bar {
    display: none;
}

/* Compact / collapsible */
.qc-compact-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    position: relative;
    z-index: 2;
}

.qc-compact-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    flex-shrink: 0;
}

.qc-compact-text {
    flex: 1;
    font-weight: 500;
}

.qc-compact-state {
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
}

.qc-compact-bar.qc-compact-solved .qc-compact-state {
    color: #86efac;
}

.qc-widget.qc-expanded .qc-compact-state {
    transform: rotate(180deg);
}

.qc-body {
    padding: 0 14px 14px;
    display: none;
}

.qc-widget.qc-expanded .qc-body,
.qc-widget:not(.qc-compact) .qc-body {
    display: block;
}

.qc-widget.qc-compact.qc-collapsed .qc-body {
    display: none;
}

.qc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.qc-theme-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.qc-header-text {
    flex: 1;
    min-width: 0;
}

.qc-theme-title {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.qc-theme-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.qc-refresh-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.qc-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: rotate(90deg);
}

.qc-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.qc-label-pool {
    margin-top: 10px;
}

.qc-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 48px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(99, 102, 241, 0.35);
}

.qc-slot {
    min-width: 68px;
    min-height: 38px;
    padding: 3px;
    border-radius: 11px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.qc-slot-hover {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.14);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
    transform: scale(1.03);
}

.qc-slot-filled {
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
}

.qc-slot-placeholder {
    color: rgba(255, 255, 255, 0.28);
    font-size: 13px;
    font-weight: 700;
    user-select: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 44px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.qc-chip-text {
    position: relative;
    z-index: 1;
}

.qc-chip {
    padding: 9px 13px;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.92), rgba(129, 140, 248, 0.88));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.32);
    transition: transform 0.15s ease, opacity 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    position: relative;
}

.qc-chip::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.qc-chip:hover::after {
    opacity: 1;
}

.qc-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(99, 102, 241, 0.42);
}

.qc-chip:active,
.qc-chip.qc-chip-dragging {
    cursor: grabbing;
    opacity: 0.3;
    transform: scale(0.95);
}

.qc-chip.qc-chip-landed {
    animation: qc-land 0.32s ease;
}

@keyframes qc-land {
    0% { transform: scale(1.08); }
    60% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

body.qc-is-dragging {
    cursor: grabbing !important;
}

body.qc-is-dragging * {
    cursor: grabbing !important;
}

.qc-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000;
    display: none;
    padding: 9px 13px;
    border-radius: 11px;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.5);
    will-change: transform;
}

.qc-ghost.qc-ghost-active {
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.6);
    filter: brightness(1.05);
}

.qc-status {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 7px;
}

.qc-status-success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.qc-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.qc-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 11px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    font-size: 12px;
}

.qc-retry-btn {
    padding: 5px 11px;
    border: none;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

/* Modal */
.qc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.qc-modal-overlay.qc-modal-open {
    display: flex;
}

.qc-modal-dialog {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #1a1b2e;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.qc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.qc-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.qc-modal-close {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.qc-modal-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
    line-height: 1.5;
}

.qc-modal-captcha .qc-widget {
    margin: 0;
}

.qc-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.qc-modal-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.qc-modal-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.qc-modal-confirm {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.qc-modal-confirm.qc-modal-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.qc-modal-shake {
    animation: qc-shake 0.4s ease;
}

@keyframes qc-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@media (max-width: 480px) {
    .qc-chip {
        font-size: 12px;
        padding: 10px 12px;
        min-height: 40px;
    }
    .qc-slot {
        min-width: 58px;
        min-height: 42px;
    }
    .qc-slots, .qc-pool {
        gap: 6px;
        padding: 6px;
    }
    .qc-modal-dialog {
        padding: 16px;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qc-chip, .qc-slot, .qc-ghost, .qc-compact-state {
        transition: none !important;
        animation: none !important;
    }
    .qc-chip.qc-chip-landed {
        animation: none;
    }
}