/*
 * Shared layout for ServeWay request forms and Contact Form 7 forms on the same site.
 * Labels sit above full-width fields. The send button matches the church request forms.
 */

form.serveway-request > p {
    margin: 0 0 0.35em;
}

form.serveway-request input[type="text"],
form.serveway-request input[type="email"],
form.serveway-request input[type="tel"],
form.serveway-request input[type="url"],
form.serveway-request input[type="date"],
form.serveway-request input[type="time"],
form.serveway-request input[type="number"],
form.serveway-request textarea,
form.serveway-request select,
form.serveway-request .wpcf7-form-control.wpcf7-text,
form.serveway-request .wpcf7-form-control.wpcf7-email,
form.serveway-request .wpcf7-form-control.wpcf7-tel,
form.serveway-request .wpcf7-form-control.wpcf7-number,
form.serveway-request .wpcf7-form-control.wpcf7-date,
form.serveway-request .wpcf7-form-control.wpcf7-textarea,
form.serveway-request .wpcf7-form-control.wpcf7-select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.4;
    padding: 12px 16px;
    border: 2px solid #eaeaea;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.85);
    color: #000000;
}

/*
 * A light box with a dark border stays visible on the church's dark pages and on a light page.
 * accent-color tints a native control. The drawn mark is the fallback when the theme paints a dark box.
 */
form.serveway-request input[type="checkbox"],
form.serveway-request input[type="radio"],
form.serveway-request .wpcf7-list-item input[type="checkbox"],
form.serveway-request .wpcf7-list-item input[type="radio"],
.serveway-member input[type="checkbox"],
.serveway-member input[type="radio"],
.serveway-events input[type="checkbox"],
.serveway-events input[type="radio"],
.serveway-groups input[type="checkbox"],
.serveway-groups input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    box-sizing: border-box;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    margin: 0 0.45em 0 0;
    padding: 0 !important;
    vertical-align: -0.25em;
    border: 2px solid #3d3d3d !important;
    border-radius: 3px;
    background-color: #ffffff !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    color-scheme: light;
    accent-color: #111111;
    cursor: pointer;
}

form.serveway-request input[type="radio"],
form.serveway-request .wpcf7-list-item input[type="radio"],
.serveway-member input[type="radio"],
.serveway-events input[type="radio"],
.serveway-groups input[type="radio"] {
    border-radius: 50%;
}

form.serveway-request input[type="checkbox"]:checked,
form.serveway-request .wpcf7-list-item input[type="checkbox"]:checked,
.serveway-member input[type="checkbox"]:checked,
.serveway-events input[type="checkbox"]:checked,
.serveway-groups input[type="checkbox"]:checked {
    background-color: #111111 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 1px #111111;
    accent-color: #111111;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3 8.2 L6.4 11.6 L13 4.4'/%3E%3C/svg%3E") !important;
}

