/**
 * Donation Form Block Styles
 */

.donation-form-block h3 {
	margin-top: 0;
}

.ambh-donation-form-notice {
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: 6px;
	font-size: var(--ambh-font-sm, 0.875rem);
	line-height: 1.5;
}

.ambh-donation-form-notice--test {
	background: #fff8e1;
	border: 1px solid #f0c36d;
	color: #7a4b00;
}

.ambh-consent-checkbox {
	margin: 1rem 0;
}


/* Form Groups */
.donation-form .form-group {
	margin-bottom: 20px;
}

.donation-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: var(--ambh-text-color, #1e1e1e);
	font-size: var(--ambh-font-sm, 0.875rem);
}

.donation-form input[type="text"],
.donation-form input[type="email"],
.donation-form input[type="number"],
.donation-form textarea {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid var(--ambh-border-color, #e0e0e0);
	border-radius: 6px;
	font-size: var(--ambh-font-base, 1rem);
	line-height: 1.4;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	box-sizing: border-box;
}

.donation-form input[type="text"]:focus,
.donation-form input[type="email"]:focus,
.donation-form input[type="number"]:focus,
.donation-form textarea:focus {
	outline: none;
	border-color: var(--ambh-color-primary, #3498db);
	box-shadow: 0 0 0 3px var(--ambh-color-primary-focus, rgba(52, 152, 219, 0.1));
}

.donation-form textarea {
	resize: vertical;
	min-height: 80px;
	font-family: inherit;
}

/* Predefined Amounts */
.donation-amount-section {
	margin-bottom: 25px;
}

.predefined-amounts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 12px;
	margin-top: 10px;
	margin-bottom: 15px;
}

.amount-btn {
	padding: 14px 20px;
	background: var(--ambh-bg-subtle, #f6f7f7);
	border: 2px solid var(--ambh-border-color, #e0e0e0);
	border-radius: 6px;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 600;
	color: var(--ambh-text-color, #1e1e1e);
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
}

.amount-btn:hover {
	background: var(--ambh-bg-subtle, #f6f7f7);
	border-color: var(--ambh-color-primary, #3498db);
	transform: translateY(-2px);
	box-shadow: 0 2px 8px var(--ambh-color-primary-focus, rgba(52, 152, 219, 0.2));
}

.amount-btn.active {
	background: var(--ambh-color-primary, #3498db);
	border-color: var(--ambh-color-primary, #3498db);
	color: #ffffff;
}

.amount-btn-custom {
	background: #ffffff;
	border-style: dashed;
}

.amount-btn-custom:hover {
	background: var(--ambh-bg-subtle, #f6f7f7);
}

.amount-btn-custom.active {
	background: var(--ambh-color-primary, #3498db);
	border-style: solid;
	color: #ffffff;
}

.custom-amount-field {
	margin-top: 15px;
	padding: 15px;
	background: var(--ambh-bg-subtle, #f6f7f7);
	border-radius: 6px;
	border: 2px solid var(--ambh-border-color, #e0e0e0);
}

.custom-amount-field label {
	font-size: var(--ambh-font-sm, 0.875rem);
	margin-bottom: 6px;
}

.donation-form .description {
	display: block;
	margin-top: 4px;
	font-size: var(--ambh-font-xs, 0.75rem);
	color: var(--ambh-text-muted, #646970);
}

/* Address section */
.donor-address-fields {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--ambh-border-color, #e0e0e0);
}

.ambh-form-section-label {
	margin: 0 0 14px;
	font-size: var(--ambh-font-sm, 0.875rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ambh-text-muted, #646970);
}

.ambh-address-inline {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 12px;
	align-items: start;
}

.ambh-address-inline p {
	margin: 0 0 16px;
}

/* Donate-to team member section — rendered as <p> so spacing matches other field groups */

.donation-form select.ambh-form-select,
.donation-form select.ambh-country-select {
	width: 100%;
	padding: 14px 40px 14px 16px;
	height: auto;
	border: 2px solid var(--ambh-border-color, #e0e0e0);
	border-radius: 6px;
	font-size: var(--ambh-font-base, 1rem);
	line-height: 1.4;
	/* Reset Kadence's background shorthand (which sets a full-height SVG arrow via background-image + background-size: 16px 100%) */
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23646970' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px 16px;
	-webkit-appearance: none;
	appearance: none;
	color: var(--ambh-text-color, #1e1e1e);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	box-sizing: border-box;
	cursor: pointer;
}

.donation-form select.ambh-form-select:focus,
.donation-form select.ambh-country-select:focus {
	outline: none;
	border-color: var(--ambh-color-primary, #3498db);
	box-shadow: 0 0 0 3px var(--ambh-color-primary-focus, rgba(52, 152, 219, 0.1));
}

@media (max-width: 480px) {
	.ambh-address-inline {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* Anonymous info icon + tooltip */
.anon-info-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin-left: 6px;
	color: var(--ambh-text-muted, #646970);
	font-size: var(--ambh-font-base, 1rem);
	cursor: help;
	line-height: 1;
	vertical-align: middle;
}

.anon-info-icon:focus {
	outline: 2px solid var(--ambh-color-primary, #3498db);
	border-radius: 50%;
}

.anon-info-tooltip {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: 240px;
	background: var(--ambh-text-color, #1e1e1e);
	color: #ffffff;
	font-size: var(--ambh-font-xs, 0.75rem);
	font-weight: normal;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 100;
	white-space: normal;
}

/* Arrow */
.anon-info-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--ambh-text-color, #1e1e1e);
}

.anon-info-icon:hover .anon-info-tooltip,
.anon-info-icon:focus .anon-info-tooltip {
	visibility: visible;
	opacity: 1;
}

/* Submit Button */
.donation-submit-btn {
	width: 100%;
	padding: 14px 24px;
	margin-top: 1rem;
	background: var(--ambh-color-contrast, var(--ambh-text-color, #1e1e1e));
	color: var(--ambh-color-contrast-text, #ffffff);
	border: none;
	border-radius: 6px;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 600;
	cursor: pointer;
}


.donation-submit-btn:disabled {
	background: var(--ambh-text-muted, #646970);
	cursor: not-allowed;
	transform: none;
}

/* Form Messages */
.form-message {
	padding: 15px;
	margin-bottom: 20px;
	border-radius: 6px;
	font-size: var(--ambh-font-sm, 0.875rem);
}

.form-message.form-message-success {
	background: color-mix(in srgb, var(--ambh-color-secondary) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--ambh-color-secondary) 40%, transparent);
	color: color-mix(in srgb, var(--ambh-color-secondary) 80%, #000);
}

.form-message.form-message-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

/* Form Note */
.form-note {
	margin-top: 15px;
	text-align: center;
	color: var(--ambh-text-muted, #646970);
}

.form-note small {
	font-size: var(--ambh-font-xs, 0.75rem);
}

/* =========================================================
   Two-step form — progressive enhancement
   Steps are only hidden when JS adds .ambh-steps-enabled,
   so the form remains fully usable without JavaScript.
   ========================================================= */

.ambh-step-indicator {
	display: none; /* shown by JS */
	gap: 8px;
	justify-content: center;
	margin-bottom: 24px;
}

.ambh-step-pip {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ambh-border-color, #e0e0e0);
	transition: background 0.25s ease, transform 0.25s ease;
}

.ambh-step-pip--active {
	background: var(--ambh-color-primary, #3498db);
	transform: scale(1.35);
}

/* Next button — hidden until JS enables steps */
.ambh-btn-next {
	display: none;
	width: 100%;
	padding: 14px 24px;
	margin-top: 1rem;
}

/* Step panels — only hidden when JS is active */
.donation-form.ambh-steps-enabled .ambh-form-step {
	display: none;
}

.donation-form.ambh-steps-enabled .ambh-form-step--active {
	display: block;
	animation: ambh-slide-in-right 0.22s ease;
}

.donation-form.ambh-steps-enabled.ambh-going-back .ambh-form-step--active {
	animation: ambh-slide-in-left 0.22s ease;
}

@keyframes ambh-slide-in-right {
	from { opacity: 0; transform: translateX(20px); }
	to   { opacity: 1; transform: translateX(0); }
}

@keyframes ambh-slide-in-left {
	from { opacity: 0; transform: translateX(-20px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* Show step UI only when JS is active */
.donation-form.ambh-steps-enabled .ambh-step-indicator {
	display: flex;
}

.donation-form.ambh-steps-enabled .ambh-btn-next {
	display: block;
}

/* Step 2 bottom nav: Back + Submit side by side */
.ambh-form-nav {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 1rem;
}

.ambh-btn-back {
	display: none; /* shown by JS */
	flex-shrink: 0;
	padding: 14px 18px;
	background: transparent;
	border: 2px solid var(--ambh-border-color, #e0e0e0);
	border-radius: 6px;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 600;
	color: var(--ambh-text-muted, #646970);
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease;
	line-height: 1;
}

.ambh-btn-back:hover {
	border-color: var(--ambh-color-primary, #3498db);
	color: var(--ambh-color-primary, #3498db);
}

.donation-form.ambh-steps-enabled .ambh-btn-back {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ambh-form-nav .donation-submit-btn {
	flex: 1;
	margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.donation-form input[type="text"],
	.donation-form input[type="email"],
	.donation-form input[type="number"],
	.donation-form textarea {
		font-size: var(--ambh-font-sm, 0.875rem);
		padding: 12px 14px;
	}
	
	.donation-submit-btn {
		font-size: var(--ambh-font-base, 1rem);
		padding: 12px 20px;
	}
}
