/* ===================================================
   affiliate.css
   /affiliate-dashboard/ and /affiliate-program/.

   Loaded after motark-landing-system.css, so the --hp-* tokens are live and
   the legacy names already alias onto them. Everything is scoped under
   body.motark-textured plus a page body class, which clears the plugin's own
   stylesheet and the .prose rules in main.css without needing !important
   except where yith-wcaf.min.css sets the property directly.

   Deliberately no scroll-reveal classes: .reveal starts at opacity 0 and only
   clears via JS, which would hide the offer if JS fails.
   =================================================== */

/* Deliberately NOT var(--hp-font-cond) for the condensed labels. That token is
   'Barlow Condensed', 'DM Mono', sans-serif, so if Barlow Condensed fails to
   load (blocked Google Fonts, a privacy extension, a slow first paint) every
   label falls back to a monospace face. The `var(--token, fallback)` form does
   not help: the fallback only applies when the token is undefined, and it is
   always defined. So declare the stack directly. */
body.motark-textured {
	--aff-font-cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
}

/* ---------------------------------------------------
   Shared column. Both pages read as one narrow measure
   centred under the page title.
   --------------------------------------------------- */

body.motark-textured.motark-affiliate-program .page-content.prose,
body.motark-textured.motark-affiliate-dashboard .page-content.prose {
	max-width: 44rem;
	margin-left: auto;
	margin-right: auto;
}

/* page.php pads neither .page-article nor .page-content, so the terms list
   currently runs straight into the footer. */
body.motark-textured.motark-affiliate-program .page-article,
body.motark-textured.motark-affiliate-dashboard .page-article {
	padding-bottom: clamp(3rem, 7vw, 5rem);
}

/* Buttons injected into .page-content.prose inherit
   `.prose a { border-bottom: 1px solid ... }`. Clear it. */
body.motark-textured .page-content.prose a.btn,
body.motark-textured .page-content.prose a.btn:hover,
body.motark-textured .page-content.prose a.btn:focus {
	border-bottom: 0;
	text-decoration: none;
}

/* Steel, not ember. The apply CTAs are .btn--primary, which is an ember fill, so
   an ember focus ring on them is ember-on-ember at 1.0:1 and invisible to a
   keyboard user. Steel reads against both the ember button and the dark page,
   and the offset puts the ring on the page ground either way. */