form.serveway-request input[type="radio"]:checked,
form.serveway-request .wpcf7-list-item input[type="radio"]:checked,
.serveway-member input[type="radio"]:checked,
.serveway-events input[type="radio"]:checked,
.serveway-groups input[type="radio"]:checked {
    background-color: #ffffff !important;
    border-color: #111111 !important;
    accent-color: #111111;
    background-image: radial-gradient(circle, #111111 0 42%, transparent 46%) !important;
}

form.serveway-request input[type="checkbox"]:focus-visible,
form.serveway-request input[type="radio"]:focus-visible,
form.serveway-request .wpcf7-list-item input[type="checkbox"]:focus-visible,
form.serveway-request .wpcf7-list-item input[type="radio"]:focus-visible,
.serveway-member input[type="checkbox"]:focus-visible,
.serveway-member input[type="radio"]:focus-visible,
.serveway-events input[type="checkbox"]:focus-visible,
.serveway-events input[type="radio"]:focus-visible,
.serveway-groups input[type="checkbox"]:focus-visible,
.serveway-groups input[type="radio"]:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

form.serveway-request .wpcf7-list-item,
form.serveway-request .serveway-request-inline label {
    display: inline-block;
    margin: 0 1em 0 0;
}

form.serveway-request .serveway-request-choices label {
    display: block;
    margin: 0.35em 0;
}

form.serveway-request input[type="submit"],
form.serveway-request button[type="submit"],
form.serveway-request .wpcf7-submit {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    font-size: 16px;
    font-weight: 700 !important;
    line-height: 1.4;
    padding: 12px 16px;
    border: 1px solid #ffffff;
    border-radius: 3px;
    background-color: #000000 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    cursor: pointer;
}

form.serveway-request input[type="submit"]:hover,
form.serveway-request input[type="submit"]:focus,
form.serveway-request button[type="submit"]:hover,
form.serveway-request button[type="submit"]:focus,
form.serveway-request .wpcf7-submit:hover,
form.serveway-request .wpcf7-submit:focus {
    background-color: #a9b4c2 !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    font-weight: 700 !important;
}

/*
 * The visitor card's green Send button is also a request submit.
 * These selectors are more specific than the black rule above and than a theme's button color.
 * White on #166534 is 7.13:1. White on the hover green #14532d is 9.11:1.
 */
form.serveway-visitor.serveway-request button.serveway-capsule.serveway-capsule-save[type="submit"] {
    background-color: #166534 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    border-color: #14532d !important;
}

form.serveway-visitor.serveway-request button.serveway-capsule.serveway-capsule-save[type="submit"]:hover,
form.serveway-visitor.serveway-request button.serveway-capsule.serveway-capsule-save[type="submit"]:focus,
form.serveway-visitor.serveway-request button.serveway-capsule.serveway-capsule-save[type="submit"]:focus-visible {
    background-color: #14532d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    border-color: #052e16 !important;
}

/*
 * The blank field is for automated posts. Keep the paragraph, the label, and the
 * input off the screen. Later field rules must not pull the input back into the form.
 */
form.serveway-request p.serveway-request-trap,
form.serveway-request p.serveway-request-trap label,
form.serveway-request p.serveway-request-trap input[type="text"] {
    position: absolute !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 1px !important;
    max-height: 1px !important;
    line-height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    background: transparent !important;
}

/*
 * Cloudflare draws the check inside an iframe. A theme rule of height:auto collapses that iframe to nothing.
 */
.serveway-turnstile {
    display: block;
    clear: both;
    min-height: 65px;
    margin: 0.75em 0 1em;
    overflow: visible;
}

.serveway-turnstile iframe {
    display: block;
    width: 300px !important;
    height: 65px !important;
    min-height: 65px !important;
    max-height: none !important;
}

/*
 * Number fields in every ServeWay shortcode (class count, worship count, canvass, polls, giving, and the rest).
 * Wide enough that the spinner arrows never cover the digits, with dark text on a white field
 * so the numbers stay readable on a dark theme.
 */
form.serveway-request input[type="number"],
[class^="serveway"] input[type="number"],
[class*=" serveway"] input[type="number"] {
    display: inline-block !important;
    box-sizing: border-box !important;
    width: 8em !important;
    min-width: 8em !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 2.4em !important;
    padding: 0.4em 0.6em !important;
    font-size: 1.1em !important;
    line-height: 1.3 !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    background: #ffffff !important;
    border: 2px solid #555555 !important;
    border-radius: 4px !important;
    opacity: 1 !important;
}

[class^="serveway"] input[type="number"]:focus,
[class*=" serveway"] input[type="number"]:focus,
form.serveway-request input[type="number"]:focus {
    outline: 2px solid #1d4ed8 !important;
    outline-offset: 1px;
}

/*
 * The public visitor card sits on a white card with dark text so it stays readable on a dark page.
 * The OK switches are capsules. Their checkbox is hidden; the track shows On or Off.
 */
form.serveway-visitor {
    background: #ffffff;
    color: #111111;
    padding: 1rem 1.15rem 0.4rem;
    border-radius: 12px;
    max-width: 640px;
}

form.serveway-visitor p,
form.serveway-visitor label {
    color: #111111;
    -webkit-text-fill-color: #111111;
}

form.serveway-visitor input[type="text"],
form.serveway-visitor input[type="email"],
form.serveway-visitor input[type="tel"],
form.serveway-visitor textarea {
    background: #ffffff !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    border: 2px solid #334155 !important;
}

form.serveway-visitor label.serveway-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    margin: 0.35rem 0;
    cursor: pointer;
}

