/*
 * Auth pages: login, register, forgot password. Figma: Login 2149:734, Register 2150:734,
 * Forgot Password 2150:918, Email Sent 2150:1043. Split layout, no site header or footer.
 * Below 1024 our interpretation: the photo becomes a short banner above the form.
 */

.auth-page {
	background: var(--bg);
}

.auth {
	display: grid;
	grid-template-columns: minmax(0, 880px) minmax(0, 1fr);
	min-height: 100vh;
	padding: 16px 0 16px 16px;
}

/* Visual panel (2149:735) */

.auth-panel {
	position: sticky;
	top: 16px;
	overflow: hidden;
	height: calc(100vh - 32px);
	min-height: 640px;
	border-radius: var(--radius-banner);
	background: var(--auth-panel);
	isolation: isolate;
}

.auth-panel__image {
	position: absolute;
	inset: 0;
	z-index: -3;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.auth-panel::before,
.auth-panel::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.auth-panel::before {
	z-index: -2;
	background: var(--auth-tint);
}

.auth-panel::after {
	z-index: -1;
	background: var(--gradient-auth);
}

.auth-panel__logo {
	position: absolute;
	top: 40px;
	left: 40px;
	display: block;
	padding: 2px 3px;
}

.auth-panel__logo img {
	display: block;
	width: 184px;
	height: auto;
}

.auth-panel__chip {
	position: absolute;
	top: 50px;
	right: 40px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 15px 7px 13px;
	border: 1px solid var(--white-28);
	border-radius: var(--radius-pill);
	background: var(--white-12);
	color: var(--bg);
	font-size: var(--fs-small);
	font-weight: var(--fw-semibold);
	line-height: normal;
}

.auth-panel__chip img {
	transform: rotate(90deg);
}

.auth-panel__copy {
	position: absolute;
	right: 64px;
	bottom: 56px;
	left: 56px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	color: var(--bg);
}

.auth-panel__eyebrow {
	margin: 0;
	color: var(--white-72);
	font-size: var(--fs-eyebrow);
	font-weight: var(--fw-semibold);
	line-height: normal;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
}

.auth-panel__title {
	max-width: 520px;
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--fs-auth-panel);
	font-weight: var(--fw-semibold);
	line-height: 1.08;
	letter-spacing: -0.02em;
}

.auth-panel__text {
	max-width: 540px;
	margin: 0;
	color: var(--white-80);
	font-size: var(--fs-intro);
	line-height: 1.55;
}

.auth-panel__trust {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 48px;
	margin: 18px 0 0;
	padding: 36px 0 0;
	border-top: 1px solid var(--white-20);
	list-style: none;
}

.auth-panel__trust li {
	display: flex;
	align-items: center;
	gap: 12px;
	line-height: normal;
}

.auth-panel__trust li > span:last-child {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.auth-panel__trust strong {
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
}

.auth-panel__trust li > span:last-child > span {
	color: var(--white-65);
	font-size: var(--fs-small);
}

.auth-panel__check {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: var(--radius-pill);
	background: var(--white-14);
}

/* Form side */

.auth__side {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.auth__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding: 32px 56px 0;
}

.auth__back,
.auth-form__back {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ink);
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
	line-height: normal;
	text-decoration: none;
}

.auth__back img,
.auth-form__back img {
	transition: transform var(--ease-hover);
}

.auth__back:hover img,
.auth-form__back:hover img {
	transform: translateX(-2px);
}

.auth__switch {
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-body-sm);
	line-height: normal;
}

.auth__switch a,
.auth-form__alt a,
.auth-form__link-button {
	margin-left: 6px;
	color: var(--plum);
	font-weight: var(--fw-semibold);
}

.auth__switch a {
	text-decoration: none;
}

.auth__main {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	padding: 40px 56px 56px;
}

.auth__main:focus {
	outline: none;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 28px;
	width: 100%;
	max-width: 420px;
}

.auth-form--wide {
	gap: 24px;
	max-width: 440px;
}

.auth-form__badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: var(--plum-tint-chip);
}

.auth-form__heading {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.auth-form__title {
	margin: 0;
	font-size: var(--fs-section-sm);
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.auth-form__text {
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-body-l);
	line-height: 1.5;
}

.auth-form__text strong {
	color: var(--ink);
	font-weight: var(--fw-semibold);
}

.auth-form__notices:empty {
	display: none;
}

.auth-form__notices > *:last-child {
	margin-bottom: 0;
}

.auth-form__form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0;
}

.auth-form__form--register {
	gap: 16px;
}

.auth-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

/* Fields (2149:795) */

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.auth-field__label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.auth-field__label {
	color: var(--ink);
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
	line-height: normal;
}

.auth-field__optional {
	color: var(--muted-2);
	font-weight: var(--fw-regular);
}

.auth-field__link {
	color: var(--plum);
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
	line-height: normal;
	text-decoration: none;
}

.auth-field__link:hover {
	text-decoration: underline;
}

.auth-field__control {
	position: relative;
}

.auth-field__icon {
	position: absolute;
	top: 50%;
	left: 17px;
	transform: translateY(-50%);
	pointer-events: none;
}

.auth-field__input {
	width: 100%;
	height: 52px;
	padding: 0 16px 0 46px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-control);
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	transition: border-color var(--ease-hover), box-shadow var(--ease-hover);
}

/* Login fields are 54px tall in the design, the others 52px. */
.auth-form:not(.auth-form--wide) .auth-form__form:not(.lost_reset_password) .auth-field__input {
	height: 54px;
}

.auth-field__input[type="password"],
.auth-field__control:has(.auth-field__toggle:not([hidden])) .auth-field__input {
	padding-right: 48px;
}

