.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.captcha__item__icon {
    border-radius: 8px;
    width: 32px;
    height: 32px;
    object-fit: cover;
    background: #f1f2f5;
    padding: 4px;
}

/* Оверлей */
.captcha-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Карточка */
.captcha-modal__content {
    position: relative;
    z-index: 1;
    background: var(--background-bg-primary, #ffffff);
    border: 1px solid var(--border-alpha-subtle, rgba(0, 0, 0, 0.08));
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 400px;
    margin: 16px;
    overflow: hidden;
    animation: captcha-modal-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes captcha-modal-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}



/* Заголовок */
.captcha-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-alpha-light, rgba(0, 0, 0, 0.06));
}

.captcha-modal__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Иконка */
.captcha-modal__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--basic-brand-overlay-surface, rgba(13, 110, 253, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.captcha-modal__title {
    font-family: var(--family-body, "Inter", sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin: 0;
    line-height: 1.3;
}

.captcha-modal__subtitle {
    font-family: var(--family-body, "Inter", sans-serif);
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
    margin: 2px 0 0;
    line-height: 1.3;
}

/* Кнопка закрыть */
.captcha-modal__close {
    flex-shrink: 0;
    background: var(--background-bg-secondary, #F0F2F5);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: var(--text-secondary, #6c757d);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.captcha-modal__close:hover {
    background: var(--border-light, #e5e7eb);
    color: var(--text-primary, #212529);
}

/* Тело */
.captcha-modal__body {
    padding: 10px;
    display: flex;
    justify-content: center;
    background: var(--background-bg-secondary, #F0F2F5);
}

/* ============================================
   Тёмная тема
   ============================================ */
html.dark .captcha-modal__content {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--border-alpha-subtle, rgba(255, 255, 255, 0.12));
}

html.dark .captcha-modal__close {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

html.dark .captcha-modal__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

html.dark .captcha-modal__body {
    background: var(--background-bg-secondary, #1a1d20);
}

/* Фолбэк: белая подложка под виджет если отдельного тёмного site_key нет */
html.dark #captcha-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

/* Убрать подложку если тёмный ключ задан */
html.dark #captcha-container[data-dark-key="1"] {
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: block;
}
#captcha-container{
    width: 100%!important;
}


/* ============================================
   Мобильные
   ============================================ */
@media (max-width: 480px) {
    .captcha-modal__content {
        margin: 12px;
        border-radius: 16px;
    }

    .captcha-modal__header {
        padding: 16px 16px 14px;
    }

    .captcha-modal__body {
        padding: 6px;
    }
}
