/*
 * BAIL & JAIL Fundraising — payment form styles.
 * Scoped under .bjf-payment-form-wrap / .bjf-payment-status. Deliberately
 * does NOT restyle <input>/<textarea>/<select>/<label> — most current
 * block themes (including this site's) already style form fields and
 * labels globally, and re-declaring color/border/radius/padding here would
 * only fight that. This file handles layout, spacing, and the handful of
 * donation-specific elements (the card wrapper, section titles, status
 * messages) that no theme provides out of the box. Where a value should
 * follow the active theme, it reads the theme's own CSS custom properties
 * with a plain fallback, so the design still holds up on a theme that
 * doesn't define them.
 */

.bjf-payment-form-wrap {
	max-width: 1120px;
	margin-top: 50px;
	padding: 0px;
	background-color: transparent;
	border: 1px solid #d8d8d8;
	border-radius: 20px;
}

.bjf-payment-form-wrap h2 {
	margin: 0;
	/* margin-bottom: 30px; */
	padding: 50px;
	font-size: 60px;
	text-align: center;
}

.bjf-form-section-title {
	font-size: 20px;
	color: #023991;
	background: #0239910a;
	margin-bottom: 0px;
	text-align: center;
	padding: 10px;
	margin: 0px;
}

.bjf-form-section-title:first-of-type {
	margin-top: 0;
}

.bjf-currency-note {
	margin: 0 0 var(--wp--preset--spacing--20, 1em);
	font-size: var(--wp--preset--font-size--small, 0.85em);
	font-style: italic;
	opacity: 0.75;
}

.bjf-payment-form .bjf-field {
	margin-bottom: 25px;
}

/* Currency radio group (KYD / USD), styled as pill buttons — same pattern
   as the Online Donations plugin's form. The native radio stays in the DOM
   (visually hidden, still focusable) so keyboard/screen-reader use works. */
.bjf-field-label {
	display: block;
	margin-bottom: 0.6em;
	font-weight: 600;
}

.bjf-currency-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
}

.bjf-currency-option {
	position: relative;
}

