/**
 * BuyTides Child — /affiliate-registration/ full-canvas page.
 *
 * The page is a split canvas: a white pane carrying the logo, the copy and the
 * Affiliate For WooCommerce registration form, beside a navy panel. The form
 * itself is still the plugin's ([afwc_registration_form]) — every rule below
 * restyles and re-sequences what the plugin renders rather than replacing it,
 * so adding or hiding a field in WooCommerce > Settings > Affiliate keeps
 * working.
 *
 * Loaded only on that page by inc/affiliate-registration.php.
 */

/* ---------------------------------------------------------------- canvas -- */

body.buytides-affiliate-registration {
	background: #EDF1F4;
	font-family: Inter, system-ui, sans-serif;
	color: #2B3754;
	-webkit-font-smoothing: antialiased;
}

/* templates/page-affiliate-registration.html hands us <main> straight inside
   .wp-site-blocks, with no header and no footer. Strip theme.json's root
   padding and content width so the two panes can go edge to edge. */
body.buytides-affiliate-registration .af-canvas,
body.buytides-affiliate-registration .af-canvas > .entry-content {
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
}
body.buytides-affiliate-registration .af-canvas > .entry-content > * {
	margin-block: 0 !important;
	max-width: none !important;
}
body.buytides-affiliate-registration ::selection { background: #6FE4F2; color: #2B3754; }

/* The cart drawer ships with the sitewide chrome, but this page has no header
   and so no way to open it. Left in place its off-canvas shadow bleeds down the
   right edge of the white pane, so it goes with the rest of the chrome. */
body.buytides-affiliate-registration .bt-drawer,
body.buytides-affiliate-registration .bt-drawer__scrim { display: none; }

/* Group blocks carry theme.json's blockGap as a top margin on every sibling
   after the first. Both panes are laid out here by grid or flex, so that
   inherited gap is stripped and `gap` stays the single source of spacing. */
.af-reg > *,
.af-reg__pane > *,
.af-reg__inner > * { margin-block: 0 !important; }

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

.af-reg {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 100vh;
	gap: 0;
}
@supports ( min-height: 100dvh ) {
	.af-reg { min-height: 100dvh; }
}
@media ( max-width: 1080px ) {
	.af-reg { grid-template-columns: 1.05fr .95fr; }
}

/* ------------------------------------------------------------- left pane -- */

.af-reg__pane {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	padding: clamp(32px, 5vw, 64px) clamp(24px, 5vw, 72px);
	overflow-y: auto;
}
.af-reg__inner {
	width: 100%;
	max-width: 460px;
}

.af-reg__logo {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: clamp(9px, 1vw, 14px);
	margin: 0 0 clamp(22px, 2.4vw, 30px);
	text-decoration: none;
}
.af-reg__logo img { display: block; width: auto; }
.af-reg__logo .af-reg__mark { height: clamp(28px, 2.8vw, 34px); }
.af-reg__logo .af-reg__wordmark { display: block; flex: 0 0 auto; height: 30px; }

.af-reg__title {
	margin: 0 0 8px !important;
	font-family: Outfit, sans-serif;
	font-size: clamp(27px, 2.6vw, 32px);
	font-weight: 600;
	letter-spacing: -.026em;
	line-height: 1.1;
	color: #2B3754;
}
.af-reg__sub {
	margin: 0 0 20px !important;
	font-size: 14.5px;
	line-height: 1.5;
	color: #4B6479;
	text-wrap: pretty;
}
.af-reg__login {
	margin: 14px 0 0 !important;
	font-size: 13.5px;
	line-height: 1.5;
	color: #7C93A3;
}
.af-reg a { color: #1B7FA8; text-decoration: none; font-weight: 600; }
.af-reg a:hover { color: #2B3754; }

/* --------------------------------------------------- the plugin's form -- */

.af-reg .afwc_reg_form_wrapper { width: 100%; max-width: none; }

/* Two-up name row, two-up password row, everything else full width, in the
   design's reading order. Grid honours `order`, so the plugin's DOM sequence
   (email, first, last, contact, website, password, confirm, why, terms) is
   re-sequenced without touching the plugin. */
#afwc_registration_form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 13px 12px;
	margin: 0;
}
.af-reg .afwc_reg_field_wrapper {
	order: 9;               /* the submit row, which carries no field class */
	grid-column: 1 / -1;
	margin: 0;
	min-width: 0;
}
.af-reg .afwc_reg_first_name      { order: 1; }
.af-reg .afwc_reg_last_name       { order: 2; }
.af-reg .afwc_reg_email           { order: 3; }
.af-reg .afwc_reg_contact         { order: 4; }
.af-reg .afwc_reg_desc            { order: 5; }
.af-reg .afwc_reg_password        { order: 6; }
.af-reg .afwc_reg_confirm_password { order: 7; }
.af-reg .afwc_reg_terms           { order: 8; }
.af-reg .afwc_reg_message         { order: 10; grid-column: 1 / -1; }

/* The plugin sizes its half fields with width:50% + inline-block; inside the
   grid the column does that job. */
.af-reg .afwc_is_half {
	grid-column: span 1;
	width: auto;
	display: block;
}
.af-reg .afwc_hide_form_field { display: none; }

/* ---------------------------------------------------------------- fields -- */

.af-reg .afwc_reg_field_wrapper > label {
	display: block;
	margin: 0 0 5px;
	padding: 0;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	color: #33415E;
}
.af-reg .afwc_reg_field_wrapper > label.afwc_required::after { color: #C2703C; }

.af-reg .afwc_reg_form_field:not([type="checkbox"]):not([type="submit"]) {
	box-sizing: border-box;
	display: block;
	width: 100% !important;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1.5px solid #DDE7EE;
	border-radius: 12px;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: 14px center;
	background-size: 18px 18px;
	font-family: Inter, system-ui, sans-serif;
	font-size: 15.5px;
	line-height: 1.4;
	/* The loyalty plugin's utils.min.css forces color:#1F2122 !important on
	   every input on the site, so the brand navy has to be restated the same
	   way. Same reason the submit label below is !important white. */
	color: #2B3754 !important;
	box-shadow: none;
	appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.af-reg textarea.afwc_reg_form_field {
	height: auto;
	min-height: 88px;
	padding: 14px;
	line-height: 1.5;
	resize: vertical;
}
.af-reg .afwc_reg_form_field:focus {
	border-color: #61DDEB;
	box-shadow: 0 0 0 3px rgba(97, 221, 235, .22);
	outline: none;
}
/* The placeholders are added to the plugin's markup by inc/affiliate-registration.php.
   They step aside the moment the field is focused, so the example never sits
   under what is being typed. */
.af-reg .afwc_reg_form_field::placeholder {
	color: #A8BCC7;
	opacity: 1;
	transition: opacity .15s ease;
}
.af-reg .afwc_reg_form_field:focus::placeholder { opacity: 0; }

/* Leading glyphs, drawn as background images so the plugin's markup is left
   alone. The padding shifts the caret clear of the icon. */
.af-reg #afwc_reg_email,
.af-reg #afwc_reg_contact,
.af-reg #afwc_reg_password,
.af-reg #afwc_reg_confirm_password { padding-left: 44px; }

.af-reg #afwc_reg_email {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C93A3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4.5' width='19' height='15' rx='2.5'/%3E%3Cpath d='M3 6.5l9 6.5 9-6.5'/%3E%3C/svg%3E" );
}
.af-reg #afwc_reg_contact {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C93A3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M12 3c2.6 3 2.6 15 0 18M12 3c-2.6 3-2.6 15 0 18'/%3E%3C/svg%3E" );
}
.af-reg #afwc_reg_password,
.af-reg #afwc_reg_confirm_password {
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C93A3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10.5' width='16' height='10.5' rx='2.5'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 018 0v3'/%3E%3C/svg%3E" );
}

/* ------------------------------------------------- password affordances -- */

/* .af-input is added by assets/js/affiliate-registration.js, which wraps each
   password input so the reveal button has something to sit inside. Without the
   script the field still renders — it just has no eye and no meter. */
.af-reg .af-input { position: relative; display: block; }
.af-reg .af-input .af-eye {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	appearance: none;
	border: 0;
	background: none;
	padding: 4px;
	color: #7C93A3;
	cursor: pointer;
}
.af-reg .af-input .af-eye:hover { color: #1B7FA8; }
.af-reg .af-input input { padding-right: 44px; }

.af-reg .af-strength { display: flex; gap: 5px; margin-top: 9px; }
.af-reg .af-strength span {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: #EDF1F4;
	transition: background .15s ease;
}
.af-reg .af-strength-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 7px;
	font-size: 12.5px;
	color: #7C93A3;
}
.af-reg .af-strength-meta b { font-weight: 600; }
.af-reg .af-mismatch {
	display: none;
	margin-top: 7px;
	font-size: 12.5px;
	font-weight: 600;
	color: #C2703C;
}
.af-reg .af-mismatch.is-shown { display: block; }

/* ------------------------------------------------------------ checkboxes -- */

.af-reg .afwc_reg_terms > label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: #4B6479;
	cursor: pointer;
}
.af-reg .afwc_reg_terms > label.afwc_required::after { content: none; }
.af-reg #afwc_reg_terms {
	appearance: none;
	flex: 0 0 auto;
	width: 19px;
	height: 19px;
	margin: 1px 0 0;
	border: 1.5px solid #DDE7EE;
	border-radius: 5px;
	background: #fff no-repeat center / 12px 12px;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.af-reg #afwc_reg_terms:checked {
	border-color: #61DDEB;
	background-color: #61DDEB;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B3754' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4.5 4.5L19 7'/%3E%3C/svg%3E" );
}
.af-reg #afwc_reg_terms:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(97, 221, 235, .22);
}

