
/* ========================================
   SForm - Form Validation
======================================== */

form[sform] input.sform-unchecked,
form[sform] textarea.sform-unchecked,
form[sform] select.sform-unchecked {
    border: 1px solid #e8a5a5 !important;
    transition: border-color 0.2s ease;
}

form[sform] input.sform-invalid,
form[sform] textarea.sform-invalid,
form[sform] select.sform-invalid {
    border: 1px solid #e5c66b !important;
    transition: border-color 0.2s ease;
}

form[sform] input.sform-valid,
form[sform] textarea.sform-valid,
form[sform] select.sform-valid {
    border: 1px solid #8fcba0 !important;
    transition: border-color 0.2s ease;
}

/* Focus states */

form[sform] input.sform-unchecked:focus,
form[sform] textarea.sform-unchecked:focus,
form[sform] select.sform-unchecked:focus {
    border-color: #d98e8e !important;
    outline-color: #d98e8e;
}

form[sform] input.sform-invalid:focus,
form[sform] textarea.sform-invalid:focus,
form[sform] select.sform-invalid:focus {
    border-color: #d4ad45 !important;
    outline-color: #d4ad45;
}

form[sform] input.sform-valid:focus,
form[sform] textarea.sform-valid:focus,
form[sform] select.sform-valid:focus {
    border-color: #70b888 !important;
    outline-color: #70b888;
}

/* Exclude non-text controls from validation borders */

form[sform] input[type="checkbox"],
form[sform] input[type="radio"],
form[sform] input[type="hidden"] {
    border-color: inherit;
}

/* Submit loading state */

form[sform] [sform-send][data-sform-busy="true"] {
    cursor: wait;
    pointer-events: none;
    opacity: 0.65;
}

form[sform][aria-busy="true"] {
    cursor: progress;
}


/* ========================================
   captcha Container
======================================== */

.captchabox {
    display: inline-block;
    box-sizing: border-box;
    width: 100%;
    padding: 1em;
    background: #F9F9F9;
    border: 1px solid #d7d7d7;
    box-shadow: 0 0 6px #a5a5a5;
}

.captchabox *,
.captchabox *::before,
.captchabox *::after {
    box-sizing: border-box;
    user-select: none !important;
}

.captchabox::after {
    content: "";
    display: block;
    clear: both;
}
div[captcha] .text,
div[captcha] .text:hover,
div[captcha] .text:focus,
div[captcha] .text:focus-visible,
div[captcha] .text:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ========================================
   Brand / Logo
======================================== */

.captchabox .captcha-brand {
    float: right;
    margin-left: 4em;
    margin-top: 5px;
    text-align: center;
}

.captchabox .captcha-logo {
    display: block;
    width: 100%;
}

.captchabox .captcha-logo img {
    display: inline-block;
    margin: 0 30px;
    max-height: 25px;
    max-width: 96px;
}

.captchabox .captcha-credit {
    display: block;
    font-size: 12px;
    text-align: center;
    margin: 5px;
}

.captchabox .captcha-credit small {
    text-align: center;
}

.captchabox .captcha-credit a {
    font-weight: bold;
    text-decoration: none;
}


/* ========================================
   Clickable Area
======================================== */

.captchabox .text {
    float: left;
    display: flex;
    align-items: center;
    gap: 1em;
    margin-left: 1em;
    padding: 9px 0;
    font-size: 15px;
    cursor: pointer;
    vertical-align: middle;
}

.captchabox .text[aria-disabled="true"] {
    cursor: wait;
    pointer-events: none;
}

.captchabox .captcha-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    vertical-align: middle;
}

.captchabox .captcha-status {
    padding: 1em;
    font-size: 13px;
}


/* ========================================
   Circle Loader
======================================== */

.captchabox .circle-loader {
    position: relative;
    display: inline-block;
    width: 2.3em;
    height: 2.3em;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-left-color: #5cb85c;
    border-radius: 50%;
}

.captchabox:hover .circle-loader:not(.load-complete) {
    animation: captcha-loader-spin 1.2s infinite linear;
}

.captchabox .circle-loader.load-complete {
    animation: none;
    border-color: #5cb85c;
    transition: border 500ms ease-out;
}


/* ========================================
   Checkmark
======================================== */

.captchabox .checkmark {
    display: none;
}

.captchabox .checkmark.draw::after {
    animation: captcha-checkmark 800ms ease;
    transform: scaleX(-1) rotate(135deg);
}

.captchabox .checkmark::after {
    position: absolute;
    top: 18px;
    left: 4px;
    width: 0.75em;
    height: 1.5em;
    border-right: 3px solid #5cb85c;
    border-top: 3px solid #5cb85c;
    transform-origin: left top;
    opacity: 1;
    content: "";
}


/* ========================================
   Animations
======================================== */

@keyframes captcha-loader-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes captcha-checkmark {
    0% {
        height: 0;
        width: 0;
        opacity: 1;
    }

    20% {
        height: 0;
        width: 0.75em;
        opacity: 1;
    }

    40% {
        height: 0.5em;
        width: 0.75em;
        opacity: 1;
    }

    100% {
        height: 1.5em;
        width: 0.75em;
        opacity: 1;
    }
}


/* ========================================
   Responsive
======================================== */

@media (max-width: 420px) {

    .captchabox {
        padding: 10px;
    }

    .captchabox .captcha-brand {
        margin-left: 0.5em;
    }

    .captchabox .captcha-logo img {
        margin: 0 10px;
    }

    .captchabox .text {
        margin-left: 0;
        gap: 8px;
    }

    .captchabox .captcha-status {
        padding: 8px;
        font-size: 12px;
    }
}
