/* ============================================ */
/* ОСНОВНЫЕ СТИЛИ                               */
/* ============================================ */

#bw-cf-root {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    background: #222;
    color: #d9d9d9;
    overflow: auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    direction: ltr !important;
    font-size: 16px !important;
    line-height: 1.5;
    text-align: left !important;
    unicode-bidi: isolate !important;
}

#bw-cf-root * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* ============================================ */
/* КОНТЕНТ                                      */
/* ============================================ */

#bw-cf-root .main-content {
    margin: 8em auto;
    padding: 0 1.5em;
    max-width: 60em;
    width: 100%;
}

#bw-cf-root .h1 {
    line-height: 1.4;
    font-size: 2.5em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75em;
    color: #fff;
}

#bw-cf-root .core-msg {
    line-height: 1.6;
    font-size: 1.5em;
    font-weight: 400;
    color: #d1d1d1;
    margin-top: 2.5em;
}

#bw-cf-root .heading-favicon {
    height: 1em;
    width: auto;
}

#bw-cf-root .widget-spacer {
    margin: 2.5em 0;
}

/* ============================================ */
/* КНОПКА "I'M NOT A ROBOT"                     */
/* ============================================ */

#bw-cf-root .checkbox-window {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    border: 1px solid #797979;
    background-color: #232323;
    height: 78px;
    user-select: none;
    padding: 0 16px;
    width: 100%;
    max-width: 320px;
    direction: ltr !important;
    text-align: left !important;
}

#bw-cf-root .checkbox-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 78px;
    justify-content: space-between;
    gap: 7px;
    direction: ltr !important;
}

#bw-cf-root .checkbox-container {
    width: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#bw-cf-root .checkbox {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 2px solid #dadada;
    background: #232323;
    cursor: pointer;
    display: block;
    outline: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s;
}

#bw-cf-root .checkbox:hover {
    border-color: #fbad41;
}

#bw-cf-root .tettx {
    display: flex;
    align-items: center;
    min-height: 30px;
    flex: 1;
    direction: ltr !important;
    text-align: left !important;
}

#bw-cf-root .tettx p {
    margin: 0 !important;
    line-height: 1;
    font-size: 14px;
    color: #fff;
    direction: ltr !important;
    text-align: left !important;
}

#bw-cf-root .checkbox-row > div:last-child {
    display: inline-flex;
    flex-direction: column;
    text-align: right;
    align-items: flex-end;
}

#bw-cf-root .checkbox-row > div:last-child p {
    line-height: 1.4;
    color: #bbb;
    font-size: 8px;
    text-decoration: underline;
    margin: 0 !important;
}

#bw-cf-root .spinner-wrap {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

#bw-cf-root .ck-wrap {
    display: none;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

/* ============================================ */
/* АНИМАЦИЯ СПИННЕРА                            */
/* ============================================ */

@keyframes bwCfSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#bw-cf-root .spinner-wrap svg {
    animation: bwCfSpin 0.85s linear infinite !important;
}

/* ============================================ */
/* АНИМАЦИЯ ГАЛОЧКИ                             */
/* ============================================ */

@keyframes bwCfPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

#bw-cf-root .ck-wrap svg {
    animation: bwCfPulse 0.5s ease-in-out !important;
}

/* ============================================ */
/* ФУТЕР                                        */
/* ============================================ */

#bw-cf-root .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1em 1.5em;
}

#bw-cf-root .footer-inner {
    border-top: 1px solid #444;
    padding: 1em 0;
    text-align: center;
    font-size: .75em;
}

#bw-cf-root .rc {
    font-family: monospace;
}

/* ============================================ */
/* МОДАЛЬНОЕ ОКНО                               */
/* ============================================ */

#bw-cf-root .verify-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, .7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2147483648 !important;
    opacity: 0;
    transition: opacity .3s, visibility .3s;
}

#bw-cf-root .verify-window.active {
    display: flex;
    opacity: 1;
}

#bw-cf-root .modal-content {
    background: #2b2b2b;
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    overflow: hidden;
    transform: scale(.95);
    transition: transform .3s;
}

#bw-cf-root .verify-window.active .modal-content {
    transform: scale(1);
}

#bw-cf-root .modal-header {
    background: linear-gradient(90deg, #f38020, #e9a33f);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    direction: ltr !important;
    text-align: left !important;
}

#bw-cf-root .modal-header h2 {
    font-size: 1em;
    margin: 0 !important;
    color: #fff;
    font-weight: 600;
}

#bw-cf-root .modal-header p {
    font-size: .75em;
    margin: .1em 0 0 !important;
    color: #fff;
    opacity: .9;
}

