/* GAP — Member registration
   Colours and geometry come from tokens.css, shared with the member profile
   form, so the two look like one system. No inline styles are used for
   layout or visibility: everything here is overridable by a later rule. */

.gap-reg {
	max-width: 720px;
	margin: 0 auto;
	color: var(--gap-ink);
	font-size: 15px;
	line-height: 1.55;
}

/* --- Notices -------------------------------------------------------- */

.gap-reg-notice {
	padding: 13px 16px;
	margin: 0 0 20px;
	background: var(--gap-tint);
	border-left: 3px solid var(--gap-navy);
	border-radius: 0 var(--gap-radius) var(--gap-radius) 0;
	font-size: 14px;
}

.gap-reg-notice--error {
	background: #fdeeed;
	border-left-color: var(--gap-err);
}

.gap-reg-notice--invite { border-left-color: var(--gap-accent); }

/* --- Progress rail --------------------------------------------------- */

.gap-reg-progress {
	display: flex;
	gap: 4px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.gap-reg-progress__item {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 0 10px;
	border-bottom: 2px solid var(--gap-line);
	font-size: 12.5px;
	color: var(--gap-mute);
	min-width: 0;
}

.gap-reg-progress__item.is-current {
	border-bottom-color: var(--gap-accent);
	color: var(--gap-navy);
	font-weight: 600;
}

.gap-reg-progress__item.is-done {
	border-bottom-color: var(--gap-navy);
	color: var(--gap-navy);
}

.gap-reg-progress__num {
	flex: none;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--gap-line);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.gap-reg-progress__item.is-current .gap-reg-progress__num { background: var(--gap-accent); }
.gap-reg-progress__item.is-done .gap-reg-progress__num { background: var(--gap-navy); }

.gap-reg-progress__label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 600px) {
	.gap-reg-progress__label { display: none; }
	.gap-reg-progress__item { justify-content: center; }
}

/* --- Steps ----------------------------------------------------------- */

.gap-reg-step__title {
	margin: 0 0 6px;
	font-size: 21px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--gap-navy);
}

.gap-reg-step__intro {
	margin: 0 0 22px;
	color: var(--gap-mute);
	max-width: 62ch;
}

/* --- Document panel -------------------------------------------------- */

.gap-reg-doc {
	border: 1px solid var(--gap-line);
	border-radius: var(--gap-radius);
	overflow: hidden;
	margin-bottom: 22px;
}

.gap-reg-doc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 14px;
	background: var(--gap-sunk);
	border-bottom: 1px solid var(--gap-line);
}

.gap-reg-doc__title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--gap-navy);
}

/* Styled as a button — this is the action that unlocks the signature,
   so it needs to read as the primary thing to do on this step. */
.gap-reg-doc__open {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 16px;
	border: 1px solid var(--gap-navy);
	border-radius: var(--gap-radius);
	background: var(--gap-navy);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.12s;
}

.gap-reg-doc__open:hover,
.gap-reg-doc__open:focus {
	background: var(--gap-navy-lo);
	border-color: var(--gap-navy-lo);
	color: #fff;
	text-decoration: none;
}

.gap-reg-doc__open:focus-visible {
	outline: none;
	box-shadow: var(--gap-focus-ring);
}

/* Once opened it steps back — the job is done, the signature is next. */
.gap-reg-doc.is-opened .gap-reg-doc__open {
	background: transparent;
	border-color: var(--gap-line);
	color: var(--gap-mute);
	font-weight: 400;
}

.gap-reg-doc.is-opened .gap-reg-doc__open:hover {
	border-color: var(--gap-navy);
	color: var(--gap-navy);
	background: transparent;
}

.gap-reg-doc__frame {
	display: block;
	width: 100%;
	height: 460px;
	border: 0;
	background: #fff;
}

@media (max-width: 600px) {
	/* Mobile browsers rarely render PDFs in an iframe usefully — the panel
	   shrinks and the "Open in a new tab" link does the real work. */
	.gap-reg-doc__frame { height: 220px; }
}

.gap-reg-doc__gate {
	margin: 0;
	padding: 9px 14px;
	background: #fdf3ea;
	border-top: 1px solid var(--gap-line);
	font-size: 13px;
	color: #8a5220;
}

.gap-reg-doc.is-opened .gap-reg-doc__gate {
	background: #eef7f2;
	color: var(--gap-ok);
}

/* --- Fields ---------------------------------------------------------- */

.gap-reg-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 18px;
}

.gap-reg-field {
	grid-column: 1 / -1;
	margin-bottom: 18px;
	transition: opacity 0.15s;

	/* Column layout with the control pushed to the bottom. Without this,
	   a field carrying help text (Password) sits lower than the one beside
	   it (Confirm password) and the two inputs do not line up. */
	display: flex;
	flex-direction: column;
}

.gap-reg-field > input,
.gap-reg-field > .gap-reg-sig {
	margin-top: auto;
}

/* Equal-height inputs across the board — a fixed line-height means the box
   is the same size whether or not the browser has its own opinion. */
.gap-reg input[type="text"],
.gap-reg input[type="email"],
.gap-reg input[type="password"] {
	line-height: 1.5;
	height: calc( 1.5em + ( var(--gap-field-pad-y) * 2 ) + 2px );
}

