/*
 * Sign in / Sign up / Forgot password (Figma signin 1636:11307, signup 1636:11380, forgetPassword 1647:13964,
 * 1647:12768, 1647:13717): template page-auth (header-auth + the reviewscribe/auth-form block, no footer).
 * #f6f6f6 page; a 440 white card (radius 16, 0.5px #ccc inside stroke, padding 24) 128 from the top, the
 * legal links 16 below it. Also the shared form parts used in My account (account.css): Figma "input"
 * (label 13/20, field 0.5px #999 radius 8, 40 tall — 32 when .is-small), helper text, grey notice,
 * purple submit, OR divider, "Continue with" buttons, checkbox, Back pill.
 */

body:has(.rs-auth) {
	background-color: #f6f6f6;
}

.rs-auth {
	box-sizing: border-box;
	min-height: 100vh;
	padding: 128px var(--wp--style--root--padding-right) 64px var(--wp--style--root--padding-left);
}

.rs-auth > *,
.rs-auth__content > * {
	margin: 0;
}

.rs-auth-form {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	width: 440px;
	max-width: 100%;
	margin: 0 auto;
}

.rs-auth-form p,
.rs-auth-form h1 {
	margin: 0;
}

/* ---- Card ---- */

.rs-auth-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	padding: 24px;
	border-radius: 16px;
	background: var(--wp--preset--color--white);
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--gray-20);
}

/* Forgot password steps 1–2: Back, title + text, form, 16 apart. */
.rs-auth-card.is-step {
	gap: 16px;
}

.rs-auth-card__head,
.rs-auth-card__top,
.rs-auth-card__form,
.rs-auth-card__fields,
.rs-auth-card__actions,
.rs-auth-card__intro,
.rs-auth-card__step,
.rs-auth-card__step-actions,
.rs-auth-social {
	display: flex;
	flex-direction: column;
}

.rs-auth-card__head,
.rs-auth-card__top,
.rs-auth-card__step,
.rs-auth-card__step-actions {
	gap: 16px;
}

.rs-auth-card__logo {
	display: block;
	width: 134px;
	height: 20px;
}

.rs-auth-card__title {
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--stack-sans-headline);
	font-size: var(--wp--preset--font-size--heading-6);
	font-weight: 500;
	line-height: 28px;
	letter-spacing: 0;
}

.rs-auth-card__intro {
	gap: 8px;
}

.rs-auth-card__text {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	line-height: 20px;
	letter-spacing: -0.005em;
}

.rs-auth-card__text strong {
	font-weight: 500;
}

/* Sign in: fields, 8, "Forgot Password?" row (32) and the button 8 apart. Sign up: fields, 20, checkbox, 12, button. */
.rs-auth-card__form,
.rs-auth-card__actions {
	gap: 8px;
}

.rs-auth-card__form.is-signup {
	gap: 20px;
}

.rs-auth-card__form.is-signup .rs-auth-card__actions {
	gap: 12px;
}

.rs-auth-card__fields {
	gap: 12px;
}

.rs-auth-card__forgot {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	min-height: 32px;
}

.rs-auth-card__forgot a {
	padding: 6px 8px;
	border-radius: 6px;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
	text-decoration: none;
}

.rs-auth-card__forgot a:hover,
.rs-auth-card__forgot a:focus-visible {
	background: var(--wp--preset--color--surface);
}

/* Honeypot (Sign up): off screen, not display:none, so simple bots still fill it in. */
.rs-auth-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Field (Figma "input") ---- */

.rs-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.rs-field > *,
.rs-field > .rs-field__label {
	margin: 0; /* The label also beats WooCommerce's .woocommerce-page label margin. */
}

.rs-field__label {
	padding: 3px 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
}

.rs-field__wrap {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	padding: 10px 8px;
	border-radius: 8px;
	background: var(--wp--preset--color--white);
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--text-muted);
	transition: box-shadow 0.15s ease;
}

.rs-field__wrap:focus-within {
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--purple-100);
}

.rs-field.is-invalid .rs-field__wrap {
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--danger);
}

.rs-field__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 20px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
	outline: 0;
}

.rs-field__input::placeholder {
	color: var(--wp--preset--color--text-muted);
	opacity: 1;
}

/* Password eye (Figma EyeSlash 20) and copy (Copy 20). */
.rs-field__icon {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: url("../../images/account/eye-slash.svg") center / 20px no-repeat;
	cursor: pointer;
}

.rs-field__toggle[aria-pressed="true"] {
	background-image: url("../../images/account/eye.svg");
}

.rs-field__copy {
	background-image: url("../../images/account/copy.svg");
}

.rs-field__copy.is-copied {
	background-image: url("../../images/account/check-circle.svg");
	background-size: 16px;
}

.rs-field__icon:focus-visible {
	outline: 2px solid var(--wp--preset--color--purple-100);
	outline-offset: 2px;
}

.rs-field__help {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	line-height: 20px;
	letter-spacing: -0.005em;
}

/* Grey notice (Figma input "notice", 1647:14508): errors under a field, or a message for the form. */
.rs-field__notice {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	min-height: 32px;
	margin: 0;
	padding: 4px 8px;
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--border-strong);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	line-height: 20px;
	letter-spacing: -0.005em;
}

.rs-field__notice a {
	margin-left: 0.3em;
	color: var(--wp--preset--color--purple-100);
}

/* Small field (My account, Figma input size "small"): Regular label, 4px vertical padding, 32 tall. */
.rs-field.is-small .rs-field__label {
	font-weight: 400;
}