body.motark-textured .page-content.prose a.btn:focus-visible {
	outline: 2px solid var(--hp-steel, #e4e6ea);
	outline-offset: 3px;
}

/* ---------------------------------------------------
   Program at a glance panel (above the signup form)
   --------------------------------------------------- */

body.motark-textured .affiliate-glance {
	margin: 0 0 clamp(2rem, 5vw, 3rem);
	padding: clamp(1.5rem, 4vw, 2.25rem);
	background: var(--motark-surface-panel, linear-gradient(165deg, rgba(26, 60, 42, 0.45) 0%, rgba(10, 14, 8, 0.78) 100%));
	border: 1px solid var(--motark-surface-border, rgba(228, 230, 234, 0.12));
	border-left: 3px solid var(--hp-ember, #f5a623);
	border-radius: 14px;
	box-shadow:
		var(--motark-surface-shadow, 0 3px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05)),
		0 14px 44px rgba(0, 0, 0, 0.48);
}

body.motark-textured .affiliate-glance__eyebrow {
	margin: 0 0 0.5rem;
}

/* Beats `.prose h2 { color; margin-top: 2.5rem }` in main.css, and resets the
   faux-bold 900 that Bebas Neue cannot actually render. */
body.motark-textured .page-content.prose .affiliate-glance__title,
body.motark-textured .affiliate-glance__title {
	margin: 0 0 clamp(1.25rem, 3vw, 1.6rem);
	font-family: var(--hp-font-display, 'Bebas Neue', Impact, sans-serif);
	font-size: clamp(1.65rem, 3.5vw, 2.25rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--hp-steel, #e4e6ea);
}

body.motark-textured .affiliate-glance__facts {
	margin: 0;
	padding: 0;
	border-top: 1px solid rgba(245, 166, 35, 0.2);
}

body.motark-textured .affiliate-glance__fact {
	display: grid;
	grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
	gap: 0.35rem 1.25rem;
	align-items: baseline;
	padding: 0.85rem 0;
	border-bottom: 1px solid rgba(245, 166, 35, 0.2);
}

/* Condensed ember caps. This is how the site labels things; it deliberately is
   not a chip or a capsule. */
body.motark-textured .affiliate-glance__label {
	margin: 0;
	font-family: var(--aff-font-cond);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hp-ember, #f5a623);
}

body.motark-textured .affiliate-glance__value {
	margin: 0;
	font-family: var(--hp-font-body, 'Barlow', system-ui, sans-serif);
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--hp-steel-muted, #9aa0ab);
}

body.motark-textured .affiliate-glance__actions {
	margin: clamp(1.25rem, 3vw, 1.6rem) 0 0;
}

body.motark-textured .affiliate-glance__cta {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---------------------------------------------------
   Apply CTA bands (top and bottom of the terms page)
   --------------------------------------------------- */

body.motark-textured .affiliate-apply {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	text-align: center;
}

/* .page-header already draws a rule directly above this, so no second one here.
   The top margin lifts the button clear of it. */
body.motark-textured .affiliate-apply--top {
	margin: clamp(1.5rem, 4vw, 2.25rem) 0 clamp(2.25rem, 5vw, 3rem);
}

body.motark-textured .affiliate-apply--bottom {
	margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
	padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
	background: var(--motark-surface-band, linear-gradient(180deg, rgba(26, 60, 42, 0.38) 0%, rgba(10, 14, 8, 0.72) 100%));
	border: 1px solid var(--motark-surface-border, rgba(228, 230, 234, 0.12));
	border-radius: 16px;
	box-shadow: var(--motark-surface-shadow, 0 3px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05));
}

body.motark-textured .affiliate-apply__lead {
	margin: 0;
	font-family: var(--hp-font-display, 'Bebas Neue', Impact, sans-serif);
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hp-steel, #e4e6ea);
}

body.motark-textured .affiliate-apply__cta {
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ---------------------------------------------------
   Terms page readability.
   Layout and colour only. No copy is touched anywhere.
   --------------------------------------------------- */

/* body{font-weight:300} plus the UA's `strong{font-weight:bolder}` computes to
   400, so every <strong> label on the terms page currently reads as flat body
   text. This is the fix every hand-built section in the theme already uses. */
body.motark-textured.motark-affiliate-program .page-content.prose strong {
	color: var(--hp-steel, #e4e6ea);
	font-weight: 500;
}

body.motark-textured.motark-affiliate-program .page-content.prose > p {
	margin: 0 0 1.25rem;
}

body.motark-textured.motark-affiliate-program .page-content.prose h2 {
	margin: clamp(2.25rem, 5vw, 3rem) 0 1rem;
	font-family: var(--hp-font-display, 'Bebas Neue', Impact, sans-serif);
	font-size: clamp(1.65rem, 3.5vw, 2.25rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--hp-steel, #e4e6ea);
}

/* Ember hairline under each section heading, the site's separator of record. */
body.motark-textured.motark-affiliate-program .page-content.prose h2::after {
	content: "";
	display: block;
	width: 3rem;
	height: 2px;
	margin-top: 0.85rem;
	background: var(--hp-ember, #f5a623);
}

body.motark-textured.motark-affiliate-program .page-content.prose ul,
body.motark-textured.motark-affiliate-program .page-content.prose ol {
	margin: 0 0 1.5rem;
	padding-left: 1.5rem;
}

body.motark-textured.motark-affiliate-program .page-content.prose li {
	margin: 0 0 0.75rem;
	line-height: 1.7;
}

body.motark-textured.motark-affiliate-program .page-content.prose li::marker {
	color: var(--hp-ember, #f5a623);
}

/* ---------------------------------------------------
   YITH signup form.
   yith-wcaf.min.css paints .register-form #f3f3f3 with a 10px radius and
   40px/80px padding, and puts a lilac 1px border on the form itself. On a
   #0a0e08 page that reads as a broken embed. The theme's existing YITH
   overrides are all scoped to .woocommerce-MyAccount-content, so none of them
   reach this standalone page.
   --------------------------------------------------- */

body.motark-textured.motark-affiliate-dashboard .forms-container {
	max-width: 100%;
}

body.motark-textured.motark-affiliate-dashboard .register-title {
	margin: 0 0 1rem;
	font-family: var(--hp-font-display, 'Bebas Neue', Impact, sans-serif);
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hp-steel, #e4e6ea);
}

body.motark-textured.motark-affiliate-dashboard .register-form,
body.motark-textured.motark-affiliate-dashboard .become-an-affiliate-form {
	background: var(--motark-surface-panel, linear-gradient(165deg, rgba(26, 60, 42, 0.45) 0%, rgba(10, 14, 8, 0.78) 100%)) !important;
	border: 1px solid var(--motark-surface-border, rgba(228, 230, 234, 0.12)) !important;
	border-radius: 14px !important;
	padding: clamp(1.5rem, 4vw, 2rem) !important;
	box-shadow: var(--motark-surface-shadow, 0 3px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05));
}

body.motark-textured.motark-affiliate-dashboard form.register,
body.motark-textured.motark-affiliate-dashboard form.become-an-affiliate {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose .form-row label {
	display: block;
	margin: 0 0 0.35rem;
	font-family: var(--aff-font-cond);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hp-steel, #e4e6ea);
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose .form-row .optional {
	color: var(--hp-steel-muted, #9aa0ab);
	letter-spacing: 0.06em;
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose input.input-text,
body.motark-textured.motark-affiliate-dashboard .page-content.prose textarea.input-text,
body.motark-textured.motark-affiliate-dashboard .page-content.prose select {
	width: 100%;
	background: var(--motark-surface-field, rgba(10, 14, 8, 0.65)) !important;
	border: 1px solid var(--motark-surface-border, rgba(228, 230, 234, 0.12)) !important;
	border-radius: 8px !important;
	color: var(--hp-steel, #e4e6ea) !important;
	padding: 0.75rem 0.9rem;
	min-height: 44px;
	/* iOS Safari zooms the whole page when you focus a field smaller than 16px.
	   These were computing to 15.2px (0.95rem) from the plugin stylesheet, so
	   every tap on the application form yanked the layout. 1rem is the floor. */
	font-size: 1rem !important;
	line-height: 1.4;
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose input.input-text:focus,
body.motark-textured.motark-affiliate-dashboard .page-content.prose textarea.input-text:focus,
body.motark-textured.motark-affiliate-dashboard .page-content.prose select:focus {
	outline: none;
	border-color: rgba(245, 166, 35, 0.55) !important;
	box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.15);
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose .terms-label,
body.motark-textured.motark-affiliate-dashboard .page-content.prose .woocommerce-privacy-policy-text {
	color: var(--hp-steel-muted, #9aa0ab);
}

body.motark-textured.motark-affiliate-dashboard .page-content.prose .terms-label label {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0.35rem 0;
	font-family: var(--hp-font-body, 'Barlow', system-ui, sans-serif);
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
	color: var(--hp-steel-muted, #9aa0ab);
	cursor: pointer;
}

/* The consent box shipped at 13px, well under any touch guideline, on a control
   that is required to submit. The input sits inside its label so the text is
   already tappable; this makes the box itself a real target too. */
body.motark-textured.motark-affiliate-dashboard .page-content.prose .terms-label input.input-checkbox {
	width: 24px;
	height: 24px;
	min-height: 24px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: var(--hp-ember, #f5a623);
	cursor: pointer;
}

/* main.css forces a 0 radius on WooCommerce buttons, so the submit needs
   !important to match the pill CTAs it sits beside. */
body.motark-textured.motark-affiliate-dashboard .page-content.prose input.button[name="register"],
body.motark-textured.motark-affiliate-dashboard .page-content.prose input.button[name="become-an-affiliate"],
body.motark-textured.motark-affiliate-dashboard .page-content.prose button.button {
	width: 100%;
	min-height: 48px !important;
	border-radius: 999px !important;
}

/* The only free-text field in the application is "Specify how you will promote
   our site", and the plugin hides it unless the promote-method select is set to
   "Others". That makes "ask for a coupon code in your application" impossible
   for the three other audience types. The field is optional either way (the
   plugin only makes it *required* when the dependency matches), so showing it
   always is safe and makes the offer honest. */
body.motark-textured.motark-affiliate-dashboard #profile_custom_promote_field {
	display: block !important;
}

/* ---------------------------------------------------
   Mobile, 390px target
   --------------------------------------------------- */

@media (max-width: 600px) {
	body.motark-textured .affiliate-glance {
		padding: 1.25rem 1.15rem;
		border-radius: 12px;
	}

	/* Label above value: a 9.5rem label column leaves too little for the value
	   inside a 358px container. */
	body.motark-textured .affiliate-glance__fact {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.3rem;
		padding: 0.8rem 0;
	}

	body.motark-textured .affiliate-apply--bottom {
		padding: 1.5rem 1.15rem;
		border-radius: 12px;
	}

	body.motark-textured .affiliate-apply__cta,
	body.motark-textured .affiliate-glance__cta {
		width: 100%;
	}

	body.motark-textured.motark-affiliate-program .page-content.prose ul,
	body.motark-textured.motark-affiliate-program .page-content.prose ol {
		padding-left: 1.25rem;
	}
}
