/**
 * Login / Create Account modal, section 7199:2400.
 *
 * Sizes come off the frame: a 554px shell with 24px padding around a 506px
 * content column, 44px fields and 52px pill buttons. Fields, checkboxes and
 * the invalid state are the ones figma-checkout.css already defines — this file
 * adds only what the modal introduces (the shell, tabs, in-field icons, the
 * rule checklist and the provider buttons).
 *
 * Loaded on every Figma template, because the modal is reachable from the
 * header on all of them.
 */

.fsx-authwrap {
	position: fixed;
	inset: 0;
	/* Above the cart drawer's 900: a Checkout click from inside the drawer
	   opens this, and the drawer is still sliding out underneath. */
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 20px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.fsx-authwrap[hidden] {
	display: none;
}

.fsx-auth__scrim {
	position: fixed;
	inset: 0;
	background: rgba(14, 8, 22, 0.55);
	animation: fsx-auth-fade 180ms ease;
}

.fsx-auth {
	position: relative;
	width: 100%;
	max-width: 554px;
	margin: auto;
	padding: 24px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(14, 8, 22, 0.24);
	animation: fsx-auth-rise 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fsx-auth:focus {
	outline: none;
}

@keyframes fsx-auth-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fsx-auth-rise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.fsx-auth,
	.fsx-auth__scrim {
		animation: none;
	}
}

/* Head + close ------------------------------------------------------------- */

.fsx-auth__close {
	position: absolute;
	top: 24px;
	right: 24px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--g50);
	color: var(--g600);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.fsx-auth__close:hover {
	background: var(--g200);
	color: var(--g800);
}

.fsx-auth__close svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.fsx-auth__head {
	margin-bottom: 20px;
	padding-right: 44px;
}

.fsx-page .fsx-auth__title {
	margin: 0 0 4px;
	font-family: "Clash Display", "Public Sans", sans-serif;
	font-weight: 600;
	font-size: 24px;
	line-height: 32px;
	color: var(--ink);
}

.fsx-page .fsx-auth__lede {
	margin: 0;
	font-size: 14px;
	line-height: 20px;
	color: var(--g500);
}

/* Tabs --------------------------------------------------------------------- */

.fsx-auth__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--g200);
}

.fsx-auth__tab {
	padding: 10px 4px 12px;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	background: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--g500);
	cursor: pointer;
	transition: color 160ms ease, border-color 160ms ease;
}

.fsx-auth__tab:hover {
	color: var(--g700);
}

.fsx-auth__tab.is-active {
	border-bottom-color: var(--p500);
	color: var(--p500);
}

/* The Forgot password frame drops the tab strip: there is nothing to switch
   between while resetting. */
.fsx-auth.is-forgot .fsx-auth__tabs {
	display: none;
}

/* Panels ------------------------------------------------------------------- */

.fsx-auth__panel[hidden] {
	display: none;
}

.fsx-auth .fsx-field {
	margin-bottom: 16px;
}

.fsx-authfield__control {
	position: relative;
	display: block;
}

/* Room for whichever trailing glyph the field carries. */
.fsx-authfield__control input {
	padding-right: 44px;
}

.fsx-authfield__alert,
.fsx-authfield__eye {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
}

.fsx-authfield__alert svg,
.fsx-authfield__eye svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.fsx-authfield__alert {
	color: #c02626;
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease;
}

.fsx-authfield.is-invalid .fsx-authfield__alert {
	opacity: 1;
}

.fsx-authfield__eye {
	color: var(--g500);
	cursor: pointer;
	transition: color 160ms ease;
}

/* `hidden` is an HTML attribute and does nothing to an SVG element, so the
   two eye glyphs both drew until this said otherwise. */
.fsx-authfield__eye svg[hidden] {
	display: none;
}

.fsx-authfield__eye:hover {
	color: var(--g700);
}

/* A password field in error shows both glyphs, so the alert moves aside. */
.fsx-authfield.is-invalid .fsx-authfield__eye {
	right: 40px;
}