#bw-cf-root .modal-header img {
    height: 40px;
}

#bw-cf-root .modal-body {
    padding: 1.25em;
    direction: ltr !important;
    text-align: left !important;
}

/* ============================================ */
/* ИНСТРУКЦИИ - СТИЛИ ДЛЯ КНОПОК                */
/* ============================================ */

#bw-cf-root .instruction-list {
    list-style: none;
    padding: 0;
    padding-left: 0;
    margin: 0 0 1em;
}

#bw-cf-root .instruction-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: .6em .75em;
    margin-bottom: .4em;
    background: rgba(255, 255, 255, .07);
    border-left: 2px solid #f38020;
    direction: ltr !important;
    text-align: left !important;
}

#bw-cf-root .step-left {
    display: flex;
    align-items: center;
    gap: .75em;
    direction: ltr !important;
}

#bw-cf-root .step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #f38020, #e9a33f);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    border-radius: 50%;
    flex: 0 0 auto;
}

#bw-cf-root .step-text {
    color: #fff;
    font-size: 13px;
}

/* ============================================ */
/* СТИЛЬ КНОПОК (ОБЫЧНЫЙ)                       */
/* ============================================ */

#bw-cf-root .step-text b {
    display: inline-block;
    background: rgba(243, 128, 32, 0.2);
    color: #f59040;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 11.5px;
    font-family: monospace;
    vertical-align: middle;
    margin: 0 2px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

/* ============================================ */
/* ПОДСВЕТКА КНОПОК (klit) - ОРАНЖЕВАЯ         */
/* ============================================ */

#bw-cf-root .step-text b.klit {
    background: rgba(243, 128, 32, 0.55) !important;
    border-color: #f38020 !important;
    color: #ffb870 !important;
    transform: scale(0.95) !important;
    box-shadow: 0 0 20px rgba(243, 128, 32, 0.4) !important;
}

/* ============================================ */
/* ПЛЮС МЕЖДУ КНОПКАМИ                          */
/* ============================================ */

#bw-cf-root .step-text .plus {
    color: #666;
    font-size: 11px;
    margin: 0 3px;
    vertical-align: middle;
}

/* ============================================ */
/* СТИЛИ ДЛЯ KBD                                */
/* ============================================ */

#bw-cf-root kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 1px 0 #0a0a0a;
    color: #fff;
    font-family: monospace;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================ */
/* АНИМАЦИЯ ЛИНИИ ЗАГРУЗКИ                      */
/* ============================================ */

#bw-cf-root .cf-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .75em 0 1.25em;
}

#bw-cf-root .cf-loader svg {
    width: 72px;
    height: auto;
    margin-bottom: 10px;
}

#bw-cf-root .cf-loader-bar {
    width: 116px;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

#bw-cf-root .cf-loader-bar-inner {
    width: 25%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #f78100 45%, #f78100 55%, transparent);
    border-radius: 2px;
    animation: cfLoadBar 0.9s ease-in-out infinite;
}

@keyframes cfLoadBar {
    0% { transform: translateX(-100%) }
    50% { transform: translateX(400%) }
    100% { transform: translateX(-100%) }
}

/* ============================================ */
/* СВЕТЛАЯ ТЕМА                                 */
/* ============================================ */

@media (prefers-color-scheme: light) {
    #bw-cf-root {
        background: #fff !important;
        color: #111;
    }
    #bw-cf-root .h1 {
        color: #111;
    }
    #bw-cf-root .core-msg {
        color: #444;
    }
    #bw-cf-root .footer-inner {
        border-top-color: #ddd;
        color: #777;
    }
    #bw-cf-root .checkbox-window {
        border-color: #d1d1d1;
        background-color: #f9f9f9;
    }
    #bw-cf-root .checkbox {
        border-color: #aaa;
        background: #eee;
    }
    #bw-cf-root .tettx p {
        color: #111;
    }
    #bw-cf-root .checkbox-row > div:last-child p {
        color: #555;
    }
    #bw-cf-root .modal-content {
        background: #fff;
    }
    #bw-cf-root .step-text {
        color: #222;
    }
    #bw-cf-root .step-text b {
        background: rgba(243, 128, 32, .15);
        color: #b05500;
    }
    #bw-cf-root .step-text b.klit {
        background: rgba(243, 128, 32, .4) !important;
        color: #904000 !important;
        box-shadow: 0 0 20px rgba(243, 128, 32, 0.25) !important;
    }
    #bw-cf-root .instruction-list li {
        background: rgba(0, 0, 0, .04);
    }
}