form.serveway-visitor label.serveway-toggle input {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 1px !important;
    max-height: 1px !important;
    margin: 0 !important;
    border: 0 !important;
}

form.serveway-visitor .serveway-toggle-ui {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 4.7rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 2px solid #d7dde6;
    background: #3a3f46;
    color: #ffffff;
    box-sizing: border-box;
}

form.serveway-visitor .serveway-toggle-on,
form.serveway-visitor .serveway-toggle-off {
    position: absolute;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

form.serveway-visitor .serveway-toggle-on {
    left: 0.42rem;
    display: none;
}

form.serveway-visitor .serveway-toggle-off {
    right: 0.38rem;
}

form.serveway-visitor .serveway-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #f2f2f2;
}

form.serveway-visitor label.serveway-toggle input:checked + .serveway-toggle-ui {
    background: #1d4ed8;
}

form.serveway-visitor label.serveway-toggle input:checked + .serveway-toggle-ui .serveway-toggle-on {
    display: inline;
}

form.serveway-visitor label.serveway-toggle input:checked + .serveway-toggle-ui .serveway-toggle-off {
    display: none;
}

form.serveway-visitor label.serveway-toggle input:checked + .serveway-toggle-ui .serveway-toggle-knob {
    left: calc(100% - 1.5rem);
    background: #ffffff;
}

form.serveway-visitor label.serveway-toggle input:focus-visible + .serveway-toggle-ui {
    outline: 3px solid #0f2346;
    outline-offset: 2px;
}

form.serveway-visitor .serveway-toggle-label {
    color: #111111;
    -webkit-text-fill-color: #111111;
    font-weight: 700;
}

form.serveway-visitor label.serveway-capsule.serveway-capsule-info {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    background: #facc15 !important;
    font-weight: 700 !important;
}

section.sw-class-suggest form button.serveway-capsule.serveway-capsule-view[type="submit"] {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    border-color: #1e3a8a !important;
}

section.sw-class-suggest form button.serveway-capsule.serveway-capsule-view[type="submit"]:hover,
section.sw-class-suggest form button.serveway-capsule.serveway-capsule-view[type="submit"]:focus,
section.sw-class-suggest form button.serveway-capsule.serveway-capsule-view[type="submit"]:focus-visible {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

.serveway-giving form button[type="submit"],
.serveway-giving-drives form button[type="submit"][value="save"] {
    background-color: #166534 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid #14532d !important;
    border-radius: 999px !important;
}

.serveway-giving form button[type="submit"]:hover,
.serveway-giving form button[type="submit"]:focus,
.serveway-giving-drives form button[type="submit"][value="save"]:hover,
.serveway-giving-drives form button[type="submit"][value="save"]:focus {
    background-color: #14532d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

.serveway-giving-drives form button[type="submit"][value="cancel"] {
    background-color: #ffffff !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    font-weight: 700 !important;
    border: 2px solid #111111 !important;
    border-radius: 999px !important;
}

.serveway-giving-drives form button[type="submit"][value="cancel"]:hover,
.serveway-giving-drives form button[type="submit"][value="cancel"]:focus {
    background-color: #111111 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

p.serveway-visitor-notice,
p.serveway-visitor-note {
    color: #111111;
    -webkit-text-fill-color: #111111;
}