.fsx-authfield__error {
	display: none;
	margin-top: 6px;
	font-size: 13px;
	line-height: 18px;
	color: #c02626;
}

.fsx-authfield.is-invalid .fsx-authfield__error {
	display: block;
}

/* The label wraps the input, so .is-invalid lands on .fsx-field itself and the
   figma-checkout.css rule keyed to `.fsx-field.is-invalid input` applies. */

.fsx-auth__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.fsx-auth__remember {
	padding: 0;
}

.fsx-auth__remember .fsx-check__label {
	font-size: 14px;
}

.fsx-auth__link {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--p500);
	cursor: pointer;
	white-space: nowrap;
}

.fsx-auth__link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Password rules ----------------------------------------------------------- */

.fsx-authrules {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 8px;
}

.fsx-authrules__item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 18px;
	color: var(--g500);
	transition: color 160ms ease;
}

.fsx-authrules__tick svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: var(--g300);
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 160ms ease;
}

.fsx-authrules__item.is-met {
	color: var(--g700);
}

.fsx-authrules__item.is-met .fsx-authrules__tick svg {
	stroke: #1f8a4c;
}

/* Buttons ------------------------------------------------------------------ */

.fsx-page .fsx-auth__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--p500);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	transition: background-color 180ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.fsx-page .fsx-auth__submit:hover {
	background: #351d69;
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(65, 36, 128, 0.28);
}

.fsx-page .fsx-auth__submit[disabled] {
	opacity: 0.62;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.fsx-auth__back {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 16px;
	padding: 8px 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--p500);
	cursor: pointer;
}

.fsx-auth__back svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.fsx-auth__back:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Notice ------------------------------------------------------------------- */

.fsx-page .fsx-auth__notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: 10px;
	background: #fdecec;
	border: 1px solid #f4c9c9;
	font-size: 14px;
	line-height: 20px;
	color: #8f1d1d;
}

.fsx-page .fsx-auth__notice.is-ok {
	background: #eaf6ef;
	border-color: #c2e3d0;
	color: #1f6b40;
}

/* Social ------------------------------------------------------------------- */

.fsx-auth__social {
	margin-top: 20px;
}

.fsx-page .fsx-auth__or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--g500);
}

.fsx-auth__or::before,
.fsx-auth__or::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--g200);
}

.fsx-authsocial {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 52px;
	margin-bottom: 12px;
	padding: 0 20px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	transition: box-shadow 200ms ease, transform 180ms ease, filter 180ms ease;
}

.fsx-authsocial:last-child {
	margin-bottom: 0;
}

.fsx-authsocial:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(14, 8, 22, 0.14);
}

.fsx-authsocial__mark {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.fsx-page .fsx-authsocial--google {
	border: 1px solid var(--g300);
	background: #fff;
	color: var(--g800);
}

.fsx-page .fsx-authsocial--facebook {
	border: 1px solid transparent;
	background: #4267b2;
	color: #fff;
}

.fsx-page .fsx-authsocial--apple {
	border: 1px solid transparent;
	background: #000;
	color: #fff;
}

/* Header account control --------------------------------------------------- */

.fsx-accountbtn {
	position: relative;
}

.fsx-accountbtn__dot {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 8px;
	height: 8px;
	border: 1.5px solid #fff;
	border-radius: 50%;
	background: #1f8a4c;
}

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

@media (max-width: 600px) {
	.fsx-authwrap {
		padding: 0;
		place-items: stretch;
	}

	.fsx-auth {
		max-width: none;
		min-height: 100%;
		margin: 0;
		padding: 20px 16px 32px;
		border-radius: 0;
	}

	.fsx-auth__close {
		top: 20px;
		right: 16px;
	}

	.fsx-page .fsx-auth__title {
		font-size: 21px;
		line-height: 28px;
	}

	.fsx-auth__row {
		flex-wrap: wrap;
		gap: 8px;
	}
}
