.altcha-field {
    margin-top: 20px;
    margin-bottom: 35px;
}

.altcha-field .help-block {
    margin-top: 8px;
    padding-bottom: 0;
}

altcha-widget {
    display: block;
    min-height: 70px;
}

altcha-widget input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    margin: 0 !important;
    padding: 0;
}

altcha-widget label {
    margin: 0;
    font-family: inherit;
    font-size: 14px;
}

/* Login only: undo Bootstrap's text-input styling on the widget host. */
.form-group.field-loginform-altcha {
    margin-top: 0;
    margin-bottom: 24px;
}

.field-loginform-altcha .help-block {
    margin: 8px 0 0;
    padding: 0;
    color: #a51d1b;
    font-size: 15px;
    line-height: 1.4;
}

.field-loginform-altcha .help-block:empty {
    display: none;
}

#loginform-altcha-widget,
#loginform-altcha-widget *,
#loginform-altcha-widget *::before,
#loginform-altcha-widget *::after {
    box-sizing: border-box;
}

#loginform-altcha-widget {
    --altcha-max-width: 100%;
    --altcha-border-radius: 6px;
    --altcha-color-base: #fff3ec;
    --altcha-color-border: #bc9284;
    --altcha-color-border-focus: #b51a18;
    --altcha-color-text: #50392f;
    --altcha-color-error-text: #a51d1b;
    height: auto;
    min-height: 62px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-family: 'Linux Libertine', Times, serif;
    font-size: 16px;
    line-height: 1.4;
}

#loginform-altcha-widget .altcha {
    width: 100%;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#loginform-altcha-widget .altcha:focus-within {
    box-shadow: 0 0 0 3px rgba(181, 26, 24, 0.12);
}

#loginform-altcha-widget .altcha-main {
    min-height: 60px;
    gap: 12px;
    padding: 16px 18px;
}

#loginform-altcha-widget .altcha-label {
    min-width: 0;
    font-family: inherit;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    overflow-wrap: break-word;
}

#loginform-altcha-widget .altcha-checkbox {
    flex: 0 0 24px;
}

#loginform-altcha-widget .altcha-checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px !important;
    height: 22px;
    padding: 0;
    border: 1.5px solid #9c6c5c !important;
    border-radius: 4px !important;
    background: #fffaf5 !important;
    cursor: pointer;
}

#loginform-altcha-widget .altcha-checkbox input:checked {
    border-color: #5b704e !important;
    background: #5b704e !important;
}

#loginform-altcha-widget .altcha[data-state="verified"] {
    --altcha-color-base: #f3f4ea;
    --altcha-color-border: #94a184;
    --altcha-color-text: #405437;
}

#loginform-altcha-widget .altcha[data-state="verified"] .altcha-checkbox::after {
    position: absolute;
    top: 5px;
    left: 9px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: '';
    transform: rotate(45deg);
    pointer-events: none;
}

#loginform-altcha-widget .altcha[data-state="verifying"] .altcha-checkbox {
    color: #b51a18;
}

#loginform-altcha-widget .altcha[data-state="error"],
#loginform-altcha-widget .altcha[data-state="expired"],
.field-loginform-altcha.has-error #loginform-altcha-widget .altcha {
    border-color: #a51d1b;
}

#loginform-altcha-widget .altcha-error {
    gap: 8px;
    padding: 0 18px 14px;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#loginform-altcha-widget .altcha-error svg {
    flex-shrink: 0;
    margin-top: 2px;
}

#loginform-altcha-widget .altcha-checkbox input:focus-visible {
    outline: 2px solid #b51a18 !important;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    #loginform-altcha-widget .altcha-main {
        padding-right: 14px;
        padding-left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #loginform-altcha-widget .altcha {
        transition: none;
    }

    #loginform-altcha-widget .altcha-spinner {
        animation: none;
    }
}