.gap-reg-field.is-half { grid-column: span 1; }

@media (max-width: 560px) {
	.gap-reg-field.is-half { grid-column: 1 / -1; }
}

/* Gated fields stay visible but inert, so the member can see what is
   coming rather than watching the form change shape under them. */
.gap-reg-field.is-gated {
	opacity: 0.45;
	pointer-events: none;
}

.gap-reg-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 6px;
	font-size: var(--gap-label-size);
	font-weight: 600;
}

.gap-reg-label em {
	font-style: normal;
	font-weight: 400;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--gap-accent);
}

.gap-reg-help {
	margin: -2px 0 7px;
	font-size: 13px;
	color: var(--gap-mute);
}

.gap-reg input[type="text"],
.gap-reg input[type="email"],
.gap-reg input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: var(--gap-field-pad-y) var(--gap-field-pad-x);
	border: 1px solid var(--gap-line);
	border-radius: var(--gap-radius);
	background: var(--gap-field);
	color: inherit;
	font: inherit;
	transition: border-color 0.12s, box-shadow 0.12s;
}

.gap-reg input:focus-visible {
	outline: none;
	border-color: var(--gap-navy);
	box-shadow: var(--gap-focus-ring);
}

.gap-reg input[readonly] {
	background: var(--gap-sunk);
	color: var(--gap-mute);
}

.gap-reg-field.has-error input { border-color: var(--gap-err); }

.gap-reg-error {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--gap-err);
}

/* --- Signature pad --------------------------------------------------- */

.gap-reg-sig { position: relative; }

.gap-reg-sig__pad {
	display: block;
	width: 100%;
	height: 170px;
	border: 1px dashed var(--gap-line);
	border-radius: var(--gap-radius);
	background: var(--gap-field);
	cursor: crosshair;
	/* Without this, dragging to sign scrolls the page on touch devices. */
	touch-action: none;
}

.gap-reg-sig__pad:focus-visible {
	outline: none;
	border-color: var(--gap-navy);
	box-shadow: var(--gap-focus-ring);
}

.gap-reg-sig__clear {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 4px 10px;
	border: 1px solid var(--gap-line);
	border-radius: var(--gap-radius);
	background: #fff;
	font: inherit;
	font-size: 12px;
	color: var(--gap-mute);
	cursor: pointer;
}

.gap-reg-sig__clear:hover {
	border-color: var(--gap-err);
	color: var(--gap-err);
}

/* --- Navigation ------------------------------------------------------ */

.gap-reg-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding-top: 6px;
}

.gap-reg-nav__error {
	flex: 1 1 100%;
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--gap-err);
}

.gap-reg-btn {
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 24px;
	border: 1px solid transparent;
	border-radius: var(--gap-radius);
	cursor: pointer;
	transition: background 0.12s;
}

.gap-reg-btn--primary {
	background: var(--gap-navy);
	color: #fff;
	text-decoration: none;
	display: inline-block;
}

.gap-reg-btn--primary:hover:not([disabled]) { background: var(--gap-navy-lo); }
.gap-reg-btn--primary[disabled] { opacity: 0.55; cursor: default; }

.gap-reg-btn--ghost {
	background: none;
	border-color: var(--gap-line);
	color: var(--gap-navy);
}

.gap-reg-btn--ghost:hover { border-color: var(--gap-navy); }

/* --- Honeypot -------------------------------------------------------- */

.gap-reg-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Completion ------------------------------------------------------ */

.gap-reg-done {
	padding: 26px;
	background: #eef7f2;
	border-left: 3px solid var(--gap-ok);
	border-radius: 0 var(--gap-radius) var(--gap-radius) 0;
}

.gap-reg-done h2 {
	margin: 0 0 8px;
	font-size: 19px;
	color: var(--gap-navy);
}

@media (prefers-reduced-motion: reduce) {
	.gap-reg *, .gap-reg *::before { transition: none !important; }
}

/* --- Turnstile ------------------------------------------------------- */

.gap-reg-turnstile {
	flex: 1 1 100%;
	margin-bottom: 12px;
	min-height: 65px;
}

/* --- Select ---------------------------------------------------------- */

.gap-reg select {
	width: 100%;
	box-sizing: border-box;
	padding: var(--gap-field-pad-y) 34px var(--gap-field-pad-y) var(--gap-field-pad-x);
	height: calc( 1.5em + ( var(--gap-field-pad-y) * 2 ) + 2px );
	border: 1px solid var(--gap-line);
	border-radius: var(--gap-radius);
	background-color: var(--gap-field);
	color: inherit;
	font: inherit;
	line-height: 1.5;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%235f6b7d' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--gap-field-pad-x) center;
	transition: border-color 0.12s, box-shadow 0.12s;
}

.gap-reg select:focus-visible {
	outline: none;
	border-color: var(--gap-navy);
	box-shadow: var(--gap-focus-ring);
}

.gap-reg-field.has-error select { border-color: var(--gap-err); }

/* Bottom-align selects with their neighbours, as inputs already are. */
.gap-reg-field > select { margin-top: auto; }
