/**
 * Logged-out account gate. One paper card, centred, same tokens as the site.
 *
 * @package AllergyBuddy
 */

body.woocommerce-account,
body.woocommerce-account .site-content,
body.woocommerce-account .inside-article {
	background: var(--bg, #F8F6F1);
}

/* GeneratePress lays .site-content out as a flex row. Without a zero min-width
   the gate keeps its 440px column and slides off a phone screen. */
body.woocommerce-account .site-main,
body.woocommerce-account .content-area,
body.woocommerce-account .inside-article,
body.woocommerce-account .entry-content,
body.woocommerce-account .woocommerce,
.ab-gate {
	min-width: 0;
	width: 100%;
	max-width: 100%;
}

.ab-gate {
	margin: 0;
	padding: 48px 20px 80px;
	box-sizing: border-box;
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
}
.ab-gate a { color: inherit; text-decoration: none; }
.woocommerce-account .ab-gate form.login,
.woocommerce-account .ab-gate form.register,
.woocommerce-account .ab-gate form.lost_reset_password {
	border: 0;
	padding: 0;
	margin: 0;
	float: none;
}
.ab-gate [hidden] { display: none !important; }
.ab-gate :focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.ab-gate__col { width: 100%; max-width: 440px; margin: 0 auto; }
.ab-gate__card {
	box-sizing: border-box;
	background: var(--paper, #FDFCFA);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 28px 28px 22px;
}

.ab-gate__eyebrow {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 18px;
}
.ab-gate h1 {
	margin: 0;
	font-size: 28px;
	font-weight: 500;
	letter-spacing: -.03em;
	line-height: 1.15;
}
.ab-gate__sub {
	margin: 8px 0 0;
	color: var(--ink-2);
	font-size: 15px;
	line-height: 1.45;
}

.ab-gate__mode {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0 0 22px;
	border-bottom: 1px solid var(--line);
}
.ab-gate__opt {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 10px 12px;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.2;
	color: var(--ink-3);
	text-align: center;
}
.ab-gate__opt:hover { color: var(--ink); }
.ab-gate__opt:has(:checked) {
	color: var(--ink);
	border-bottom-color: var(--red);
}
.ab-gate__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ab-gate form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 22px;
}
.ab-gate__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ab-gate__field { display: flex; flex-direction: column; gap: 6px; }
.ab-gate__field span {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.ab-gate input[type="email"],
.ab-gate input[type="password"],
.ab-gate input[type="text"],
.ab-gate input[type="tel"] {
	width: 100%;
	background: var(--bg, #F8F6F1);
	border: 1px solid var(--line-2);
	border-radius: 10px;
	padding: 12px 13px;
	font: inherit;
	font-size: 15px;
	color: var(--ink);
	box-sizing: border-box;
}
.ab-gate input[type="password"] { padding-right: 40px; }
.ab-gate input:focus {
	outline: 2px solid var(--red);
	outline-offset: 1px;
	border-color: var(--red);
	background: var(--paper, #FDFCFA);
}

.ab-gate__split { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ab-gate__check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.ab-gate__check input { accent-color: var(--red); width: 16px; height: 16px; }
.ab-gate__text {
	font-weight: 500;
	font-size: 14.5px;
	color: var(--ink);
}
.ab-gate__text:hover { color: var(--red); }
.ab-gate form > .ab-gate__text { align-self: center; }
.ab-gate__back { text-align: center; }
.ab-gate__back { margin: 18px 0 0; }

.ab-gate__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border-radius: 0;
	padding: 13px 18px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 500;
	font-size: 15px;
	cursor: pointer;
	text-align: center;
}
.ab-gate__btn--red { background: var(--red); color: #fff; }
.ab-gate__btn--red:hover { background: var(--red-deep); color: #fff; }

.ab-gate__legal { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.ab-gate__legal :where(p, .form-row) { margin: 0; }
.ab-gate__legal a { font-weight: 500; }
.ab-gate__legal a:hover { color: var(--red); }

.ab-gate__note {
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	color: var(--ink-3);
	font-size: 13px;
	line-height: 1.45;
}

.ab-gate__reset-flag {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ab-gate__h-reset,
.ab-gate__p-reset,
.ab-gate .ab-gate__join { display: none; }
.ab-gate form.ab-gate__reset { display: none; }
.ab-gate:has(.ab-gate__reset-flag:checked) .ab-gate__h-sign,
.ab-gate:has(.ab-gate__reset-flag:checked) .ab-gate__p-sign,
.ab-gate:has(.ab-gate__reset-flag:checked) .ab-gate__sign { display: none; }
.ab-gate:has(.ab-gate__reset-flag:checked) .ab-gate__h-reset,
.ab-gate:has(.ab-gate__reset-flag:checked) .ab-gate__p-reset { display: block; }
.ab-gate:has(.ab-gate__reset-flag:checked) form.ab-gate__reset { display: flex; }
.ab-gate:has(.ab-gate__reset-flag:checked):not(:has([name="ab-account-mode"][value="join"]:checked)) .ab-gate__mode,
.ab-gate:has(.ab-gate__reset-flag:checked):not(:has([name="ab-account-mode"][value="join"]:checked)) .ab-gate__note { display: none; }
.ab-gate:has([name="ab-account-mode"][value="join"]:checked) .ab-gate__signin { display: none; }
.ab-gate:has([name="ab-account-mode"][value="join"]:checked) .ab-gate__join { display: block; }

.woocommerce-account .ab-gate .woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-account .ab-gate .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 16px; }
.woocommerce-account .ab-gate .woocommerce-error,
.woocommerce-account .ab-gate .woocommerce-message,
.woocommerce-account .ab-gate .woocommerce-info {
	list-style: none;
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--bg, #F8F6F1);
	color: var(--ink);
	font-size: 14.5px;
}
.woocommerce-account .ab-gate .woocommerce-error { border-color: var(--red); color: var(--red); }
.woocommerce-account .ab-gate .woocommerce-error::before,
.woocommerce-account .ab-gate .woocommerce-message::before,
.woocommerce-account .ab-gate .woocommerce-info::before { display: none; }

@media (max-width: 520px) {
	.ab-gate { padding: 28px 16px 48px; }
	.ab-gate__card { padding: 22px 18px 18px; }
	.ab-gate__row { grid-template-columns: 1fr; }
	.ab-gate h1 { font-size: 26px; }
}