/* Darker than the design's #8b949a for AA contrast. */
.auth-field__input::placeholder {
	color: var(--muted-2);
	opacity: 1;
}

.auth-field__input:focus {
	border-color: var(--plum);
	outline: none;
	box-shadow: 0 0 0 1px var(--plum);
}

.auth-field__toggle {
	position: absolute;
	top: 50%;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-control);
	background: none;
	cursor: pointer;
	transform: translateY(-50%);
}

.auth-field__toggle[aria-pressed="true"] {
	background: var(--hover);
}

/* Password strength (2150:898) */

.password-strength {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.password-strength__bars {
	display: flex;
	gap: 6px;
}

.password-strength__bars span {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--border);
	transition: background-color var(--ease-hover);
}

.password-strength[data-score="1"] .password-strength__bars span:nth-child(-n+1),
.password-strength[data-score="2"] .password-strength__bars span:nth-child(-n+2),
.password-strength[data-score="3"] .password-strength__bars span:nth-child(-n+3),
.password-strength[data-score="4"] .password-strength__bars span {
	background: var(--plum);
}

.password-strength__text {
	color: var(--muted-2);
	font-size: var(--fs-small-sm);
	line-height: normal;
}

/* Checkboxes (2149:816, 2150:905) */

.auth-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--body);
	font-size: var(--fs-body-sm);
	line-height: 1.5;
	cursor: pointer;
}

.auth-check--top {
	align-items: flex-start;
}

.auth-check__input {
	position: absolute;
	top: 0;
	left: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.auth-check__box {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--checkbox-border);
	border-radius: 5px;
	background: var(--bg) center / 12px no-repeat;
	transition: background-color var(--ease-hover), border-color var(--ease-hover);
}

.auth-check--top .auth-check__box {
	margin-top: 2px;
}

.auth-check:hover .auth-check__box {
	border-color: var(--ink);
}

.auth-check__input:checked + .auth-check__box {
	border-color: var(--ink);
	background-color: var(--ink);
	background-image: url("../icons/checkbox-check.svg");
}

.auth-check__input:focus-visible + .auth-check__box {
	outline: 2px solid var(--plum);
	outline-offset: 2px;
}

.auth-check__text a {
	color: var(--ink);
	font-weight: var(--fw-semibold);
	text-decoration: underline;
}

/* Buttons and links */

.auth-form__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 54px;
	margin-top: 8px;
	border: 0;
	border-radius: var(--radius-control);
	background: var(--ink);
	color: var(--bg);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: var(--fw-semibold);
	line-height: normal;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--ease-hover);
}

.auth-form__submit:hover {
	background: var(--plum);
	color: var(--bg);
}

.auth-form__alt {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-body-sm);
	line-height: normal;
}

.auth-form__alt a {
	text-decoration: underline;
}

.auth-form__link-button {
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--font-body);
	font-size: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.auth-form__back {
	align-self: center;
}

.auth-form__legal {
	margin: 0;
	color: var(--muted-2);
	font-size: var(--fs-small-sm);
	line-height: 1.55;
	text-align: center;
}

.auth-form__legal a {
	color: var(--ink);
	font-weight: var(--fw-semibold);
}

/* Email sent (2150:1088): centred */

.auth-form__state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
}

.auth-form__state .auth-form__heading {
	align-items: center;
}

.auth-form__help {
	width: 100%;
	margin: 0;
	padding: 14px 16px;
	border-radius: var(--radius-control);
	background: var(--cream);
	color: var(--muted);
	font-size: var(--fs-small);
	line-height: 1.5;
}

.auth-form__help a {
	color: var(--plum);
	font-weight: var(--fw-semibold);
}

/* Responsive */

@media (max-width: 1279px) {
	.auth {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.auth-panel__copy {
		right: 40px;
		bottom: 40px;
		left: 40px;
	}

	.auth-panel__trust {
		gap: 16px 28px;
	}

	.auth__top,
	.auth__main {
		padding-inline: 40px;
	}
}

@media (max-width: 1023px) {
	.auth {
		grid-template-columns: minmax(0, 1fr);
		align-content: start;
		padding: 16px;
	}

	.auth__main {
		flex: 0 0 auto;
	}

	.auth-panel {
		position: relative;
		top: auto;
		height: 280px;
		min-height: 0;
	}

	.auth-panel__text,
	.auth-panel__trust {
		display: none;
	}

	.auth-panel__copy {
		bottom: 28px;
		gap: 10px;
	}

	.auth-panel__title {
		max-width: 480px;
		font-size: var(--fs-section-sm);
	}

	.auth-panel--forgot .auth-panel__title {
		max-width: 380px;
	}

	.auth__top {
		padding: 24px 8px 0;
	}

	.auth__main {
		padding: 40px 8px 24px;
	}
}

@media (max-width: 767px) {
	.auth {
		padding: 12px;
	}

	.auth-panel {
		border-radius: var(--radius-card);
	}

	.auth-panel__logo {
		top: 20px;
		left: 20px;
	}

	.auth-panel__logo img {
		width: 140px;
	}

	/* Phones: the photo and logo only; the form says what the page is. */
	.auth-panel {
		height: 95px;
	}

	.auth-panel__chip,
	.auth-panel__copy {
		display: none;
	}

	.auth__top {
		padding-top: 20px;
	}

	.auth__switch {
		display: none;
	}

	.auth__main {
		padding-top: 28px;
	}

	.auth-form__row {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth__back img,
	.auth-form__back img,
	.password-strength__bars span {
		transition: none;
	}
}
