/* ===========================================================================
   Parent portal — "my camps"
   ---------------------------------------------------------------------------
   Most visits here are one of two errands: check what is owed, or pay it. So
   the balance sits above the list, and the list is a receipt rather than a
   dashboard.

   Brand tokens come from CPAY_Theme, so this matches whichever client site it
   is deployed on. Every var() carries a fallback in case the token block is
   missing.
   =========================================================================== */

.cpay-portal {
	max-width: 720px;
	margin: 0 auto;
	padding: 8px 0 40px;
	font-size: 16px;
	line-height: 1.5;
	color: #16191a;
}

/* ---------- header ---------- */

.cpay-portal-head {
	margin-bottom: 22px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e2e6e1;
}

.cpay-portal-head h2 {
	margin: 0;
	font-size: 27px;
	line-height: 1.2;
	letter-spacing: -0.015em;
}

.cpay-portal-head p {
	margin: 5px 0 0;
	color: #6b7671;
	font-size: 14.5px;
}

/* ---------- outstanding balance ---------- */

.cpay-portal-owing {
	padding: 20px 22px;
	margin-bottom: 24px;
	border: 2px solid var(--crp-primary, #1e5c48);
	border-radius: var(--crp-radius, 10px);
	background: var(--crp-primary-tint, #edf2f0);
}

.cpay-portal-owing-t {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 14px;
}

.cpay-portal-owing-t span { font-size: 15px; }

.cpay-portal-owing-t strong {
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.cpay-portal-btn {
	display: block;
	width: 100%;
	padding: 15px 22px;
	border: 0;
	border-radius: var(--crp-radius, 8px);
	background: var(--crp-primary, #1e5c48);
	color: var(--crp-on-primary, #fff);
	font-size: 17px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.cpay-portal-btn:hover:not(:disabled) { filter: brightness(1.08); }
.cpay-portal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cpay-portal-btn:focus-visible {
	outline: 3px solid var(--crp-primary, #1e5c48);
	outline-offset: 2px;
}

.cpay-portal-element {
	padding: 18px;
	margin-top: 16px;
	background: #fff;
	border: 1px solid #e2e6e1;
	border-radius: var(--crp-radius, 8px);
}

.cpay-portal-error {
	margin-top: 14px;
	padding: 12px 15px;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	border-left: 4px solid #dc3545;
	border-radius: var(--crp-radius, 8px);
	color: #7d221d;
	font-size: 14.5px;
}

.cpay-portal-note {
	margin: 12px 0 0;
	text-align: center;
	font-size: 12.5px;
	color: #6b7671;
}

/* ---------- the list ---------- */

.cpay-portal-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cpay-portal-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 17px 19px;
	border: 1px solid #e2e6e1;
	border-radius: var(--crp-radius, 10px);
	background: #fff;
}

.cpay-portal-main { min-width: 0; }

.cpay-portal-camper {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
}

.cpay-portal-camp {
	margin: 3px 0 0;
	font-size: 15px;
}

.cpay-portal-camp a {
	color: var(--crp-primary-text, #1e5c48);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.cpay-portal-meta {
	margin: 6px 0 0;
	font-size: 13.5px;
	color: #6b7671;
}

.cpay-portal-money {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	text-align: right;
}

.cpay-portal-badge {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	font-size: 14.5px;
	font-weight: 600;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cpay-portal-badge.is-owing { background: #fdf6e9; color: #7a5310; }
.cpay-portal-badge.is-paid  { background: #eef5f0; color: #215c3c; }

.cpay-portal-sub {
	font-size: 12.5px;
	color: #8a938e;
	font-variant-numeric: tabular-nums;
}

/* ---------- signed out ---------- */

.cpay-portal-empty {
	max-width: 480px;
	margin: 0 auto;
	padding: 38px 32px 32px;
	text-align: center;
	background: #fff;
	border: 1px solid #e2e6e1;
	border-radius: var(--crp-radius, 10px);
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.04 );
}

.cpay-portal-empty h2 {
	margin: 0 0 8px;
	font-size: 25px;
	line-height: 1.2;
	text-wrap: balance;
}

.cpay-portal-empty p {
	margin: 0 auto 8px;
	max-width: 42ch;
	color: #56605c;
	font-size: 15px;
	line-height: 1.55;
}

/*
 * Links inside here are brand-coloured — EXCEPT the button.
 *
 * ".cpay-portal-empty a" is one class and one element, which beats the plain
 * ".cpay-portal-btn" it sits on, so the button rendered brand text on a brand
 * background: a solid red rectangle with the word "Log in" invisible inside
 * it. Excluded rather than fought with !important.
 */
.cpay-portal-empty a:not( .cpay-portal-btn ) {
	color: var(--crp-primary-text, #1e5c48);
}

/* The way in, and the quieter alternative under it. */
.cpay-portal-actions { margin: 22px 0 6px; }

.cpay-portal-btn-inline {
	display: inline-block;
	width: auto;
	padding: 13px 34px;
	color: var(--crp-on-primary, #fff);
	text-decoration: none;
}
.cpay-portal-btn-inline:hover,
.cpay-portal-btn-inline:focus {
	color: var(--crp-on-primary, #fff);
	text-decoration: none;
}

/* A line between "get a link" and "or use a password". */
.cpay-portal-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 24px 0 18px;
	color: #a7b0ab;
	font-size: 12.5px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.cpay-portal-or::before,
.cpay-portal-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #eef1ee;
}

.cpay-portal-small {
	margin: 0;
	font-size: 13.5px;
	color: #8a938e;
}
.cpay-portal-small a { color: var(--crp-primary-text, #1e5c48); }

/* ---------- after payment ---------- */

.cpay-portal-done {
	padding: 26px 22px;
	text-align: center;
	border-radius: var(--crp-radius, 10px);
	background: #eef5f0;
	color: #215c3c;
}

.cpay-portal-done strong { display: block; font-size: 19px; margin-bottom: 6px; }
.cpay-portal-done span   { font-size: 14.5px; }

@media (max-width: 540px) {
	.cpay-portal-item { flex-direction: column; gap: 10px; }
	.cpay-portal-money { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	.cpay-portal-btn { transition: none; }
}

/* Asking for a link back in. */
.cpay-portal-signin {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-end;
	max-width: 460px;
	margin: 18px auto 14px;
	text-align: left;
}
.cpay-portal-signin label {
	flex: 1 1 100%;
	font-size: 13px;
	color: #6b7671;
}
.cpay-portal-signin input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 11px 13px;
	border: 1px solid #d5dbd7;
	border-radius: var(--crp-radius, 8px);
	font-size: 15px;
}
.cpay-portal-signin .cpay-portal-btn { flex: 0 0 auto; width: auto; }

/* ---------------------------------------------------------------------------
 * Receipt
 *
 * Printed or saved as a PDF more often than it is read on screen, so it is a
 * sheet rather than a panel: white ground, real margins, and nothing that only
 * makes sense in a browser.
 * ------------------------------------------------------------------------- */

.cpay-receipt-back {
	margin: 0 0 16px;
}

.cpay-receipt-sheet {
	max-width: 42rem;
	padding: 32px;
	border: 1px solid #e2e6e1;
	border-radius: 8px;
	background: #fff;
}

.cpay-receipt-head {
	margin: 0 0 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid var( --crp-primary, #1e5c48 );
}

.cpay-receipt-head h2 {
	margin: 0;
	font-size: 1.25rem;
}

.cpay-receipt-title {
	margin: 2px 0 0;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
}

.cpay-receipt-facts {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 12rem, 1fr ) );
	gap: 12px 24px;
	margin: 0 0 24px;
}

.cpay-receipt-facts dt {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.cpay-receipt-facts dd {
	margin: 2px 0 0;
	font-weight: 600;
}

.cpay-receipt-lines {
	width: 100%;
	margin: 0 0 20px;
	border-collapse: collapse;
}

.cpay-receipt-lines th,
.cpay-receipt-lines td {
	padding: 9px 0;
	text-align: left;
	font-weight: 400;
	border-bottom: 1px solid #eef0ed;
}

/* Figures line up when they share a column. */
.cpay-receipt-lines td {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cpay-receipt-kind {
	display: block;
	font-size: 0.8125rem;
	opacity: 0.6;
}

.cpay-receipt-total th,
.cpay-receipt-total td {
	font-weight: 700;
	border-bottom: none;
	border-top: 2px solid #e2e6e1;
}

/* The fee is shown for honesty, not as another charge — it is already inside
   the total above it, so it must not read as an addition. */
.cpay-receipt-note th,
.cpay-receipt-note td {
	opacity: 0.65;
	font-size: 0.875rem;
}

.cpay-receipt-sub {
	margin: 28px 0 10px;
	font-size: 0.9375rem;
}

.cpay-receipt-settled {
	margin: 0;
	font-weight: 600;
	color: var( --crp-primary, #1e5c48 );
}

.cpay-receipt-owing {
	margin: 0;
}

.cpay-receipt-none {
	margin: 0 0 20px;
	opacity: 0.75;
}

.cpay-portal-receipt {
	display: inline-block;
	margin-top: 4px;
	font-size: 0.8125rem;
}

@media print {
	.cpay-receipt-back { display: none; }

	.cpay-receipt-sheet {
		max-width: none;
		padding: 0;
		border: none;
	}
}
