/*
 * rsg-signup.css — the /start form (NWB-RSG-023). Loads after rsg-pages.css (the shell).
 * Mobile-first. Island Pitch tokens: island-orange #FF8F05, island-black #030400,
 * island-white #F7F7FC, deep-sea #01579B, sunset-gold #FFD54F. On the white page the text
 * and control colours are chosen for AA: deep-sea on white 8.6:1, island-white on island-black
 * 19:1, #767676 borders 4.5:1, error #a4161a 6.6:1. Orange and gold are accents only (never the
 * sole cue, never small text on white).
 */
.nwb-rsg-page--start {
	--rsg-orange: #FF8F05;
	--rsg-black: #030400;
	--rsg-white: #F7F7FC;
	--rsg-sea: #01579B;
	--rsg-gold: #FFD54F;
	--rsg-border: #767676;
	--rsg-error: #a4161a;
	--rsg-focus: #01579B;
}

.rsg-signup {
	margin: 24px 0 0;
}

.rsg-field {
	margin: 0 0 24px;
}

.rsg-field label,
.rsg-fieldset legend {
	display: block;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 4px;
}

.rsg-hint {
	margin: 0 0 8px;
	color: #3a3a3a;
	font-size: 1rem;
}

.rsg-signup input[type="email"],
.rsg-signup input[type="text"],
.rsg-signup input[type="password"],
.rsg-signup select {
	box-sizing: border-box;
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 12px;
	border: 2px solid var(--rsg-border, #767676);
	border-radius: 8px;
	background: #fff;
	color: var(--rsg-black, #030400);
	font: inherit;
	font-size: 1rem; /* never below 16px: no iOS zoom */
	line-height: 1.4;
}

.rsg-signup select {
	appearance: none;
	-webkit-appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--rsg-black, #030400) 50%), linear-gradient(135deg, var(--rsg-black, #030400) 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

.rsg-signup [aria-invalid="true"] {
	border-color: var(--rsg-error, #a4161a);
	border-width: 3px;
}

.rsg-signup input:focus-visible,
.rsg-signup select:focus-visible,
.rsg-signup button:focus-visible,
.rsg-signup a:focus-visible,
.rsg-signup-errors:focus-visible,
.rsg-signup-errors a:focus-visible {
	outline: 3px solid var(--rsg-focus, #01579B);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--rsg-gold, #FFD54F);
}

.rsg-signup-errors:focus {
	outline: 3px solid var(--rsg-focus, #01579B);
	outline-offset: 2px;
}

/* Checkboxes: the box is 28px, the label row is the 44px target. */
.rsg-fieldset {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.rsg-fieldset legend {
	padding: 0;
	margin-bottom: 8px;
}

.rsg-check {
	margin-bottom: 4px;
}

.rsg-check-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.rsg-check-row input[type="checkbox"] {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	margin: 0;
	accent-color: var(--rsg-sea, #01579B);
	cursor: pointer;
}

.rsg-check-row label {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-height: 44px;
	margin: 0;
	padding: 8px 0;
	font-weight: 400;
	cursor: pointer;
}

/* The web-address preview. */
.rsg-slug-preview {
	margin: 0 0 8px;
	padding: 8px 12px;
	border-left: 4px solid var(--rsg-orange, #FF8F05);
	background: #f3f4f6;
	overflow-wrap: anywhere;
}

/* Inline errors: text + colour + a heavier border (never colour alone). */
.rsg-error {
	margin: 0 0 8px;
	padding-left: 12px;
	border-left: 4px solid var(--rsg-error, #a4161a);
	color: var(--rsg-error, #a4161a);
	font-weight: 700;
}

.rsg-link-button {
	display: inline-block;
	min-height: 44px;
	margin: 4px 0 0;
	padding: 10px 12px;
	border: 2px solid var(--rsg-sea, #01579B);
	border-radius: 8px;
	background: #fff;
	color: var(--rsg-sea, #01579B);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

/* The error summary (focused on a failed submit). */
.rsg-signup-errors {
	margin: 0 0 24px;
	padding: 16px;
	border: 4px solid var(--rsg-error, #a4161a);
	border-radius: 8px;
}

.rsg-signup-errors h2 {
	margin: 0 0 8px;
	font-size: 1.25rem;
}

.rsg-signup-errors ul {
	margin: 0;
	padding-left: 20px;
}

.rsg-signup-errors a {
	display: inline-block;
	min-height: 44px;
	padding: 10px 0;
	box-sizing: border-box;
	color: var(--rsg-error, #a4161a);
	font-weight: 700;
}

.rsg-signup-errors[hidden] {
	display: none;
}

/* Submit: black on white page, white text, orange underline accent on hover. */
.rsg-signup-submit {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 8px 0 16px;
	padding: 12px 20px;
	border: 2px solid var(--rsg-black, #030400);
	border-radius: 9999px;
	background: var(--rsg-black, #030400);
	color: var(--rsg-white, #F7F7FC);
	font: inherit;
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

.rsg-signup-submit:hover {
	background: var(--rsg-sea, #01579B);
	border-color: var(--rsg-sea, #01579B);
}

.rsg-signup-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.rsg-signup-signin {
	margin: 0;
}

.rsg-signup-signin a {
	display: inline-block;
	min-height: 44px;
	padding: 10px 0;
	box-sizing: border-box;
}

/* Honeypot: off-screen for people, out of the tab order (tabindex -1), hidden from AT (aria-hidden). */
.rsg-signup-hp {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rsg-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

@media (min-width: 640px) {
	.rsg-signup-submit {
		width: auto;
		min-width: 240px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rsg-signup-submit,
	.rsg-signup * {
		transition: none !important;
		animation: none !important;
	}
}
