/* Donor portal — mobile-first, minimal. Reuses the .mdon-card shell from the
   donation form; adds portal-specific auth + dashboard styles. Single teal
   accent via --mdon-accent (inherited from the card). */

.mdon-portal {
	--mdon-accent: #0e8c7d;
	--mdon-accent-text: #ffffff;
	--mdon-ink: #15181d;
	--mdon-muted: #6b7280;
	max-width: 460px;
	margin: 0 auto;
}

/* The dashboard holds stats + a table, so it gets more room than the narrow
   sign-in screens. The .mdon-card base is capped at 380px; let it fill the
   wider container here. */
.mdon-portal--wide {
	max-width: 720px;
}

.mdon-portal--wide .mdon-card {
	max-width: none;
}

/* Confirmation modal (reuses .mdon-modal from donation-form.css) — use a clean
   stroked icon instead of the filled one the donation form uses. */
.mdon-portal-modal .mdon-modal__icon svg {
	fill: none;
	stroke: var(--mdon-accent);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mdon-portal__head {
	text-align: center;
	margin-bottom: 18px;
}

.mdon-portal__title {
	margin: 0 0 4px;
	font-size: 20px;
	font-weight: 700;
	color: #111827;
}

.mdon-portal__sub {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
}

.mdon-portal__field {
	margin-bottom: 14px;
}

.mdon-portal__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.mdon-portal__input {
	width: 100%;
	box-sizing: border-box;
	height: 48px;
	padding: 0 14px;
	font-size: 16px; /* prevents iOS zoom */
	color: #111827;
	background: #fff;
	border: 1.5px solid #d7dbe0;
	border-radius: 10px;
	transition: border-color .15s, box-shadow .15s;
}

.mdon-portal__input:focus {
	outline: none;
	border-color: var(--mdon-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--mdon-accent) 18%, transparent);
}

/* One-time code: big, spaced, numeric */
.mdon-portal__input--code {
	text-align: center;
	letter-spacing: .4em;
	font-size: 24px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	padding-right: 0; /* keep the letter-spacing centred */
}

.mdon-portal__submit {
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 10px;
	background: var(--mdon-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, transform .05s;
}

.mdon-portal__submit:hover {
	background: color-mix(in srgb, var(--mdon-accent) 88%, #000);
}

.mdon-portal__submit:active {
	transform: scale(.99);
}

.mdon-portal__foot {
	margin-top: 16px;
	text-align: center;
	font-size: 13px;
	color: #6b7280;
}

.mdon-portal__link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--mdon-accent);
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.mdon-portal__link:hover {
	text-decoration: underline;
}

/* Honeypot — visually hidden but present for bots. */
.mdon-portal__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Notices */
.mdon-portal__notice {
	margin: 0 0 16px;
	padding: 11px 14px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.5;
}

.mdon-portal__notice--info {
	background: color-mix(in srgb, var(--mdon-accent) 10%, #fff);
	border: 1px solid color-mix(in srgb, var(--mdon-accent) 30%, #fff);
	color: #0f5f55;
}

.mdon-portal__notice--error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b42318;
}

/* Signed-in bar (dashboard header, Phase 2 extends this) */
.mdon-portal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	font-size: 13px;
	color: #6b7280;
}

.mdon-portal__who strong {
	color: #111827;
}

/* Dashboard */
.mdon-portal .mdon-card {
	margin-bottom: 14px;
}

.mdon-dash__section {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 700;
	color: #111827;
}

.mdon-dash__stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.mdon-dash__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 12px 6px;
	background: #f7f8fa;
	border-radius: 12px;
}

.mdon-dash__stat-value {
	font-size: 18px;
	font-weight: 700;
	color: var(--mdon-accent);
	line-height: 1.2;
}

.mdon-dash__stat-label {
	margin-top: 3px;
	font-size: 11px;
	color: #6b7280;
}

.mdon-dash__sub {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid #f0f2f5;
}

.mdon-dash__sub:first-of-type {
	border-top: 0;
}

.mdon-dash__amount {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
}

.mdon-dash__per {
	font-size: 12px;
	color: #6b7280;
}

