/**
 * Base: reset, typography, and the controls shared by every screen.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--fs-body);
	line-height: 1.5;
	font-weight: 400;
}

img,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--navy-600);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

h1,
h2,
h3 {
	margin: 0 0 12px;
	color: var(--navy-600);
	font-weight: 800;
	line-height: 1.25;
}

h1 {
	font-size: var(--fs-h1);
}

h2 {
	font-size: var(--fs-h3);
}

h3 {
	font-size: var(--fs-h4);
	font-weight: 700;
}

p {
	margin: 0 0 12px;
}

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.86em;
	color: var(--muted-2);
}

:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 2px;
}

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

.skip-link:focus {
	position: fixed;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 999;
	width: auto;
	height: auto;
	clip: auto;
	padding: 10px 18px;
	background: var(--surface);
	border-radius: var(--r-control);
}

/* --------------------------------------------------------------- buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: var(--r-control);
	font: inherit;
	font-size: var(--fs-sm);
	font-weight: 700;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn--navy {
	background: var(--navy-500);
	color: #fff;
	box-shadow: var(--shadow-card);
}

.btn--navy:hover {
	background: var(--navy-600);
}

.btn--red {
	background: var(--red-600);
	color: #fff;
}

.btn--red:hover {
	background: var(--red-500);
}

.btn--blue {
	background: linear-gradient(90deg, #1D6FD0, var(--navy-600));
	color: #fff;
}

.btn--green {
	background: var(--green-050);
	border-color: var(--green-600);
	color: var(--green-700);
}

.btn--soft {
	background: var(--tint);
	color: var(--navy-600);
	border-color: var(--line);
}

.btn--ghost {
	background: transparent;
	border-color: var(--line);
	color: var(--navy-600);
}

.btn--block {
	width: 100%;
}

.btn.is-static {
	cursor: default;
}

.btn.is-static:hover {
	transform: none;
}

.btn[disabled] {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
}

.link-btn {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 700;
	color: var(--link);
	cursor: pointer;
	text-decoration: underline;
}

/* ----------------------------------------------------------------- pills */

.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	background: var(--surface);
	color: var(--navy-600);
	font-size: var(--fs-xs);
	font-weight: 700;
	cursor: pointer;
}

.pill:hover {
	text-decoration: none;
	border-color: var(--line-3);
}

.pill--cta {
	background: var(--orange);
	border-color: var(--orange);
	color: #fff;
}

.pill--cta:hover {
	background: var(--red-500);
	border-color: var(--red-500);
}

.pill__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--gold);
	box-shadow: 0 0 0 3px rgba(244, 179, 35, .22);
}

.chip-pill {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 20px;
	border-radius: var(--r-pill);
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 700;
}

.chip-pill.is-active {
	background: var(--navy-600);
	border-color: var(--navy-600);
	color: #fff;
}

.chip-pill:hover {
	text-decoration: none;
}

/* ---------------------------------------------------------------- fields */

.field {
	margin-bottom: 18px;
}

.field label {
	display: block;
	margin-bottom: 8px;
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--navy-700);
}

.field__wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 14px;
	background: var(--surface-2);
	border: 1px solid var(--line-3);
	border-radius: var(--r-control);
}

.field__icon {
	color: var(--muted-3);
	font-size: 15px;
}

.field input,
.field textarea,
.field select {
	flex: 1;
	min-height: 52px;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: var(--fs-sm);
	color: var(--ink);
}

.field input:focus,
.field textarea:focus {
	outline: none;
}

.field__wrap:focus-within {
	border-color: var(--navy-700);
	background: var(--surface);
}

.form-error {
	margin: 0 0 12px;
	color: var(--red-600);
	font-size: var(--fs-xs);
	font-weight: 700;
	min-height: 0;
}

.form-error:empty {
	display: none;
}

/* ---------------------------------------------------------------- tables */

.donor-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-sm);
}

.donor-table th,
.donor-table td {
	padding: 12px 10px;
	text-align: start;
	border-bottom: 1px solid var(--line-soft);
}

.donor-table th {
	color: var(--muted-3);
	font-size: var(--fs-xs);
	font-weight: 700;
	text-transform: none;
}

.donor-table tr.is-me {
	background: var(--tint-2);
}

.donor-table .is-debit {
	/* --red-600 reads 3.3:1 on the navy table; this red clears AA (5.7:1). */
	color: #FF6B6B;
	font-weight: 700;
}

.donor-table .is-credit {
	color: var(--green-700);
	font-weight: 700;
}

.tag {
	display: inline-block;
	padding: 4px 12px;
	border-radius: var(--r-pill);
	background: var(--tint);
	color: var(--muted);
	font-size: var(--fs-2xs);
	font-weight: 700;
}

.tag--owner {
	background: var(--navy-600);
	color: #fff;
}

/* ---------------------------------------------------------------- badges */

.badge-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}

.badge {
	display: grid;
	gap: 4px;
	padding: 18px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-control);
	background: var(--surface);
	text-align: center;
}

.badge__icon {
	font-size: 28px;
}

.badge strong {
	color: var(--navy-600);
	font-size: var(--fs-sm);
}

.badge span {
	color: var(--muted-3);
	font-size: var(--fs-2xs);
}

/* Locked reads from the greyed icon; fading the whole badge took its text
   below AA contrast (3.3:1). */
.badge.is-locked {
	background: var(--surface-3);
}

.badge.is-locked .badge__icon {
	opacity: .4;
	filter: grayscale(1);
}

/* ----------------------------------------------------------- misc blocks */

.mini-label {
	display: block;
	color: var(--muted-3);
	font-size: var(--fs-2xs);
	font-weight: 700;
	margin-bottom: 6px;
}

.empty {
	padding: 28px;
	border-radius: var(--r-control);
	background: var(--surface-3);
	color: var(--muted-2);
	text-align: center;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 18px 0;
	color: var(--navy-600);
	font-size: var(--fs-sm);
	font-weight: 700;
}

.rank-medallion {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--red-500);
	color: #fff;
	font-size: 30px;
	font-weight: 800;
	flex: none;
}

.rank-medallion.is-black {
	background: var(--navy-600);
}

.rank-medallion.is-green {
	background: var(--felt-600);
}

.rank-medallion--sm {
	width: 48px;
	height: 48px;
	font-size: var(--fs-lg);
}
