/* Visitor form system: one field, consent, security-check and button treatment for every public
   form (contact, pastoral care, ministry enquiries, newsletter, sign-in, giving, saved forms).
   Scoped to body.visitor-mode so workspace/admin forms keep their own layouts. */
body.visitor-mode{--form-accent:#025657;--form-accent-strong:#00334a;--form-ring:rgba(8,182,123,.32);--form-error:#b42318;--form-radius:12px;--form-field-height:50px}
html[data-theme=dark] body.visitor-mode{--form-accent:#7fe0bd;--form-accent-strong:#c9f5e4;--form-ring:rgba(127,224,189,.34);--form-error:#ff9b8f}

/* Fields: normal-weight values, one height and radius, a visible focus ring, gentle transitions. */
body.visitor-mode form :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range],[type=color],[type=submit],[type=button]),select,textarea){font-family:inherit;font-weight:400!important;font-size:16px;line-height:1.4;border-radius:var(--form-radius)!important;transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease}
body.visitor-mode form :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range],[type=color],[type=submit],[type=button]),select){min-height:var(--form-field-height)!important;height:auto!important;padding-block:12px}
body.visitor-mode form textarea{min-height:132px;resize:vertical}
body.visitor-mode form :is(input,select,textarea)::placeholder{font-weight:400;opacity:1}
body.visitor-mode form :is(input:not([type=checkbox],[type=radio]),select,textarea):hover:not(:disabled,:focus){border-color:color-mix(in srgb,var(--form-accent) 55%,var(--line,#dce4d8))}
body.visitor-mode form :is(input:not([type=checkbox],[type=radio]),select,textarea):focus-visible{outline:2px solid var(--form-accent)!important;outline-offset:1px;border-color:var(--form-accent)!important;box-shadow:0 0 0 5px var(--form-ring)!important}
body.visitor-mode form :is(input,select,textarea):user-invalid{border-color:var(--form-error)!important}
body.visitor-mode form :is(input,select,textarea):user-invalid:focus-visible{outline-color:var(--form-error)!important;box-shadow:0 0 0 5px color-mix(in srgb,var(--form-error) 26%,transparent)!important}

/* Consent and choice controls: brand-coloured, 22px, with a small confirmation pop when ticked. */
body.visitor-mode form :is(input[type=checkbox],input[type=radio]){accent-color:var(--form-accent);width:22px;height:22px;flex:0 0 auto;cursor:pointer}
body.visitor-mode form label:has(>:is(input[type=checkbox],input[type=radio])){cursor:pointer}
body.visitor-mode form :is(input[type=checkbox],input[type=radio]):focus-visible{outline:3px solid var(--form-accent);outline-offset:3px}

/* Links inside forms (privacy policy, data handling) were the browser's default blue. */
body.visitor-mode form a:not(.btn){color:var(--form-accent);font-weight:600;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}
body.visitor-mode form a:not(.btn):hover{color:var(--form-accent-strong);text-decoration-thickness:2.5px}
body.visitor-mode :is(.church-mega-footer,[data-newsletter-standalone]) form a:not(.btn){color:#a7f0d4}
body.visitor-mode :is(.church-mega-footer,[data-newsletter-standalone]) form a:not(.btn):hover{color:#fff}

/* Primary submit: one shape everywhere, full width on phones, a readable disabled state. */
body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta){display:inline-flex;align-items:center;justify-content:center;gap:.55em;min-height:52px;padding:14px 28px;border-radius:999px!important;font-size:15px;font-weight:600;letter-spacing:.01em;cursor:pointer;transition:transform .18s cubic-bezier(.2,.7,.3,1),box-shadow .18s ease,background-color .18s ease,color .18s ease,opacity .18s ease}
body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta):hover:not(:disabled){transform:translateY(-2px);box-shadow:0 10px 22px -12px rgba(0,51,74,.55)}
body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta):active:not(:disabled){transform:translateY(0) scale(.98);box-shadow:none}
body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta):disabled{opacity:1!important;filter:none!important;background:color-mix(in srgb,var(--form-accent) 11%,var(--surface,#fff))!important;color:color-mix(in srgb,var(--ink,#182c29) 66%,var(--surface,#fff))!important;-webkit-text-fill-color:currentColor!important;border:1px solid color-mix(in srgb,var(--form-accent) 28%,transparent)!important;cursor:not-allowed;box-shadow:none;transform:none}
body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta):disabled *{color:inherit!important;-webkit-text-fill-color:currentColor!important}
body.visitor-mode :is(.church-mega-footer,[data-newsletter-standalone]) form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta):disabled{background:rgba(255,255,255,.1)!important;color:#d7e8e2!important;border-color:rgba(255,255,255,.3)!important}
@media (max-width:600px){body.visitor-mode form button[type=submit]:is(.btn:not(.secondary,.text-link),.ministry-cta){width:100%}}

/* Busy state while a request is in flight (public/form-motion.js). */
body.visitor-mode form button[data-busy]{pointer-events:none}
body.visitor-mode form button[data-busy]::before{content:"";width:1em;height:1em;flex:0 0 auto;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:fc-form-spin .7s linear infinite}
@keyframes fc-form-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){body.visitor-mode form button[data-busy]::before{animation-duration:2.4s}}

/* reCAPTCHA: sits above the button, never clipped. Narrow forms use Google's compact widget. */
body.visitor-mode .bot-check{max-width:100%;overflow:visible!important;margin:20px 0 4px}
body.visitor-mode .bot-check>div{max-width:100%}
body.visitor-mode .bot-check-hint{display:flex;align-items:center;gap:.5em;margin:6px 0 14px;font-size:13px;line-height:1.4;color:var(--soft,#5c7066)}
body.visitor-mode .bot-check-hint::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;opacity:.55;flex:0 0 auto}
body.visitor-mode .bot-check-hint[data-state=ready]{color:var(--form-accent)}
body.visitor-mode .bot-check-hint[data-state=ready]::before{content:"✓";width:auto;height:auto;background:none;opacity:1;font-weight:700}
body.visitor-mode .bot-check-hint[data-state=error]{color:var(--form-error)}
body.visitor-mode :is(.church-mega-footer,[data-newsletter-standalone]) .bot-check-hint{color:#cfe3dc}
body.visitor-mode :is(.church-mega-footer,[data-newsletter-standalone]) .bot-check-hint[data-state=ready]{color:#a7f0d4}
@media (prefers-reduced-motion:no-preference){body.visitor-mode .bot-check-hint[data-state=ready]{animation:fc-form-confirm .42s cubic-bezier(.2,.8,.3,1.2)}}
@keyframes fc-form-confirm{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* Footer newsletter: email, consent, security check, then the button, in reading and tab order. */
.church-mega-footer .newsletter-signup form,[data-newsletter-standalone] .newsletter-signup form{display:flex;flex-direction:column;gap:12px}
.church-mega-footer .newsletter-signup .bot-check,[data-newsletter-standalone] .newsletter-signup .bot-check{margin:4px 0 0}
.church-mega-footer .newsletter-signup .bot-check-hint,[data-newsletter-standalone] .newsletter-signup .bot-check-hint{margin:0}
.footer-subscribe-actions{display:flex}
body.visitor-mode .newsletter-signup .footer-subscribe-actions button.btn{width:100%!important;flex:1 1 auto!important;min-height:50px;border-radius:999px!important}
.newsletter-signup .reading-choice{display:flex;gap:.7rem;align-items:flex-start;min-width:0}
.newsletter-signup .reading-choice>span{min-width:0;overflow-wrap:anywhere}

/* Result receipts slide in so the change is noticed. */
@media (prefers-reduced-motion:no-preference){body.visitor-mode .form-receipt:not([hidden]){animation:fc-form-confirm .38s cubic-bezier(.2,.8,.3,1)}}

/* Giving: provider unavailable is explained in words, not a truncated select option. */
.giving-unavailable{margin:-4px 0 12px;font-size:14px;color:var(--soft,#5c7066)}
/* Chrome paints an opaque backdrop behind a light-scheme frame inside a dark-scheme page. */
body.visitor-mode .bot-check,body.visitor-mode .bot-check iframe{color-scheme:light}
/* Footer sign-up: the footer is dark, so its confirmation and error messages sit on a translucent panel with light text (they were white on white). */
body.visitor-mode .church-mega-footer .form-receipt{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.32);border-inline-start-color:#9be3c6;margin:12px 0 0;padding:12px 14px;font-size:.95rem;line-height:1.5}
body.visitor-mode .church-mega-footer .form-receipt[data-error=true]{background:rgba(255,214,220,.14);border-inline-start-color:#ffb3bd}
html[data-contrast=high] body.visitor-mode .church-mega-footer .form-receipt{background:#000;color:#fff;border-color:#fff}
/* Sending a form is the agreement: a short note by the button replaces the old required checkbox. */
.form-consent-note{margin:4px 0 12px;font-size:.88rem;line-height:1.5;color:inherit;opacity:.86;max-width:62ch}
.form-consent-note a{display:inline;color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px}
body.visitor-mode .church-mega-footer .form-consent-note{color:#fff}
html[data-contrast=high] .form-consent-note{opacity:1}
