/* Donor Merchant donation form */

.dm-form {
	--dm-accent: #1950d1;
	--dm-accent-dark: #123a99;
	--dm-border: #d7dbe2;
	--dm-text: #1e2430;
	--dm-muted: #5b6472;
	--dm-radius: 10px;
	box-sizing: border-box;
	max-width: 540px;
	margin: 0 auto;
	padding: 28px;
	background: #fff;
	border: 1px solid var(--dm-border);
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(20, 30, 60, 0.08);
	color: var(--dm-text);
	font-size: 16px;
	line-height: 1.5;
}

/*
 * Stated outright rather than inherited. This previously used box-sizing:
 * inherit, which relies on an unbroken chain from .dm-form down to every
 * control; inside <details> that chain does not hold, so the tribute fields
 * fell back to content-box and width:100% added their padding on top, making
 * the select overflow its grid column and cover the field beside it.
 */
.dm-form,
.dm-form *,
.dm-form *::before,
.dm-form *::after {
	box-sizing: border-box;
}

.dm-form--notice {
	background: #fff8e5;
	border-color: #f0c33c;
}

.dm-test-banner {
	margin: -28px -28px 20px;
	padding: 8px 16px;
	background: #fff3cd;
	color: #664d03;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	border-radius: 16px 16px 0 0;
}

.dm-form__title {
	margin: 0 0 18px;
	font-size: 22px;
}

.dm-fieldset {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.dm-legend {
	margin-bottom: 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--dm-muted);
}

.dm-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dm-pill {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.dm-pill input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.dm-pill span {
	display: inline-block;
	padding: 9px 16px;
	border: 1.5px solid var(--dm-border);
	/*
	 * Follows the Button shape setting, like the submit button does. These are
	 * the frequency, amount and gateway selectors: leaving them pinned round
	 * meant choosing "Sharp" produced a square donate button sitting under
	 * fully round amount buttons.
	 */
	border-radius: var(--dm-radius);
	font-weight: 600;
	font-size: 15px;
	color: var(--dm-text);
	transition: all 0.15s ease;
}

.dm-pill input:checked + span {
	background: var(--dm-accent);
	border-color: var(--dm-accent);
	color: #fff;
}

.dm-pill input:focus-visible + span {
	outline: 2px solid var(--dm-accent);
	outline-offset: 2px;
}

.dm-pill--disabled {
	opacity: 0.45;
	pointer-events: none;
}

.dm-custom-amount {
	margin-top: 12px;
}

.dm-input-prefix {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--dm-border);
	border-radius: var(--dm-radius);
	overflow: hidden;
}

.dm-input-prefix > span {
	padding: 0 12px;
	color: var(--dm-muted);
	font-weight: 600;
}

.dm-input-prefix input {
	flex: 1;
	border: 0 !important;
	box-shadow: none !important;
	padding: 10px 12px 10px 0 !important;
	font-size: 16px;
	background: transparent;
}

/*
 * minmax(0, 1fr) rather than 1fr: a bare 1fr means minmax(auto, 1fr), and that
 * auto minimum is the item's min-content width. Form controls carry a non-zero
 * intrinsic minimum, so the column refuses to shrink below it, the two columns
 * outgrow the row, and the wider control overlaps its neighbour. Allowing the
 * track to shrink to 0 keeps the split even whatever the control contains.
 */
.dm-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
}

@media (max-width: 480px) {
	.dm-grid {
		grid-template-columns: 1fr;
	}
}

.dm-field {
	display: flex;
	flex-direction: column;
	/* Flex items default to min-width:auto, which would re-introduce the same
	   intrinsic-minimum overflow inside the grid cell. */
	min-width: 0;
}

/* Never let a control paint outside the field that owns it. */
.dm-field input,
.dm-field select,
.dm-field textarea {
	max-width: 100%;
}

.dm-label {
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--dm-muted);
}

.dm-req {
	color: #c4254b;
}

