/* Капча ALTCHA (App\Services\Altcha::widget): вход и регистрация, окно жалобы и
   «Свяжитесь с нами». Тот же виджет, что на sex-true, silk и mdosug. Три темы:
   без класса — светлая (окно жалобы intim-box, #4926e8), .altcha-violet — тёмный вход
   intim-box (#7c3aed), .altcha-gold — тёмный prostitutki.nl (#f2cd85). */

altcha-widget.altcha-captcha {
    --ac-bg: #f5f6fa;
    --ac-border: #dfe2ec;
    --ac-text: #1b1d29;
    --ac-muted: #6b7080;
    --ac-box: #b5b9c9;
    --ac-box-bg: #ffffff;
    --ac-accent: #4926e8;
    --ac-accent-dark: #3a1dc4;
    --ac-check: #ffffff;
    --ac-focus: rgba(73, 38, 232, .18);
    --ac-ok: #15795a;
    --ac-ok-border: rgba(21, 121, 90, .5);
    --ac-error: #d93a3a;
    --ac-radius: 12px;

    --altcha-max-width: 100%;
    --altcha-border-radius: var(--ac-radius);
    --altcha-color-base: var(--ac-bg);
    --altcha-color-border: var(--ac-border);
    --altcha-color-border-focus: var(--ac-accent);
    --altcha-color-text: var(--ac-text);
    --altcha-color-error-text: var(--ac-error);

    /* Отступ снизу — как у полей формы */
    margin: 0 0 20px;
    display: block;
    width: 100%;
    font-family: inherit;
}

/* Тёмный вход и регистрация intim-box */
altcha-widget.altcha-captcha.altcha-violet {
    --ac-bg: rgba(255, 255, 255, .05);
    --ac-border: rgba(255, 255, 255, .1);
    --ac-text: #ffffff;
    --ac-muted: rgba(255, 255, 255, .55);
    --ac-box: rgba(255, 255, 255, .35);
    --ac-box-bg: transparent;
    --ac-accent: #7c3aed;
    --ac-accent-dark: #6d28d9;
    --ac-focus: rgba(124, 58, 237, .15);
    --ac-ok: #34d399;
    --ac-ok-border: rgba(52, 211, 153, .5);
    --ac-error: #f87171;
}

/* prostitutki.nl: тёмные формы с золотом */
altcha-widget.altcha-captcha.altcha-gold {
    --ac-bg: rgba(255, 255, 255, .05);
    --ac-border: rgba(242, 205, 133, .2);
    --ac-text: #ffffff;
    --ac-muted: rgba(255, 255, 255, .55);
    --ac-box: rgba(242, 205, 133, .5);
    --ac-box-bg: transparent;
    --ac-accent: #f2cd85;
    --ac-accent-dark: #d4af63;
    --ac-check: #111111;
    --ac-focus: rgba(242, 205, 133, .15);
    --ac-ok: #34d399;
    --ac-ok-border: rgba(52, 211, 153, .5);
    --ac-error: #f87171;
}

/* Пока скрипт не пришёл — место под виджет, чтобы форма не прыгала */
altcha-widget.altcha-captcha:not(:defined) {
    min-height: 50px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    background: var(--ac-bg);
    box-sizing: border-box;
}

.altcha-captcha .altcha {
    box-sizing: border-box;
    min-height: 50px;
    justify-content: center;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.altcha-captcha .altcha:focus-within {
    border-color: var(--ac-accent);
    box-shadow: 0 0 0 3px var(--ac-focus);
}

.altcha-captcha .altcha-main {
    gap: 12px;
    padding: 12px 14px;
}

/* Значок щита справа */
.altcha-captcha .altcha-main::after {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: var(--ac-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5.25 3.4 9.9 8 11 4.6-1.1 8-5.75 8-11V5l-8-3Zm-1.2 14.2-3.5-3.5 1.4-1.4 2.1 2.1 4.6-4.6 1.4 1.4-6 6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5.25 3.4 9.9 8 11 4.6-1.1 8-5.75 8-11V5l-8-3Zm-1.2 14.2-3.5-3.5 1.4-1.4 2.1 2.1 4.6-4.6 1.4 1.4-6 6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: background-color .2s ease;
}

.altcha-captcha .altcha-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ac-text);
    user-select: none;
}

/* Галочка */
.altcha-captcha .altcha-checkbox {
    width: 22px;
    height: 22px;
    color: var(--ac-accent);
}

.altcha-captcha .altcha-checkbox input {
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid var(--ac-box);
    border-radius: 4px;
    background: var(--ac-box-bg);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .15s ease;
}

.altcha-captcha .altcha-checkbox input:hover {
    border-color: var(--ac-accent);
}

.altcha-captcha .altcha-checkbox input:active {
    transform: scale(.92);
}

.altcha-captcha .altcha-checkbox input:checked {
    border-color: transparent;
    background: var(--ac-accent);
    animation: altcha-site-pop .25s ease;
}

.altcha-captcha .altcha-checkbox input:checked:hover {
    background: var(--ac-accent-dark);
}

.altcha-captcha .altcha-checkbox input:checked::after {
    content: "";
    width: 10px;
    height: 5px;
    border-left: 2px solid var(--ac-check);
    border-bottom: 2px solid var(--ac-check);
    transform: translateY(-1px) rotate(-45deg);
}

.altcha-captcha .altcha-checkbox input:focus-visible {
    outline: 2px solid var(--ac-accent);
    outline-offset: 2px;
}

.altcha-captcha .altcha-checkbox .altcha-spinner {
    color: var(--ac-accent);
}

/* Состояния */
.altcha-captcha .altcha[data-state="verified"] {
    border-color: var(--ac-ok-border);
}

.altcha-captcha .altcha[data-state="verified"] .altcha-main::after {
    background: var(--ac-ok);
}

.altcha-captcha .altcha[data-state="verifying"] .altcha-label {
    color: var(--ac-muted);
}

.altcha-captcha .altcha[data-state="error"],
.altcha-captcha .altcha[data-state="expired"] {
    border-color: var(--ac-error);
}

.altcha-captcha .altcha-error {
    padding: 0 14px 12px 48px;
    font-size: 12px;
}

@keyframes altcha-site-pop {
    0% { transform: scale(.7); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .altcha-captcha .altcha-checkbox input:checked {
        animation: none;
    }
}
