/**
 * Plugin Name: Albatros - Donations (Peach Payments)
 * Description: Frontend donation form with Cause selector, Peach Payments session + webhook, donor confirmation email, and admin reporting.
 * Version: 1.0.0
 * Author: Digital Fold
 * License: GPL-2.0+
 * Requires PHP: 7.4
 * Text Domain: albatros-donations
 */

/* 
   Albatros Donations — Frontend styles
   - Fully scoped under .alba-donate-wrap to avoid theme collisions
   - Uses CSS variables for easy theming; override in theme if needed
*/

.alba-donate-wrap {
	--alba-bg: #fff;
	--alba-surface: #ffffff;
	--alba-text: #0f172a;          /* slate-900 */
	--alba-muted: #64748b;         /* slate-500 */
	--alba-border: #bae0e9;        /* matches provided reference */
	--alba-border-dark: #8cc6d6;
	--alba-radius: 4px;            /* matches provided reference */
	--alba-gap: 16px;
	--alba-control-h: 60px;        /* matches provided reference */
	--alba-primary: #111111;
	--alba-primary-text: #ffffff;
	--alba-focus-ring: rgba(186,224,233,0.65);

	max-width: 720px;
	margin: 0 auto;
	padding: 16px;
	background: var(--alba-surface);
	border: 1px solid var(--alba-border);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
	color: var(--alba-text);
}

.alba-donate-form {
	display: grid;
	gap: var(--alba-gap);
}

.alba-field {
	display: grid;
	gap: 8px;
	position: relative;
}

.alba-field label {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	/* Typography from provided reference */
	color: var(--Black, #000);
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 300;
	line-height: 16px; /* 100% */
	transition: all .15s ease;
}

.alba-field input,
.alba-field select {
	width: 100%;
	height: var(--alba-control-h);
	padding: 18px 14px 0 14px; /* extra top-padding for floating label */
	font-size: 16px;
	line-height: 1.2;
	color: var(--alba-text);
	background: #fff;
	border: 1px solid var(--alba-border);
	border-radius: var(--alba-radius);
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

/* When label floats (focus/value), give more bottom padding to vertically center typed text */
.alba-field:focus-within input,
.alba-field.alba-has-value input {
	padding-top: 26px;
	padding-bottom: 8px;
	padding-left: 18px; /* nudge text slightly to the right for better optical alignment */
}

/* Normalize number inputs and fine-tune label for Amount field */
.alba-field input[type="number"] {
	-moz-appearance: textfield;
}
.alba-field input[type="number"]::-webkit-outer-spin-button,
.alba-field input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.alba-field label[for="amount"] {
	/* Nudge for visual centering with Montserrat metrics */
	top: calc(50% - 12px);
}

/* Select field variant — label hidden, placeholder styled like labels */
.alba-field--select label {
	display: none;
}
.alba-field--select select {
	padding: 0 14px; /* normal vertical alignment since no floating label */
	/* Match text inputs border exactly */
	border: 1px solid #d1d5db !important;
	border-radius: var(--alba-radius) !important;
}
.alba-field--select:not(.alba-has-value) select {
	/* Match label typography and color */
	color: var(--Black, #000);
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	font-weight: 300;
	line-height: 16px;
}
.alba-field--select.alba-has-value select {
	color: var(--alba-text);
	font-weight: 400;
}

.alba-field input::placeholder {
	color: var(--alba-muted);
}

.alba-field input:focus,
.alba-field select:focus {
	outline: none;
	border-color: var(--alba-border-dark);
	box-shadow: 0 0 0 4px var(--alba-focus-ring);
}

/* Float label when focused or when field has a value */
.alba-field:focus-within label,
.alba-field.alba-has-value label {
	top: 8px;
	transform: none;
	font-size: 12px;
	line-height: 12px;
	color: var(--alba-muted);
}

.alba-hint {
	font-size: 12px;
	color: var(--alba-muted);
	margin-top: 4px;
}

.alba-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--alba-control-h);
	padding: 0 24px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 4px;
	border: 1px solid var(--Pacific-Blue, #0096BA);
	background: var(--Pacific-Blue, #0096BA);
	color: var(--alba-primary-text);
	cursor: pointer;
	transition: transform .05s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.alba-submit:hover {
	opacity: 0.95;
}

.alba-submit:active {
	transform: translateY(1px);
}

.alba-submit:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* Small enhancements for selects on WebKit */
.alba-field select {
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--alba-muted) 50%),
		linear-gradient(135deg, var(--alba-muted) 50%, transparent 50%),
		linear-gradient(to right, transparent, transparent);
	background-position:
		calc(100% - 18px) calc(50% - 4px),
		calc(100% - 10px) calc(50% - 4px),
		calc(100% - 2.5em) 0.5em;
	background-size:
		8px 8px,
		8px 8px,
		1px 1.8em;
	background-repeat: no-repeat;
}

/* Responsive tweaks */
@media (min-width: 640px) {
	.alba-donate-wrap {
		padding: 24px;
	}
}

@media (min-width: 768px) {
	.alba-donate-wrap {
		padding: 32px;
	}
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
	.alba-donate-wrap *,
	.alba-donate-wrap *::before,
	.alba-donate-wrap *::after {
		transition: none !important;
	}
}