/*
 * Registration form.
 *
 * Follows the "Créer un compte" mockup: a white panel held against the right
 * edge of a full-bleed photograph, carrying underlined fields paired across a
 * 6-column grid, with the label above the rule rather than inside a box.
 */

/* Screen ------------------------------------------------------------------ */

/* The page keeps its own scrollbar, but the 100vw section below is a hair
   wider than the content box it escapes, which would otherwise add a second
   one along the bottom. */
body.iep-registration-page {
	overflow-x: hidden;
}

/*
 * The shortcode renders inside the theme's centred container, so the section
 * is pulled back out to the edges of the viewport rather than the container's.
 * The flat colour is what shows while the photograph loads, sampled from it so
 * the transition is not a flash of white.
 */
.iep-registration-screen {
	align-items: center;
	background-color: #ded5c9;
	background-image: var( --iep-registration-image );
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	box-sizing: border-box;
	display: flex;
	justify-content: flex-end;
	margin-left: calc( 50% - 50vw );
	min-height: min( 100vh, 56rem );
	padding: 2.5rem;
	width: 100vw;
}

.iep-registration-panel {
	background: #fff;
	box-sizing: border-box;
	max-width: 100%;
	padding: clamp( 2rem, 5vw, 3.5rem ) clamp( 1.5rem, 6vw, 6rem ) clamp( 2.5rem, 6vw, 5rem );
	width: 40rem;
}

/* Below the two-column breakpoint the panel takes the whole screen: at that
   width a photograph behind it is never more than a sliver. */
@media ( max-width: 60rem ) {
	.iep-registration-screen {
		justify-content: center;
		min-height: 0;
		padding: 0;
	}

	.iep-registration-panel {
		width: 100%;
	}
}

.iep-registration {
	--iep-rule: rgba( 0, 0, 0, 0.18 );
	--iep-muted: rgba( 0, 0, 0, 0.55 );
	--iep-accent: #c8892f;
	font-family: "neue-haas-unica", "Neue Haas Unica", "Helvetica Neue", Arial, sans-serif;
	margin: 0;
	max-width: none;
}

/* Header ------------------------------------------------------------------ */

/* IvyPresto Display is self-hosted by the child theme at a single weight —
   100 — which is the weight the rest of the site sets it in. */
.iep-registration__title {
	font-family: "ivypresto-display", Georgia, serif;
	font-size: clamp( 2.5rem, 5vw, 4.25rem );
	font-weight: 100;
	letter-spacing: -0.01em;
	line-height: 1.05;
	margin: 0 0 1.5rem;
}

.iep-registration__signin {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	justify-content: space-between;
	margin: 0 0 3.5rem;
}

.iep-registration__signin a {
	color: var( --iep-accent );
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* Field grid -------------------------------------------------------------- */

.iep-registration__grid {
	display: grid;
	gap: 1.5rem 2.25rem;
	grid-template-columns: repeat( 6, 1fr );
}

.iep-registration .iep-field {
	margin: 0;
	min-width: 0;
}

.iep-field--full {
	grid-column: span 6;
}

.iep-field--half {
	grid-column: span 3;
}

.iep-field--third {
	grid-column: span 2;
}

@media ( max-width: 40rem ) {
	.iep-field--half,
	.iep-field--third {
		grid-column: span 6;
	}
}

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

.iep-registration .iep-field label {
	color: var( --iep-muted );
	display: block;
	font-size: 0.875rem;
	font-weight: 400;
	margin-bottom: 0.5rem;
}

.iep-registration .iep-required {
	color: var( --iep-accent );
}

.iep-registration input[type="text"],
.iep-registration input[type="email"],
.iep-registration input[type="tel"],
.iep-registration select {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var( --iep-rule );
	border-radius: 0;
	box-shadow: none;
	font-size: 1rem;
	padding: 0 0 0.6rem;
	width: 100%;
}

.iep-registration input[type="text"]:focus,
.iep-registration input[type="email"]:focus,
.iep-registration input[type="tel"]:focus,
.iep-registration select:focus {
	border-bottom-color: currentColor;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

/* The focus outline above is transparent so the underline can carry the
   state; forced-colours modes drop that treatment and need a real outline. */
@media ( forced-colors: active ) {
	.iep-registration input:focus,
	.iep-registration select:focus {
		outline-color: Highlight;
	}
}

.iep-registration .iep-field-hint {
	color: var( --iep-muted );
	display: block;
	font-size: 0.8125rem;
	margin-top: 0.4rem;
}

.iep-registration .iep-field-error {
	color: #b32d2e;
	display: block;
	font-size: 0.8125rem;
	margin-top: 0.4rem;
}

.iep-registration .iep-field:has( .iep-field-error ) input,
.iep-registration .iep-field:has( .iep-field-error ) select {
	border-bottom-color: #b32d2e;
}

/* Actions ----------------------------------------------------------------- */

.iep-registration__actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	justify-content: space-between;
	margin: 3.5rem 0 1.75rem;
}

.iep-registration .iep-button {
	background: #111;
	border: 0;
	border-radius: 0;
	color: #fff;
	cursor: pointer;
	font-size: 0.9375rem;
	letter-spacing: 0.08em;
	padding: 1rem 2.25rem;
	text-transform: uppercase;
}

.iep-registration .iep-button:hover,
.iep-registration .iep-button:focus {
	background: #333;
}

/* Newsletter toggle ------------------------------------------------------- */

.iep-toggle {
	align-items: center;
	cursor: pointer;
	display: inline-flex;
	gap: 0.75rem;
}

/* Visually hidden, but still the element that takes focus and holds the
   checked state — the track beside it is painted from sibling selectors. */
.iep-toggle input {
	height: 1px;
	margin: 0;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.iep-toggle__track {
	background: rgba( 0, 0, 0, 0.15 );
	border-radius: 999px;
	display: block;
	flex: 0 0 auto;
	height: 1.5rem;
	position: relative;
	transition: background 0.15s ease;
	width: 2.75rem;
}

.iep-toggle__track::after {
	background: #fff;
	border-radius: 50%;
	content: "";
	height: 1.125rem;
	left: 0.1875rem;
	position: absolute;
	top: 0.1875rem;
	transition: transform 0.15s ease;
	width: 1.125rem;
}

.iep-toggle input:checked + .iep-toggle__track {
	background: #111;
}

.iep-toggle input:checked + .iep-toggle__track::after {
	transform: translateX( 1.25rem );
}

.iep-toggle input:focus-visible + .iep-toggle__track {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.iep-toggle__label {
	font-size: 0.9375rem;
}

@media ( prefers-reduced-motion: reduce ) {
	.iep-toggle__track,
	.iep-toggle__track::after {
		transition: none;
	}
}

/* Consent ----------------------------------------------------------------- */

.iep-registration__consent {
	color: var( --iep-muted );
	font-size: 0.8125rem;
	line-height: 1.6;
	margin: 0;
}

.iep-registration__consent a {
	color: inherit;
	text-decoration: underline;
}

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

.iep-registration .iep-hp {
	left: -9999px;
	position: absolute;
}

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

.iep-notice {
	border-left: 4px solid;
	margin: 0 0 1.5rem;
	padding: 0.75rem 1rem;
}

.iep-notice--error {
	border-color: #b32d2e;
	background: #fdf0f0;
}

.iep-notice--success {
	border-color: #3a7d44;
	background: #f0f7f1;
}

.iep-notice--info {
	border-color: #2271b1;
	background: #f0f6fc;
}