.mdon-dash__sub-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mdon-dash__sub-title {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
}

.mdon-dash__sub-amount {
	font-size: 13px;
	font-weight: 600;
	color: var(--mdon-accent);
}

.mdon-dash__sub-meta {
	font-size: 12px;
	color: #9ca3af;
}

.mdon-dash__sub--canceled .mdon-dash__sub-title {
	color: #6b7280;
}

.mdon-dash__sub--canceled .mdon-dash__sub-amount {
	color: #9ca3af;
}

.mdon-modal__subject {
	display: block;
	margin-bottom: 8px;
	padding: 8px 12px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--mdon-accent) 8%, #fff);
	color: #111827;
	font-weight: 700;
	font-size: 14px;
}

.mdon-dash__cancel {
	border: 1px solid #e4b4b0;
	background: #fff;
	color: #b42318;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 9px;
	cursor: pointer;
	transition: background .15s;
}

.mdon-dash__cancel:hover {
	background: #fef2f2;
}

.mdon-dash__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mdon-dash__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid #f0f2f5;
}

.mdon-dash__item:first-child {
	border-top: 0;
}

.mdon-dash__item-main {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mdon-dash__meta {
	font-size: 12px;
	color: #6b7280;
}

.mdon-dash__item-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	flex: 0 0 auto;
}

.mdon-dash__receipt {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border: 1px solid color-mix(in srgb, var(--mdon-accent) 35%, #fff);
	border-radius: 8px;
	background: color-mix(in srgb, var(--mdon-accent) 8%, #fff);
	color: var(--mdon-accent);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, border-color .15s;
}

.mdon-dash__receipt svg {
	width: 14px;
	height: 14px;
}

.mdon-dash__receipt:hover {
	background: color-mix(in srgb, var(--mdon-accent) 15%, #fff);
	border-color: var(--mdon-accent);
}

.mdon-badge {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	background: #f0f2f5;
	color: #6b7280;
	text-transform: capitalize;
}

.mdon-badge--paid {
	background: #e7f6ef;
	color: #0f7b52;
}

.mdon-badge--pending {
	background: #fef6e7;
	color: #8a6d1a;
}

.mdon-badge--failed,
.mdon-badge--canceled,
.mdon-badge--expired {
	background: #fdeceb;
	color: #b42318;
}

/* Payment-history table + filter + pagination */
.mdon-tbl-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.mdon-tbl-head .mdon-dash__section {
	margin: 0;
}

.mdon-tbl-filter select {
	font-size: 12px;
	padding: 7px 10px;
	border: 1px solid #d7dbe0;
	border-radius: 8px;
	background: #fff;
	color: #374151;
	cursor: pointer;
}

.mdon-tbl-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.mdon-tbl {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.mdon-tbl th,
.mdon-tbl td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid #f0f2f5;
	white-space: nowrap;
}

.mdon-tbl th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9ca3af;
	font-weight: 600;
}

.mdon-tbl th:first-child,
.mdon-tbl td:first-child {
	padding-left: 0;
}

.mdon-tbl th.amt,
.mdon-tbl td.amt {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.mdon-tbl td.amt {
	font-weight: 700;
	color: #111827;
}

.mdon-tbl td.doc,
.mdon-tbl th.doc {
	text-align: right;
	padding-right: 0;
}

.mdon-tbl-empty {
	text-align: center;
	color: #6b7280;
	font-size: 13px;
	padding: 16px 0 4px;
}

.mdon-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin-top: 14px;
}

.mdon-pager__btn {
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid #e4e7eb;
	background: #fff;
	border-radius: 8px;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mdon-pager__btn:hover:not(:disabled) {
	border-color: var(--mdon-accent);
	color: var(--mdon-accent);
}

.mdon-pager__btn.is-active {
	background: var(--mdon-accent);
	border-color: var(--mdon-accent);
	color: #fff;
}

.mdon-pager__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 440px) {
	.mdon-dash__receipt-label {
		display: none;
	}
	.mdon-dash__receipt {
		padding: 6px;
	}
}