.dm-form input[type="text"],
.dm-form input[type="email"],
.dm-form input[type="tel"],
.dm-form input[type="number"],
.dm-form select,
.dm-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--dm-border);
	border-radius: var(--dm-radius);
	font-size: 16px;
	/* Stated explicitly on all three: inputs default to line-height normal while a
	   select took its own value, leaving the select a few pixels taller than the
	   field beside it in the same row. */
	line-height: 1.25;
	color: var(--dm-text);
	background: #fff;
}

/*
 * Selects otherwise keep their native chrome, which renders at a different
 * height and intrinsic width than the text inputs sitting beside them in the
 * same grid row (Dedication next to Name). Removing the default appearance and
 * drawing our own chevron makes every control in a row line up.
 */
.dm-form select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 34px;
	background-image: url( 'data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"%3E%3Cpath d="M1 1.5 6 6.5l5-5" fill="none" stroke="%236b7280" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E' );
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
}

.dm-form select::-ms-expand {
	display: none;
}

.dm-form input:focus,
.dm-form select:focus,
.dm-form textarea:focus {
	border-color: var(--dm-accent);
	outline: 2px solid rgba(25, 80, 209, 0.15);
}

.dm-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.dm-tribute {
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1.5px solid var(--dm-border);
	border-radius: var(--dm-radius);
}

.dm-tribute summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	color: var(--dm-muted);
}

.dm-tribute .dm-grid,
.dm-tribute .dm-field {
	margin-top: 12px;
}

.dm-fee {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #f4f7ff;
	border-radius: var(--dm-radius);
	font-size: 14px;
	cursor: pointer;
}

.dm-fee input {
	margin-top: 3px;
	flex-shrink: 0;
}

.dm-payment-element {
	margin: 0 0 18px;
}

.dm-paypal-buttons {
	margin: 0 0 12px;
}

.dm-message {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-radius: var(--dm-radius);
	background: #eef2fb;
	color: var(--dm-text);
	font-size: 14px;
}

.dm-message--error {
	background: #fdecef;
	color: #8d1f3d;
}

.dm-submit {
	display: block;
	width: 100%;
	padding: 14px 20px;
	border: 0;
	border-radius: var(--dm-radius);
	background: var(--dm-accent);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.dm-submit:hover:not(:disabled) {
	background: var(--dm-accent-dark);
}

.dm-submit:active:not(:disabled) {
	transform: scale(0.99);
}

.dm-submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

/*
 * Kept as normal centred text rather than a flex row: as a flex container the
 * padlock became a sibling of the whole text block, so once the sentence wrapped
 * onto a second line the icon floated against the middle of both lines instead of
 * sitting with the words. Inline flow keeps it on the first line where it reads.
 */
.dm-secure {
	margin: 14px auto 0;
	max-width: 34em;
	font-size: 12px;
	line-height: 1.5;
	color: var(--dm-muted);
	text-align: center;
}

.dm-secure svg {
	display: inline-block;
	vertical-align: -2px;
	margin-right: 6px;
}

.dm-success {
	text-align: center;
	padding: 24px 0;
}

.dm-success__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #e7f7ee;
	color: #19854b;
	font-size: 32px;
	font-weight: 700;
}

.dm-success__title {
	margin: 0 0 8px;
	font-size: 24px;
}

.dm-success__text {
	margin: 0;
	color: var(--dm-muted);
}

/* Campaign description + goal thermometer */
.dm-form__desc { margin: 0 0 18px; color: var(--dm-muted); font-size: 15px; }
.dm-form__desc p:last-child { margin-bottom: 0; }

