/* ===========================================================================
   Camp-native registration form
   Uses the brand tokens, so it matches whichever client site it runs on.
   =========================================================================== */

.cpay-form {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 20px 60px;
	color: #16191a;
	text-align: left;
	font-size: 16px;
	line-height: 1.55;
}
.cpay-form *, .cpay-form *::before, .cpay-form *::after { box-sizing: border-box; }

.cpay-form h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; }
.cpay-form h3 { margin: 30px 0 12px; font-size: 17px; padding-top: 20px; border-top: 1px solid #eef1ed; }
.cpay-step-sub { margin: 0 0 24px; color: #6b7671; font-size: 15px; }

/* ---------- progress ---------- */

.cpay-steps {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	font-size: 13px;
	overflow-x: auto;
}
.cpay-steps li {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 9px 14px 9px 10px;
	border-radius: 99px;
	color: #8a938e;
	white-space: nowrap;
	background: #f4f6f3;
}
.cpay-steps li span {
	display: grid;
	place-items: center;
	width: 21px; height: 21px;
	border-radius: 50%;
	background: #dfe4e0;
	color: #6b7671;
	font-size: 12px;
	font-weight: 700;
}
.cpay-steps li.is-active { background: var(--crp-primary-tint, #edf2f0); color: var(--crp-primary-text, #1e5c48); font-weight: 600; }
.cpay-steps li.is-active span { background: var(--crp-primary, #1e5c48); color: var(--crp-on-primary, #fff); }
.cpay-steps li.is-done span { background: var(--crp-primary-soft, #dbe5e2); color: var(--crp-primary-text, #1e5c48); }

/* ---------- steps ---------- */

.cpay-step { display: none; }
.cpay-step.is-active { display: block; }

.cpay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .cpay-row { grid-template-columns: 1fr; } }

.cpay-field { margin-bottom: 16px; }
.cpay-field > label,
.cpay-field > legend { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14.5px; }
.cpay-required > label::after,
.cpay-required > legend::after { content: " *"; color: #b3122c; }

.cpay-field input[type="text"],
.cpay-field input[type="email"],
.cpay-field input[type="tel"],
.cpay-field input[type="date"],
.cpay-field select,
.cpay-field textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #d4dad6;
	border-radius: var(--crp-radius, 8px);
	font: inherit;
	/* 16px keeps iOS from zooming the viewport on focus. */
	font-size: 16px;
	background: #fff;
	color: inherit;
}
.cpay-field textarea { resize: vertical; }

.cpay-field input:focus-visible,
.cpay-field select:focus-visible,
.cpay-field textarea:focus-visible {
	outline: 2px solid var(--crp-primary, #1e5c48);
	outline-offset: 1px;
	border-color: var(--crp-primary, #1e5c48);
}

.cpay-field .has-error { border-color: #b3122c; background: #fffafa; }
.cpay-fielderr { display: block; margin-top: 5px; font-size: 13px; color: #7d221d; }
.cpay-hint { display: block; margin-top: 5px; font-size: 13px; color: #8a938e; }

fieldset.cpay-field { border: 0; padding: 0; margin: 0 0 16px; }

/* ---------- tiers ---------- */

.cpay-tiers { display: grid; gap: 10px; }

.cpay-tier {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: center;
	padding: 15px 17px;
	border: 2px solid #e2e6e1;
	border-radius: var(--crp-radius, 8px);
	cursor: pointer;
	background: #fff;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.cpay-tier:hover { border-color: var(--crp-primary-line, #c0d1cc); }
.cpay-tier:has(input:checked) {
	border-color: var(--crp-primary, #1e5c48);
	background: var(--crp-primary-tint, #edf2f0);
}
.cpay-tier input { margin: 0; width: 18px; height: 18px; }
.cpay-tier-body { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cpay-tier-label { font-weight: 600; font-size: 15.5px; }
.cpay-tier-price { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

.cpay-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--crp-primary, #1e5c48);
	color: var(--crp-on-primary, #fff);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	vertical-align: 1px;
}

.cpay-flatprice { font-size: 17px; margin: 0 0 20px; }

/* ---------- errors ---------- */

.cpay-steperr {
	margin: 14px 0 20px;
	padding: 14px 16px;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	border-left: 4px solid #b3122c;
	border-radius: var(--crp-radius, 8px);
	color: #7d221d;
	font-size: 14.5px;
}
.cpay-steperr strong { display: block; margin-bottom: 4px; }
.cpay-steperr ul { margin: 6px 0 0; padding-left: 18px; }
.cpay-steperr a { color: #7d221d; }

.cpay-form-error, .cpay-form--closed { padding: 24px; background: #f4f6f3; border-radius: 8px; }

/* ---------- review ---------- */

.cpay-review {
	display: grid;
	grid-template-columns: minmax(120px, auto) 1fr;
	gap: 8px 18px;
	margin: 0 0 8px;
	padding: 18px 20px;
	background: #f7f9f7;
	border-radius: var(--crp-radius, 8px);
	font-size: 15px;
}
.cpay-review dt { color: #6b7671; }
.cpay-review dd { margin: 0; font-weight: 500; }

/* ---------- nav ---------- */

.cpay-nav { display: flex; gap: 12px; justify-content: flex-end; margin-top: 26px; }
.cpay-nav--back { justify-content: flex-start; margin-top: 16px; }

.cpay-next, .cpay-prev {
	padding: 13px 26px;
	border-radius: var(--crp-radius, 8px);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	font-family: inherit;
}
.cpay-next { background: var(--crp-primary, #1e5c48); color: var(--crp-on-primary, #fff); }
.cpay-next:hover { filter: brightness(1.08); }
.cpay-prev { background: #fff; border-color: #d4dad6; color: #56605c; }
.cpay-prev:hover { border-color: #b6beb9; }
.cpay-next:focus-visible, .cpay-prev:focus-visible { outline: 3px solid var(--crp-primary, #1e5c48); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { .cpay-tier, .cpay-next { transition: none; } }

/* ---------- bed availability ---------- */

.cpay-tier-note {
	display: block;
	margin-top: 3px;
	font-size: 12.5px;
	font-weight: 500;
	color: #8a938e;
}
.cpay-tier-note.is-low { color: #a8620d; }

/* Sold out is shown, not hidden. A parent who cannot get a bed still needs
   to see the option existed so the commuter choice makes sense. */
.cpay-tier.is-soldout {
	opacity: 0.55;
	cursor: not-allowed;
	background: #fafbfa;
}
.cpay-tier.is-soldout .cpay-tier-note { color: #7d221d; }
.cpay-tier.is-soldout:hover { border-color: #e2e6e1; }

/* City / State / ZIP — three tracks, not the default two, so the ZIP is not
   given the same width as the city name. */
.cpay-row-csz {
	grid-template-columns: 2fr 1fr 1fr;
}

@media (max-width: 560px) {
	.cpay-row-csz { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Adding siblings
   ---------------------------------------------------------------------------
   The camper block repeats; the family block does not. So added campers get a
   compact list above the entry form, and the entry form keeps its full size —
   it is still the thing being filled in.
   =========================================================================== */

.cpay-added {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cpay-added-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	border: 1px solid var(--crp-primary-line, #c0d1cc);
	border-radius: var(--crp-radius, 8px);
	background: var(--crp-primary-tint, #edf2f0);
}

.cpay-added-name { font-weight: 600; }

.cpay-added-meta {
	flex: 1;
	min-width: 0;
	font-size: 13.5px;
	color: #56605c;
	/* A long camp name must not push Remove off the row. */
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpay-added-remove {
	flex: none;
	border: 0;
	background: none;
	padding: 4px 6px;
	font: inherit;
	font-size: 13.5px;
	color: #9a2c2c;
	cursor: pointer;
	text-decoration: underline;
}
.cpay-added-remove:focus-visible { outline: 2px solid #9a2c2c; outline-offset: 2px; }

.cpay-camper {
	border: 1px solid #e2e6e1;
	border-radius: var(--crp-radius, 10px);
	padding: 20px 22px;
	margin: 0 0 16px;
}

.cpay-camper-legend {
	padding: 0 8px;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--crp-primary-text, #1e5c48);
}

.cpay-camper-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.cpay-add-camper {
	padding: 11px 20px;
	border: 2px dashed var(--crp-primary-line, #c0d1cc);
	border-radius: var(--crp-radius, 8px);
	background: transparent;
	color: var(--crp-primary-text, #1e5c48);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.cpay-add-camper:hover { border-style: solid; background: var(--crp-primary-tint, #edf2f0); }
.cpay-add-camper:focus-visible { outline: 3px solid var(--crp-primary, #1e5c48); outline-offset: 2px; }

.cpay-camper-hint { font-size: 13.5px; color: #6b7671; }

/* ---------- running total ---------- */

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

.cpay-tally-head {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b7671;
	margin-bottom: 10px;
}

.cpay-tally-lines {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
	font-size: 14.5px;
}

.cpay-tally-lines li {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 4px 0;
	font-variant-numeric: tabular-nums;
}

.cpay-tally-lines em { font-style: normal; color: #6b7671; }
.cpay-tally-lines .is-off { color: #2f6b45; }

.cpay-tally-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 14px;
	padding-top: 10px;
	border-top: 1px solid #e2e6e1;
	font-size: 15px;
}
.cpay-tally-total strong { font-size: 21px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.cpay-loading { color: #6b7671; font-style: italic; }

/* ---------- team codes ---------- */

.cpay-optional {
	font-weight: 400;
	font-size: 0.85em;
	color: #8a938e;
	text-transform: lowercase;
}

.cpay-team-status {
	display: block;
	margin-top: 6px;
	padding: 8px 11px;
	border-radius: var(--crp-radius, 6px);
	font-size: 13.5px;
	line-height: 1.45;
}

.cpay-team-status.is-good { background: #eef5f0; color: #215c3c; }
.cpay-team-status.is-bad  { background: #fdecea; color: #7d221d; }

/* A field filled in from a coach's roster, so a parent can see what came from
   the club rather than wondering why their form was already full. */
.cpay-field input.is-prefilled,
.cpay-field select.is-prefilled {
	background: var(--crp-primary-tint, #edf2f0);
}

/* "Same as me" on the emergency contact. */
.cpay-samecheck {
	display: inline-flex;
	gap: 9px;
	align-items: center;
	margin: 0 0 14px;
	padding: 9px 14px;
	border: 1px solid #e2e6e1;
	border-radius: var(--crp-radius, 8px);
	background: #fff;
	font-size: 14.5px;
	cursor: pointer;
}
.cpay-samecheck:has(input:checked) {
	border-color: var(--crp-primary, #1e5c48);
	background: var(--crp-primary-tint, #edf2f0);
}
.cpay-samecheck input { width: 17px; height: 17px; margin: 0; }

/* Medical answers on the review step, read back in full. */
.cpay-review-med {
	display: block;
	margin-top: 3px;
	color: #6b7671;
	line-height: 1.5;
}
.cpay-review-med b { color: #56605c; font-weight: 600; }
.cpay-review dd strong { font-size: 15.5px; }

/*
 * A payment that came back unpaid.
 *
 * Red enough to be noticed, not so red it reads as "you have been charged and
 * something is wrong" — nothing has been charged, and the message says so
 * first. The provider's own wording is smaller because it is for the office,
 * not for the parent.
 */
.cpay-payment-failed {
	margin: 0 0 20px;
	padding: 14px 16px;
	border: 1px solid var( --crp-primary, #1e5c48 );
	border-left-width: 4px;
	border-radius: 6px;
	background: #fff6f6;
}

.cpay-payment-failed strong {
	display: block;
	margin-bottom: 6px;
}

.cpay-payment-failed p {
	margin: 0 0 6px;
}

.cpay-payment-failed .cpay-failed-detail {
	margin: 10px 0 0;
	font-size: 0.875em;
	opacity: 0.75;
}