.bjf-currency-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.bjf-currency-option label {
	display: inline-block;
	margin: 0;
	padding: 0.6em 1.25em;
	background-color: var(--wp--custom--input-background, #fff);
	border: 2px solid #d8d8d8;
	border-radius: 8px;
	color: currentColor;
	font-size: 1.05em;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bjf-currency-option label:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--primary, #023991) 10%, transparent);
}

.bjf-currency-option input:checked + label {
	background-color: var(--wp--preset--color--primary, #023991);
	border-color: var(--wp--preset--color--primary, #023991);
	color: #fff;
}

.bjf-currency-option input:focus-visible + label {
	outline: 2px solid var(--wp--preset--color--primary, #023991);
	outline-offset: 2px;
}

.bjf-convenience-charge-summary:not([hidden]) {
	display: block;
	margin: -10px 0 25px;
	padding: 12px 16px;
	border: 1px solid #0239911f;
	border-radius: 10px;
	background: #0239910a;
}

.bjf-convenience-charge-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	font-size: var(--wp--preset--font-size--small, 0.9em);
}

.bjf-convenience-charge-row + .bjf-convenience-charge-row {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #0239911f;
}

.bjf-convenience-charge-total-row {
	color: #023991;
	font-size: 1em;
}

.bjf-payment-form .bjf-field-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 var(--wp--preset--spacing--20, 1em);
}

.bjf-payment-form .bjf-field-group-card-meta {
	grid-template-columns: repeat(3, 1fr);
}

/* Currency + Amount on one line: the currency pills take only the width
   they need, Amount fills the rest; bottoms aligned so the pills sit level
   with the Amount input. Stacks to one column under 576px (see below). */
.bjf-payment-form .bjf-field-group-donation {
	grid-template-columns: auto 1fr;
	align-items: end;
}

/*
 * Amount input with a filled currency "prefix chip" (KYD / USD) on its left
 * edge — same pattern as the Online Donations plugin. The chip sits inside
 * the input's border and covers its left padding, so it never overlaps the
 * placeholder or typed value even if a theme's own input padding differs.
 */
.bjf-amount-input-wrap {
	position: relative;
}

.bjf-amount-input-currency {
	position: absolute;
	top: 1px;
	bottom: 1px;
	left: 1px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 3.5em;
	padding: 0 0.75em;
	background-color: var(--wp--preset--color--theme-2, #f2f2f2);
	border-right: 1px solid #d8d8d8;
	border-radius: 5px 0 0 5px;
	font-size: 0.85em;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: currentColor;
	pointer-events: none;
}

.bjf-payment-form .bjf-amount-input-wrap input {
	width: 100%;
	box-sizing: border-box;
	padding-left: 4.75em !important;
}

.bjf-required {
	color: var(--wp--preset--color--vivid-red, #cc1818);
}

/*
 * Honeypot field — moved off-screen rather than display:none/visibility:
 * hidden, since simple bots specifically check for and skip those.
 */
.bjf-hp-field {
	position: absolute;
	left: -9999px;
	top: -9999px;
	height: 0;
	width: 0;
	overflow: hidden;
}

/*
 * Card type badges. Plain text stand-ins for real card-brand logos — see
 * the comment in payment-form.php next to this markup. Positioned inside
 * the Card Number field's own box (right-aligned) rather than pushing the
 * field width around as it appears/disappears.
 */
.bjf-card-number-wrap {
	position: relative;
}

.bjf-card-number-wrap input {
	padding-right: 4.5em;
}

.bjf-card-type-icon {
	position: absolute;
	top: 50%;
	right: 0.75em;
	transform: translateY(-50%);
	pointer-events: none;
}

.bjf-card-icon {
	display: inline-block;
	padding: 0.15em 0.5em;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	white-space: nowrap;
}

.bjf-card-icon-visa {
	background-color: #1a1f71;
}

.bjf-card-icon-mastercard {
	background-color: #eb001b;
}

.bjf-card-icon-amex {
	background-color: #2e77bc;
}

.bjf-card-icon-discover {
	background-color: #ff6000;
}

/*
 * Select pickers (Expiry Month/Year). The theme's own global field styling
 * only targets <input>/<textarea> — <select> is left completely unstyled by
 * default, which is why it looked out of place next to the other fields.
 * This matches the same visual language (background/border/radius/sizing)
 * the theme already uses for its inputs, then adds a custom dropdown arrow
 * drawn with a bordered pseudo-element so its color always tracks
 * `currentColor` — no separate light/dark arrow asset needed.
 */
.bjf-select {
	position: relative;
	display: block;
}

.bjf-payment-form .bjf-select select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: 100%;
	box-sizing: border-box;
	background-color: var(--wp--custom--input-background, var(--wp--preset--color--theme-1, #fff));
	border: 1px solid currentColor;
	border-radius: 6px;
	box-shadow: none;
	color: currentColor;
	cursor: pointer;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	font-weight: inherit;
	line-height: 1.5;
	min-height: 42px;
	padding: 0.8rem 2.25rem 0.8rem 1rem;
}

.bjf-select::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 1rem;
	width: 0;
	height: 0;
	margin-top: -3px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	pointer-events: none;
}

.bjf-payment-form .bjf-select select:focus {
	outline: 1px solid currentColor;
}

.bjf-payment-form .bjf-select select:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.bjf-payment-form input.bjf-invalid,
.bjf-payment-form select.bjf-invalid,
.bjf-payment-form textarea.bjf-invalid {
	border-color: var(--wp--preset--color--vivid-red, #cc1818);
}

.bjf-field-error {
	margin-top: 0.35em;
	color: var(--wp--preset--color--vivid-red, #cc1818);
	font-size: var(--wp--preset--font-size--small, 0.85em);
}

.bjf-payment-form-messages {
	margin-bottom: var(--wp--preset--spacing--20, 1em);
	padding: 0.75em 1em;
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--small, 0.9em);
}

.bjf-payment-form-messages.bjf-message-error {
	background-color: color-mix(in srgb, var(--wp--preset--color--vivid-red, #cc1818) 12%, transparent);
	color: var(--wp--preset--color--vivid-red, #cc1818);
}

.bjf-payment-form-messages.bjf-message-success {
	background-color: color-mix(in srgb, #2e7d32 12%, transparent);
	color: #2e7d32;
}

/*
 * reCAPTCHA (left) and the Submit button (right) share one row, both
 * anchored to the same vertical center. `margin-left: auto` on the submit
 * field pushes it to the row's right edge whether or not reCAPTCHA is
 * present alongside it.
 */
.bjf-form-footer {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20, 1em);
	margin-top: var(--wp--preset--spacing--30, 1.5em);
}

.bjf-field-recaptcha {
	max-width: 100%;
	overflow-x: auto;
}

.bjf-field-recaptcha .g-recaptcha {
	display: inline-block;
}

.bjf-field-submit {
	margin-left: auto;
}

.bjf-submit-button {
	width: auto;
	text-align: center;
	cursor: pointer;
}

.bjf-submit-button[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Payment status pages */

.bjf-payment-status {
	max-width: 640px;
	margin: var(--wp--preset--spacing--40, 2em) auto;
	padding: var(--wp--preset--spacing--40, 2em);
	text-align: center;
	border-radius: 8px;
}

.bjf-payment-status-success {
	background-color: color-mix(in srgb, #2e7d32 10%, transparent);
}

.bjf-payment-status-failed {
	background-color: color-mix(in srgb, var(--wp--preset--color--vivid-red, #cc1818) 10%, transparent);
}

.bjf-payment-status-pending,
.bjf-payment-status-unknown {
	background-color: var(--wp--preset--color--theme-2, #f2f2f2);
}

.bjf-payment-summary {
	max-width: 360px;
	margin: var(--wp--preset--spacing--20, 1em) auto;
	text-align: left;
}

.bjf-payment-summary dt {
	font-weight: 600;
}

.bjf-payment-summary dd {
	margin: 0 0 0.75em;
}

.bjf-payment-form-wrap input, .fundraising-single-wrap textarea, .fundraising-single-wrap select{
	border: 1px solid #d8d8d8 !important;
}

.form-inner-wrapper{
	padding: 50px 50px 25px 50px;
}

@media(max-width: 1399px) {
	.bjf-payment-form-wrap h2{
		font-size: 55px;
		padding: 40px;
	}
	.form-inner-wrapper{
		padding: 40px 40px 15px 40px;
	}
}
@media(max-width: 1199px) {
	.bjf-payment-form-wrap h2{
		font-size: 50px;
	}
}

@media(max-width: 991px) {
	.bjf-payment-form-wrap h2{
		font-size: 45px;
		padding: 30px;
	}
	.form-inner-wrapper{
		padding: 30px 30px 5px 30px;
	}
}

@media(max-width: 767px) {
	.bjf-payment-form-wrap h2{
		font-size: 35px;
	}
	.bjf-form-footer{
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
	}
	.bjf-field-submit{
		margin-left: unset;
	}
}

@media(max-width: 575px) {
	.bjf-payment-form-wrap h2{
		font-size: 26px;
	}
	.bjf-payment-form .bjf-field-group{
		grid-template-columns: 1fr;
	}
	.bjf-payment-form-wrap .g-recaptcha{
		transform-origin: 0;
		transform: scale(.95);
	}
	.bjf-payment-form-wrap .bjf-field-recaptcha{
		overflow: unset;
	}
}
@media(max-width: 420px) {
	.bjf-payment-form-wrap .g-recaptcha{
		transform-origin: 0;
    	transform: scale(.87);
	}
	.bjf-payment-form-wrap .bjf-field-recaptcha{
		overflow: unset;
	}
	.bjf-payment-form-wrap h2{
		padding: 25px;
	}
	.form-inner-wrapper{
		padding: 25px 25px 0px 25px;
	}
}
@media(max-width: 360px) {
	.bjf-payment-form-wrap .g-recaptcha{
		transform-origin: 0;
		transform: scale(.5);
	}
}

.bjf-payment-status-success h1 {font-size: 60px;margin-bottom: 0;}
 
.bjf-payment-status-success p {
    font-size: 28px;
    font-weight: 700;
}
 
.bjf-payment-status-success p a {
    font-size: 16px;
    text-decoration: none;
}