/* ---------------------------------------------------------------- submit -- */

/* .af-cta is added by the script: it wraps the plugin's submit input together
   with the arrow so the pair centres as one, which a bare input cannot do. The
   plugin's own JS disables that input while the request is in flight, so the
   input is kept rather than replaced by a <button>. */
.af-reg .af-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 52px;
	border-radius: 12px;
	background: #2B3754;
	color: #fff;
	cursor: pointer;
	transition: background .15s ease;
}
.af-reg .af-cta:hover { background: #3A4A6D; }
.af-reg .af-cta:active { background: #1E2740; }
.af-reg .af-cta:has( input:disabled ) { background: #55607A; cursor: default; }
.af-reg .afwc_registration_form_submit {
	width: auto !important;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #fff !important;
	-webkit-text-fill-color: #fff;
	font-family: Outfit, sans-serif;
	font-size: 16.5px;
	font-weight: 600;
	letter-spacing: -.01em;
	cursor: inherit;
	appearance: none;
}
.af-reg .af-cta svg { display: block; flex: 0 0 auto; }

/* Without the script the input is never wrapped, so it stays a direct child of
   the field wrapper and has to look like the button on its own. */
.af-reg .afwc_reg_field_wrapper > .afwc_registration_form_submit {
	width: 100% !important;
	height: 52px;
	border-radius: 12px;
	background: #2B3754;
}

.af-reg .afwc_reg_loader { padding-left: .5em; vertical-align: middle; }

/* --------------------------------------------------------------- message -- */

.af-reg .afwc_reg_message {
	margin: 0;
	padding: 13px 15px;
	border-radius: 12px;
	border: 1.5px solid #DDE7EE;
	background: #F7FAFC;
	font-size: 14px;
	line-height: 1.5;
	color: #2B3754;
}
.af-reg .afwc_reg_message.error { border-color: #E9C3A6; background: #FDF5EF; color: #A2531F; }
.af-reg .afwc_reg_message.success { border-color: #9FE4F0; background: #F0FBFD; }

/* Shown instead of the form to someone who has already applied. */
.af-reg .afwc-reg-form-msg {
	margin: 0;
	padding: 18px 20px;
	border-radius: 14px;
	border: 1.5px solid #DDE7EE;
	background: #F7FAFC;
	font-size: 15px;
	line-height: 1.55;
	color: #2B3754;
}

/* ------------------------------------------------------------ right pane -- */

.af-reg__aside {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #2B3754;
	background-image:
		radial-gradient( 115% 85% at 82% 8%, #376385 0%, rgba(43, 55, 84, 0) 62% ),
		radial-gradient( 90% 70% at 10% 100%, #2F4969 0%, rgba(43, 55, 84, 0) 70% );
}
@supports ( height: 100dvh ) {
	.af-reg__aside { height: 100dvh; }
}
.af-reg__aside::after {
	content: "";
	position: absolute;
	top: -90px;
	right: -90px;
	width: 340px;
	height: 340px;
	border-radius: 50%;
	background: radial-gradient( circle, rgba(97, 221, 235, .22) 0%, rgba(97, 221, 235, 0) 70% );
	pointer-events: none;
}

/* The copy that sells the program. It is the only place on the page carrying
   the program's terms in prose, so it is real content rather than decoration:
   it stays in the DOM on mobile (below the form) instead of being hidden, and
   the aside is the clipping shell while this scroller handles overflow. */
.af-aside {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-height: 100%;
	overflow-y: auto;
	padding: clamp(36px, 5vh, 64px) clamp(28px, 3.5vw, 56px);
	color: #E4EDF3;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.af-aside::-webkit-scrollbar { width: 6px; }
.af-aside::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(255, 255, 255, .22); }

.af-aside__eyebrow {
	margin: 0 0 12px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #6FE4F2;
}
.af-aside__title {
	margin: 0 0 12px;
	font-family: Outfit, sans-serif;
	font-size: clamp(26px, 2.5vw, 34px);
	font-weight: 600;
	letter-spacing: -.026em;
	line-height: 1.14;
	color: #fff;
	text-wrap: balance;
}
.af-aside__lede {
	margin: 0 0 26px;
	font-size: 15px;
	line-height: 1.6;
	color: #B7CBDA;
	text-wrap: pretty;
}

.af-aside__list {
	margin: 0 0 26px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 18px;
}
.af-aside__list li {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	margin: 0;
}
.af-aside__ico {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid rgba(111, 228, 242, .28);
	background: rgba(111, 228, 242, .12);
	color: #6FE4F2;
}
.af-aside__ico svg { display: block; width: 18px; height: 18px; }
.af-aside__list b {
	display: block;
	margin-bottom: 3px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #fff;
}
.af-aside__list p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: #A9BFD0;
	text-wrap: pretty;
}

.af-aside__stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 26px;
	padding: 16px 0;
	border-top: 1px solid rgba(255, 255, 255, .12);
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.af-aside__stat b {
	display: block;
	font-family: Outfit, sans-serif;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -.02em;
	color: #6FE4F2;
}
.af-aside__stat span {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.4;
	color: #9DB4C6;
}

.af-aside__h3 {
	margin: 0 0 8px;
	font-family: Outfit, sans-serif;
	font-size: 16.5px;
	font-weight: 600;
	letter-spacing: -.014em;
	color: #fff;
}
.af-aside__p {
	margin: 0 0 22px;
	font-size: 13.5px;
	line-height: 1.6;
	color: #A9BFD0;
	text-wrap: pretty;
}
.af-aside__foot {
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 13px;
	line-height: 1.55;
	color: #8FA7BA;
}
.af-reg .af-aside a { color: #6FE4F2; }
.af-reg .af-aside a:hover { color: #fff; }

/* ------------------------------------------------------------ short view -- */

/* The form is tall. On a short desktop window the copy and the meter give way
   before the fields start scrolling. */
@media ( min-width: 701px ) and ( max-height: 900px ) {
	.af-reg__pane { padding-top: 24px; padding-bottom: 24px; }
	.af-reg__logo { margin-bottom: 14px; }
	.af-reg__sub { display: none; }
	.af-reg__title { margin-bottom: 14px !important; font-size: 26px; }
	.af-reg .af-strength,
	.af-reg .af-strength-meta { display: none; }
	.af-reg .afwc_reg_form_field:not([type="checkbox"]):not([type="submit"]) { height: 44px; font-size: 14.5px; }
	.af-reg textarea.afwc_reg_form_field { height: auto; min-height: 72px; }
	#afwc_registration_form { gap: 9px 12px; }
	.af-reg .af-cta { height: 46px; }

	/* The aside scrolls rather than losing copy, but it starts tighter. */
	.af-aside { padding-block: 32px; }
	.af-aside__title { font-size: 26px; }
	.af-aside__lede { margin-bottom: 20px; font-size: 14px; }
	.af-aside__list { gap: 14px; margin-bottom: 20px; }
	.af-aside__stats { margin-bottom: 20px; }
	.af-aside__p { margin-bottom: 18px; }
}
@media ( min-width: 701px ) and ( max-height: 640px ) {
	.af-reg__pane { padding-top: 16px; padding-bottom: 16px; align-items: flex-start; }
	.af-reg__logo { margin-bottom: 10px; }
	.af-reg__title { font-size: 23px; margin-bottom: 10px !important; }
	.af-reg .afwc_reg_form_field:not([type="checkbox"]):not([type="submit"]) { height: 40px; }
	.af-reg textarea.afwc_reg_form_field { height: auto; min-height: 60px; }
	#afwc_registration_form { gap: 7px 12px; }
	.af-reg .afwc_reg_field_wrapper > label { margin-bottom: 3px; font-size: 12px; }
	.af-reg__login { display: none; }
}

/* ---------------------------------------------------------------- mobile -- */

@media ( max-width: 700px ) {
	.af-reg {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 100dvh;
	}
	/* The aside carries the program's terms, so on a phone it drops below the
	   form as an ordinary section instead of being hidden — same markup, still
	   in the document for search and for anyone reading on mobile. */
	.af-reg__aside {
		position: static;
		height: auto;
		overflow: visible;
		align-items: flex-start;
	}
	.af-aside {
		max-width: none;
		max-height: none;
		overflow-y: visible;
		padding: 40px 22px 48px;
	}
	.af-aside__stats { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.af-reg__pane {
		overflow-y: visible;
		align-items: flex-start;
		padding: 32px 22px 44px;
	}
	.af-reg__logo { margin-bottom: 30px; }
	.af-reg__logo .af-reg__mark { height: 24px; }
	.af-reg__logo .af-reg__wordmark { height: 22px; }
	.af-reg__title { font-size: 28px; }
	.af-reg__sub { font-size: 15px; }
	#afwc_registration_form { grid-template-columns: minmax(0, 1fr); }
	.af-reg .afwc_is_half { grid-column: 1 / -1; }
	.af-reg .afwc_reg_form_field:not([type="checkbox"]):not([type="submit"]) { height: 52px; }
}