.dm-progress { margin: 0 0 22px; }
.dm-progress__stats { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.dm-progress__raised { font-size: 24px; font-weight: 800; color: var(--dm-accent); letter-spacing: -.02em; }
.dm-progress__goal { font-size: 14px; color: var(--dm-muted); }
.dm-progress__track { height: 12px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.dm-progress__bar { height: 100%; background: linear-gradient(90deg, var(--dm-accent-dark), var(--dm-accent)); border-radius: 999px; transition: width .6s ease; min-width: 2px; }
.dm-progress__pct { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--dm-muted); text-align: right; }
.dm-progress-standalone { padding: 22px 24px; }
.dm-progress-standalone .dm-progress { margin-bottom: 0; }

/* Donor self-service portal */
.dm-portal {
	--dm-accent: #1950d1;
	--dm-accent-dark: #123a99;
	--dm-border: #d7dbe2;
	--dm-text: #1e2430;
	--dm-muted: #5b6472;
	/* Declared here too, so the configured shape reaches the portal's controls. */
	--dm-radius: 10px;
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	color: var(--dm-text);
	font-size: 16px;
}
.dm-portal * { box-sizing: border-box; }
.dm-portal-notice { background: #eef2fb; border: 1px solid #d4e0fa; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; }
.dm-portal-notice--error { background: #fdecef; border-color: #f5c6d0; color: #8d1f3d; }
.dm-portal-login { background: #fff; border: 1px solid var(--dm-border); border-radius: 14px; padding: 28px; box-shadow: 0 8px 30px rgba(20,30,60,.07); }
.dm-portal-login h3 { margin: 0 0 8px; font-size: 20px; }
.dm-portal-login p { margin: 0 0 16px; color: var(--dm-muted); font-size: 15px; }
.dm-portal-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dm-portal-row input { flex: 1; min-width: 200px; padding: 11px 14px; border: 1.5px solid var(--dm-border); border-radius: var(--dm-radius); font-size: 16px; }
.dm-portal-row input:focus { border-color: var(--dm-accent); outline: 2px solid rgba(25,80,209,.15); }
.dm-portal .dm-submit { display: inline-block; border: 0; border-radius: var(--dm-radius); background: var(--dm-accent); color: #fff; font-size: 15px; font-weight: 700; padding: 11px 22px; cursor: pointer; text-decoration: none; transition: background .15s ease; }
.dm-portal .dm-submit:hover { background: var(--dm-accent-dark); }
.dm-portal-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.dm-portal-head h3 { margin: 0 0 4px; font-size: 22px; }
.dm-portal-sub { margin: 0; color: var(--dm-muted); font-size: 15px; }
.dm-portal-note { background: #f4f7ff; border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--dm-muted); margin: 0 0 20px; }
.dm-portal-h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--dm-muted); margin: 26px 0 10px; }
.dm-portal-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dm-portal-table th, .dm-portal-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--dm-border); }
.dm-portal-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--dm-muted); }
.dm-portal-statements { margin-top: 18px; font-size: 14.5px; color: var(--dm-muted); }
@media (max-width: 480px) {
	.dm-portal-table thead { display: none; }
	.dm-portal-table tr { display: block; border-bottom: 1px solid var(--dm-border); padding: 8px 0; }
	.dm-portal-table td { display: flex; justify-content: space-between; border: 0; padding: 4px 0; }
}

/* Tier 2: designation, custom fields, newsletter, ACH note */
.dm-designation .dm-select { width: 100%; }
.dm-custom .dm-field { margin-bottom: 12px; }
.dm-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--dm-text); cursor: pointer; }
.dm-check input { margin-top: 3px; flex-shrink: 0; }
.dm-newsletter { background: #f4f7ff; }
.dm-ach-note { margin: 0 0 14px; padding: 10px 14px; background: #eef2fb; border-radius: var(--dm-radius); font-size: 13px; color: var(--dm-muted); }

/*
 * The status region stays in the DOM so screen readers keep observing it; with
 * no text it must take no space and draw nothing. :empty covers the first
 * paint, before JS adds .dm-message--empty.
 */
.dm-message:empty,
.dm-message--empty {
	display: none;
}

.dm-message:focus {
	outline: 2px solid var(--dm-accent);
	outline-offset: 2px;
}