.rs-field.is-small .rs-field__wrap {
	padding-block: 4px;
}

/* Read-only (email in My account): #ccc stroke and grey text, like Figma's disabled state. */
.rs-field.is-readonly .rs-field__wrap {
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--gray-20);
}

.rs-field.is-readonly .rs-field__input:not(.is-plain),
.rs-field.is-readonly .rs-field__input[name="current_email"] {
	color: var(--wp--preset--color--text-muted);
}

.rs-field.is-readonly .rs-field__input[name="username"] {
	color: var(--wp--preset--color--black);
}

/* Username keeps the #999 stroke of an editable field (Figma state "default"). */
.rs-field.is-readonly:has([name="username"]) .rs-field__wrap {
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--text-muted);
}

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

.rs-auth-submit {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 8px 16px;
	border: 0;
	border-radius: 20px;
	background: var(--wp--preset--color--purple-100);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--paragraph);
	font-weight: 400;
	line-height: 24px;
	letter-spacing: -0.005em;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.rs-auth-submit:hover,
.rs-auth-submit:focus-visible {
	background: var(--wp--preset--color--purple-90);
}

.rs-auth-submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--purple-100);
	outline-offset: 2px;
}

/* "Send Code" / "Verify Email" before their field is filled (Figma purple/70). */
.rs-auth-submit.is-waiting {
	background: var(--wp--preset--color--purple-70);
}

/* Back (Figma 1647:12862): 1px #999 pill, arrow 16 + 16/24, 32 tall. */
.rs-auth-back {
	box-sizing: border-box;
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 8px;
	padding: 3px 11px;
	border: 1px solid var(--wp--preset--color--text-muted);
	border-radius: 20px;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--paragraph);
	line-height: 24px;
	letter-spacing: -0.005em;
	text-decoration: none;
}

.rs-auth-back::before {
	content: "";
	width: 16px;
	height: 16px;
	background: url("../../images/account/arrow-left.svg") center / 16px no-repeat;
}

.rs-auth-back:hover,
.rs-auth-back:focus-visible {
	background: var(--wp--preset--color--surface);
}

/* "Don’t see a code? Resend" (13/20 Medium; Resend purple). */
.rs-auth-resend {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
}

.rs-auth-resend__button {
	margin: 0 0 0 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--purple-100);
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

.rs-auth-resend__button:hover {
	text-decoration: underline;
}

/* ---- OR divider and "Continue with" buttons (1636:11333) ---- */

.rs-auth-or {
	display: flex;
	align-items: center;
	gap: 20px;
	color: var(--wp--preset--color--ink-tertiary);
	font-size: var(--wp--preset--font-size--paragraph);
	line-height: 24px;
	letter-spacing: -0.005em;
}

.rs-auth-or::before,
.rs-auth-or::after {
	content: "";
	flex: 1 1 0;
	height: 1px;
	background: var(--wp--preset--color--gray-20);
}

/* Sign in: divider, 16, buttons (12 apart). Sign up: buttons, 16, divider. */
.rs-auth-card > .rs-auth-or + .rs-auth-social {
	margin-top: -8px;
}

.rs-auth-social {
	gap: 12px;
}

.rs-social-button {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 6px 16px;
	border-radius: 8px;
	box-shadow: inset 0 0 0 0.5px var(--wp--preset--color--gray-20);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
	text-decoration: none;
}

.rs-social-button::before {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	background: center / contain no-repeat;
}

.rs-social-button.is-google::before {
	background-image: url("../../images/account/google.svg");
	background-size: 14.5px;
}

.rs-social-button.is-facebook::before {
	background-image: url("../../images/account/facebook.svg");
}

.rs-social-button.is-linkedin::before {
	background-image: url("../../images/account/linkedin.svg");
}

.rs-social-button.is-apple::before {
	background-image: url("../../images/account/apple.svg");
}

.rs-social-button:hover,
.rs-social-button:focus-visible {
	background: var(--wp--preset--color--surface);
}

/* ---- Checkbox (Figma checkbox 652:2065): 20px box, 1px purple, radius 4, 2px around it, label 8 after ---- */

.rs-check.rs-check > label {
	margin: 0;
}

.rs-check {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rs-check input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px;
	border: 1px solid var(--wp--preset--color--purple-100);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	cursor: pointer;
	appearance: none;
}

.rs-check input:checked {
	border-color: var(--wp--preset--color--purple-100);
	background: url("../../images/account/checkbox-checked.svg") center / 21px no-repeat var(--wp--preset--color--purple-100);
}

.rs-check input:focus-visible {
	outline: 2px solid var(--wp--preset--color--purple-100);
	outline-offset: 2px;
}

.rs-check.is-invalid input {
	border-color: var(--wp--preset--color--danger);
}

.rs-check label {
	margin: 0;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	font-weight: 500;
	line-height: 20px;
	letter-spacing: -0.005em;
	cursor: pointer;
}

.rs-check label a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Newsletter (My account): 18/26 Regular. */
.rs-check.is-large label {
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
	line-height: 26px;
}

/* ---- Under the card ---- */

.rs-auth-legal {
	padding: 1px 8px;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--paragraph-sm);
	line-height: 20px;
	letter-spacing: -0.005em;
	text-align: center;
}

.rs-auth-legal a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- Smaller screens ---- */

@media (max-width: 781px) {
	.rs-auth {
		padding-top: 112px;
	}

	.rs-auth-card {
		padding: 20px;
	}
}
