/**
 * Atlas Labs — Access Gate (registration/login landing page)
 *
 * Renders inside WooCommerce's account-page shell (see the
 * woocommerce/myaccount/form-login.php override), so — like
 * woocommerce-pages.css — every selector carries the documented
 * `html body` Kadence-specificity bump. Loaded only when a logged-out
 * visitor is on the account page — see inc/enqueue.php.
 *
 * Tabs are pure CSS (checked-radio + general sibling combinator) so
 * they work with JavaScript fully disabled; assets/js/access-gate.js
 * only progressively enhances aria-selected and adds the password
 * show/hide toggle.
 */

html body .al-access-gate {
	background-color: var(--color-bg-hero);
	padding-block: var(--space-48);
}

@media (min-width: 768px) {
	html body .al-access-gate {
		padding-block: var(--space-96);
	}
}

html body .al-access-gate__grid {
	display: grid;
	gap: var(--space-48);
	align-items: start;
	max-width: var(--container-max-width);
	margin-inline: auto;
	padding-inline: var(--container-gutter-mobile);
}

@media (min-width: 1024px) {
	html body .al-access-gate__grid {
		grid-template-columns: 1.05fr 0.95fr;
		gap: var(--space-64);
		align-items: center;
		padding-inline: var(--container-gutter-laptop);
	}
}

/* ---------------------------------------------------------------
 * Brand / trust panel
 * ------------------------------------------------------------- */

html body .al-access-gate__eyebrow {
	display: block;
	margin-bottom: var(--space-16);
}

html body .al-access-gate__heading {
	color: var(--color-text-primary);
	margin: 0 0 var(--space-16);
}

html body .al-access-gate__lede {
	max-width: 52ch;
	margin: 0 0 var(--space-32);
}

html body .al-access-gate__trust-list {
	list-style: none;
	margin: 0 0 var(--space-32);
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-20);
}

html body .al-access-gate__trust-item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-12);
}

html body .al-access-gate__trust-item > span:last-child {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

html body .al-access-gate__trust-icon {
	flex-shrink: 0;
	color: var(--color-accent-primary);
	width: 24px;
	height: 24px;
}

html body .al-access-gate__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-16);
	margin-bottom: var(--space-32);
}

/* ---------------------------------------------------------------
 * Auth card
 * ------------------------------------------------------------- */

html body .al-auth-card {
	background-color: var(--color-surface-primary);
	border: var(--border-width-standard) solid var(--color-border-primary);
	border-radius: var(--radius-lg);
	padding: var(--space-24);
}

@media (min-width: 768px) {
	html body .al-auth-card {
		padding: var(--space-32);
	}
}

html body .al-auth-tabs__input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

html body .al-auth-tabs__nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-8);
	background-color: var(--color-bg-secondary);
	border-radius: var(--radius-md);
	padding: var(--space-4);
	margin-bottom: var(--space-24);
}

html body .al-auth-tabs--login-only .al-auth-tabs__nav {
	display: none;
}

html body .al-auth-tabs__label {
	text-align: center;
	padding-block: var(--space-8);
	border-radius: var(--radius-sm);
	font-family: var(--font-family-base);
	font-size: var(--type-button-size);
	font-weight: var(--type-button-weight);
	color: var(--color-text-secondary);
	cursor: pointer;
	transition: background-color var(--duration-standard) var(--easing-standard),
		color var(--duration-standard) var(--easing-standard);
}

html body .al-auth-tabs__panel {
	display: none;
}

html body .al-auth-tabs--login-only .al-auth-tabs__panel--login {
	display: block;
}

html body #al-auth-tab-login:checked ~ .al-auth-tabs__nav label[for="al-auth-tab-login"],
html body #al-auth-tab-register:checked ~ .al-auth-tabs__nav label[for="al-auth-tab-register"] {
	background-color: var(--color-bg-primary);
	color: var(--color-text-primary);
	box-shadow: var(--shadow-sm);
}

html body #al-auth-tab-login:checked ~ .al-auth-tabs__panel--login,
html body #al-auth-tab-register:checked ~ .al-auth-tabs__panel--register {
	display: block;
}

html body .al-auth-tabs__heading {
	margin: 0 0 var(--space-24);
	color: var(--color-text-primary);
}

