/**
 * Account pages ([tp_auth], inc/auth.php): login, sign-up, lost and reset password.
 * Layout: Shopifi account pages (an approximation from its public look): centred card on the
 * cream canvas, logo, one heading, one form, black pill submit.
 * Tokens: Shopifi DESIGN.md (light track) with TPTrue type (Google Sans); notices reuse the
 * Rausch tint from home.css so errors match the rest of the store.
 * Radius rule: card 12px (rounded.lg), inputs 8px (rounded.md), buttons full pill.
 */

.tp-auth {
	--tp-ink: #000000;
	--tp-on-primary: #ffffff;
	--tp-canvas: #ffffff;
	--tp-cream: #fbfbf5;
	--tp-shade-50: #71717a; /* 4.8:1 on white: secondary text and input borders */
	--tp-shade-70: #3f3f46; /* pressed / hover of the primary pill */
	--tp-hairline: #e4e4e7;
	--tp-pistachio: #d4f9e0;
	--tp-warm-tint: #fce7ec;
	--tp-warm-ink: #b0002e;
	--tp-shadow-3: 0 8px 8px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.1);

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: 1fr auto 1fr;
	justify-items: center;
	row-gap: 16px;
	min-height: 100dvh;
	padding: 24px 16px;
	background: var(--tp-cream);
	color: var(--tp-ink);
}

.tp-auth *,
.tp-auth *::before,
.tp-auth *::after {
	box-sizing: border-box;
}

.tp-auth a {
	color: var(--tp-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tp-auth a:hover {
	color: var(--tp-shade-70);
}

.tp-auth a:focus-visible,
.tp-auth button:focus-visible,
.tp-auth input:focus-visible {
	outline: 2px solid var(--tp-ink);
	outline-offset: 2px;
}

/* Card */
.tp-auth__card {
	grid-row: 2;
	width: min(100%, 400px);
	padding: 28px 32px;
	background: var(--tp-canvas);
	border-radius: 12px;
	box-shadow: var(--tp-shadow-3);
}

.tp-auth__logo {
	grid-row: 1;
	align-self: start;
	display: inline-flex;
	text-decoration: none !important;
	font-size: 22px;
	font-weight: 600;
}

.tp-auth__logo img {
	display: block;
	width: 168px;
	height: auto;
}

.tp-auth__title {
	margin: 0;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--tp-ink);
}

.tp-auth__lede {
	margin: 4px 0 20px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--tp-shade-50);
}

/* Form */
.tp-auth__form {
	display: grid;
	gap: 12px;
	margin: 0;
}

.tp-auth__field {
	display: grid;
	gap: 4px;
}

.tp-auth__label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.tp-auth__label-row label {
	font-size: 13px;
	font-weight: 500;
	color: var(--tp-ink);
}

.tp-auth__aside {
	font-size: 13px;
}

.tp-auth__control {
	position: relative;
}

.tp-auth__control input {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--tp-shade-50);
	border-radius: 8px;
	background: var(--tp-canvas);
	color: var(--tp-ink);
	font: inherit;
	font-size: 16px; /* below 16px iOS zooms the page on focus */
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-auth__control input[type="password"],
.tp-auth__control input[data-revealed] {
	padding-right: 64px;
}

.tp-auth__control input:hover {
	border-color: var(--tp-shade-70);
}

.tp-auth__control input:focus {
	outline: none;
	border-color: var(--tp-ink);
	box-shadow: 0 0 0 1px var(--tp-ink);
}

.tp-auth__reveal {
	position: absolute;
	top: 50%;
	right: 6px;
	height: 28px;
	padding: 0 10px;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: var(--tp-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transform: translateY(-50%);
}

.tp-auth__reveal:hover {
	background: var(--tp-cream);
}

.tp-auth__hint {
	margin: -6px 0 0;
	font-size: 12px;
	color: var(--tp-shade-50);
}

.tp-auth__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--tp-ink);
	opacity: 1;
	cursor: pointer;
}

.tp-auth__check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--tp-ink);
}

/* Primary: Shopifi button-primary-pill */
.tp-auth__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 42px;
	margin-top: 4px;
	padding: 10px 24px;
	border: 0;
	border-radius: 9999px;
	background: var(--tp-ink);
	color: var(--tp-on-primary) !important;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.tp-auth__submit:hover {
	background: var(--tp-shade-70);
}

.tp-auth__submit:active {
	background: var(--tp-shade-70);
	transform: scale(0.98);
}

.tp-auth__fine {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--tp-shade-50);
}

.tp-auth__switch {
	margin: 16px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--tp-hairline);
	font-size: 13px;
	color: var(--tp-shade-50);
}

.tp-auth__switch a {
	font-weight: 500;
}

/* WooCommerce notices */
.tp-auth__notices:empty,
.tp-auth__notices .woocommerce-notices-wrapper:empty {
	display: none;
}

.tp-auth__notices .woocommerce-error,
.tp-auth__notices .woocommerce-message,
.tp-auth__notices .woocommerce-info {
	margin: 0 0 16px;
	padding: 10px 14px;
	border: 0;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
	list-style: none;
}

.tp-auth__notices .woocommerce-error {
	background: var(--tp-warm-tint);
	color: var(--tp-warm-ink);
}

.tp-auth__notices .woocommerce-error li {
	margin: 0;
}

.tp-auth__notices .woocommerce-message,
.tp-auth__notices .woocommerce-info {
	background: var(--tp-pistachio);
	color: var(--tp-ink);
}

.tp-auth__notices a {
	color: inherit;
}

.tp-auth__notices .woocommerce-error::before,
.tp-auth__notices .woocommerce-message::before,
.tp-auth__notices .woocommerce-info::before {
	display: none;
}

/* Footer links under the card */
.tp-auth__footer {
	grid-row: 3;
	align-self: end;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
	font-size: 13px;
}

.tp-auth__footer a {
	color: var(--tp-shade-50);
	text-decoration: none;
}

.tp-auth__footer a:hover {
	color: var(--tp-ink);
	text-decoration: underline;
}

/* Phones: the card becomes the page */
@media (max-width: 520px) {
	.tp-auth {
		padding: 16px 0;
		background: var(--tp-canvas);
	}

	.tp-auth__card {
		padding: 8px 20px 0;
		box-shadow: none;
	}
}
