/* =========================================================================
   WP Stripe Donations — Public Form Styles
   ========================================================================= */

:root {
	--wpsd-form-width:   100%;
	--wpsd-border-color: #d1d5db;
	--wpsd-btn-color:    #1a1a1a;
}

.wpsd-wrap {
	width: var(--wpsd-form-width);
	max-width: 100%;
	margin: 0 auto;
	font-family: inherit;
}

/* ── Form card ── */
.wpsd-form {
	background: #fff;
	border: 1px solid var(--wpsd-border-color);
	padding: 28px 24px;
}

/* ── Sections ── */
.wpsd-section {
	margin-bottom: 20px;
}

.wpsd-section:last-child {
	margin-bottom: 0;
}

/* ── Labels ── */
.wpsd-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	margin-bottom: 6px;
}

.wpsd-label--sub {
	font-weight: 500;
	color: #374151;
}

.wpsd-required {
	color: #dc2626;
}

/* ── Amount buttons ── */
.wpsd-amounts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpsd-amount-btn {
	background: var(--wpsd-btn-color);
	color: #fff;
	border: 2px solid var(--wpsd-btn-color);
	padding: 8px 16px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s;
	min-width: 68px;
}

.wpsd-amount-btn:hover {
	filter: brightness(1.2);
}

.wpsd-amount-btn[aria-pressed="true"] {
	background: #fff;
	color: var(--wpsd-btn-color);
	border-color: var(--wpsd-btn-color);
}

/* ── Custom amount input ── */
.wpsd-custom-amount {
	margin-top: 12px;
}

.wpsd-amount-input-wrap {
	display: flex;
	align-items: center;
	border: 1px solid var(--wpsd-border-color);
	overflow: hidden;
	max-width: 160px;
}

.wpsd-currency-symbol {
	background: #f3f4f6;
	padding: 0 10px;
	font-size: 15px;
	color: #374151;
	font-weight: 600;
	height: 40px;
	display: flex;
	align-items: center;
	border-right: 1px solid var(--wpsd-border-color);
}

.wpsd-input--amount {
	border: none !important;
	padding: 0 10px;
	height: 40px;
	width: 100px;
	font-size: 15px;
}

.wpsd-input--amount:focus {
	outline: none;
}

/* ── Select inputs ── */
.wpsd-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
	cursor: pointer;
}

/* ── Recurring checkbox ── */
.wpsd-section--checkbox {
	margin-bottom: 16px;
}

/* ── Interval select ── */
.wpsd-section--interval {
	margin-top: -8px;
	margin-bottom: 20px;
}

.wpsd-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #374151;
	cursor: pointer;
}

.wpsd-checkbox {
	width: 16px;
	height: 16px;
	cursor: pointer;
}

/* ── Stripe Elements container ── */
.wpsd-stripe-element {
	border: 1px solid var(--wpsd-border-color);
	padding: 10px 12px;
	background: #fff;
	min-height: 42px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wpsd-stripe-element.StripeElement--focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
	outline: none;
}

.wpsd-stripe-element.StripeElement--invalid {
	border-color: #dc2626;
}

/* ── Text inputs ── */
.wpsd-input {
	display: block;
	width: 100%;
	height: 42px;
	border: 1px solid var(--wpsd-border-color);
	padding: 0 12px;
	font-size: 14px;
	color: #111827;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wpsd-input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
	outline: none;
}

.wpsd-input:invalid {
	border-color: var(--wpsd-border-color); /* let JS handle validation display */
}

/* ── Rows ── */
.wpsd-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.wpsd-row--three {
	grid-template-columns: 2fr 2fr 1fr;
}

.wpsd-field {
	margin-bottom: 12px;
}

.wpsd-field:last-child {
	margin-bottom: 0;
}

/* ── Error messages ── */
.wpsd-field-error,
.wpsd-form-error {
	color: #dc2626;
	font-size: 13px;
	margin-top: 6px;
}

/* ── Submit section ── */
.wpsd-section--submit {
	margin-top: 8px;
}

.wpsd-submit-btn {
	display: block;
	width: 100%;
	padding: 13px 20px;
	border: none;
	background: #6b7280;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: not-allowed;
	transition: background 0.2s, filter 0.2s;
}

.wpsd-submit-btn:not([disabled]) {
	background: var(--wpsd-btn-color);
	cursor: pointer;
}

.wpsd-submit-btn:not([disabled]):hover {
	filter: brightness(1.2);
}

/* ── Secure notice ── */
.wpsd-secure-notice {
	text-align: center;
	font-size: 12px;
	color: #6b7280;
	margin: 8px 0 0;
}

/* ── Success ── */
.wpsd-success {
	background: #d1fae5;
	border: 1px solid #6ee7b7;
	padding: 20px 24px;
	color: #065f46;
	font-size: 16px;
	text-align: center;
}

/* ── Config notice ── */
.wpsd-notice {
	background: #fef3c7;
	border: 1px solid #fcd34d;
	padding: 12px 16px;
	color: #92400e;
	font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
	.wpsd-form {
		padding: 20px 16px;
	}

	.wpsd-row,
	.wpsd-row--three {
		grid-template-columns: 1fr;
	}
}