/* Confirm-password field and consent group render inside the WC
   register form via woocommerce_register_form — restated here since
   the surrounding markup is WooCommerce's own, not al-form-field. */
html body .al-auth-card .form-row-first,
html body .al-auth-card .form-row-last {
	display: inline-block;
	width: 48%;
}

html body .al-auth-card .form-row-first {
	margin-right: 4%;
}

html body .al-form-row-group {
	display: flex;
	gap: var(--space-16);
}

html body .al-form-row-group .form-row-first,
html body .al-form-row-group .form-row-last {
	flex: 1;
	width: auto;
	margin-right: 0;
}

html body .al-form-optional {
	color: var(--color-text-muted);
	font-weight: 400;
}

html body .al-password-field {
	position: relative;
}

html body .al-password-toggle {
	position: absolute;
	right: var(--space-12);
	bottom: var(--space-8);
	background: none;
	border: none;
	padding: var(--space-4);
	color: var(--color-text-secondary);
	cursor: pointer;
	display: flex;
}

html body .al-password-toggle:hover {
	color: var(--color-text-primary);
}

html body .al-consent-group {
	border: none;
	padding: 0;
	margin: var(--space-24) 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-12);
}

html body .al-consent-group__legend {
	font-size: var(--type-label-size);
	color: var(--color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0 0 var(--space-8);
}

html body .al-consent-item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-8);
	font-size: var(--type-body-small-size);
	color: var(--color-text-secondary);
	cursor: pointer;
}

html body .al-consent-item .al-checkbox {
	margin-top: 2px;
	flex-shrink: 0;
}

html body .al-consent-item a {
	color: var(--color-text-primary);
	text-decoration-color: var(--color-border-secondary);
}

/* Honeypot: visually hidden but still in the tab order for a screen
   reader is wrong — a screen-reader user would hear and could fill
   it. Truly hidden via `display:none` equivalent that also removes it
   from the accessibility tree, which real assistive tech and real
   users never trigger, but a scripted submitter parsing raw HTML
   fields typically still does. */
html body .al-honeypot-field {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* ---------------------------------------------------------------
 * Pricing preview modal
 * ------------------------------------------------------------- */

html body .al-modal[hidden] {
	display: none;
}

html body .al-modal {
	position: fixed;
	inset: 0;
	z-index: var(--z-floating, 40);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-24);
}

html body .al-modal__overlay {
	position: absolute;
	inset: 0;
	background-color: var(--color-overlay-scrim);
}

html body .al-modal__panel {
	position: relative;
	background-color: var(--color-modal-background);
	border: var(--border-width-standard) solid var(--color-modal-border);
	border-radius: var(--radius-lg);
	padding: var(--space-24);
	max-width: 560px;
	width: 100%;
	max-height: 80vh;
	overflow-y: auto;
}

@media (min-width: 768px) {
	html body .al-modal__panel {
		padding: var(--space-32);
	}
}

html body .al-modal__close {
	position: absolute;
	top: var(--space-24);
	right: var(--space-24);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--color-text-secondary);
	cursor: pointer;
}

html body .al-modal__close:hover {
	color: var(--color-text-primary);
}

html body .al-modal__close:focus-visible {
	outline: 2px solid var(--color-focus-ring);
	outline-offset: 2px;
}

html body .al-pricing-modal__table {
	width: 100%;
	border-collapse: collapse;
	margin-top: var(--space-24);
}

html body .al-pricing-modal__table th {
	background-color: var(--color-table-header-background);
	color: var(--color-text-secondary);
	font-size: var(--type-label-size);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-align: left;
	padding: var(--space-12) var(--space-16);
}

html body .al-pricing-modal__table td {
	background-color: var(--color-table-row-background);
	color: var(--color-text-primary);
	font-size: var(--type-body-small-size);
	padding: var(--space-12) var(--space-16);
	border-top: var(--border-width-standard) solid var(--color-border-primary);
}

html body .al-pricing-modal__table td:last-child {
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
	html body .al-modal:not([hidden]) .al-modal__panel {
		animation: al-modal-in var(--duration-slow) var(--easing-decelerate);
	}
}

@keyframes al-modal-in {
	from {
		opacity: 0;
		transform: scale(0.98);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ---------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------- */

@media (max-width: 767px) {
	html body .al-form-row-group {
		flex-direction: column;
		gap: 0;
	}
}
