/*
 * The account page: sign in, create an account, reset a password.
 *
 * Values measured off the reference page rather than chosen: two equal columns
 * split by a hairline, a 460px content column inside each, 45px fields with a
 * 1px #878787 border and no radius, and the charcoal button the rest of the
 * site already uses.
 *
 * The fields carry the theme's own class names, not WooCommerce's `.form-row`
 * / `.input-text`, so WooCommerce's form stylesheet — whose
 * `.woocommerce form .form-row .input-text` ends with `height: auto` at a
 * specificity most theme rules lose to — never applies to them.
 */

/*
 * WooCommerce's own form chrome, removed.
 *
 * woocommerce.css draws `.woocommerce form.login, .woocommerce form.register`
 * with a 1px border, 20px of padding, a 2em margin and a 5px radius — a card
 * the design does not have, around a form that already sits in a laid-out
 * column. The classes have to stay on the form (WC_Form_Handler and several
 * extensions look for them), so the styling is undone here.
 *
 * The selector is long on purpose: WooCommerce's is (0,2,1), so the obvious
 * `.woocommerce-account .woocommerce-form-login` (0,2,0) silently loses — the
 * border stayed on screen through the first deploy of this page.
 */
.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register,
.woocommerce-account .woocommerce form.lost_reset_password {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	text-align: start;
}

.account-page {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	max-width: 1200px;
	margin: 0 auto var(--section-gap);
}

/* The hairline between the two columns is a border on the second, so it is
   drawn once and disappears with the column when only one is rendered. */
.account-page > .account-col + .account-col {
	border-inline-start: 1px solid var(--color-border);
}

.account-page--single {
	grid-template-columns: minmax(0, 1fr);
	max-width: 520px;
}

.account-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-inline: 40px;
	text-align: center;
}

.account-col__heading {
	margin: 0 0 10px;
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

/* The loyalty panel's heading is the Signature lockup, in the same hand the
   footer and the banner use. */
.account-col__heading--script {
	font-family: var(--font-script);
	font-size: 34px;
	font-weight: 400;
	letter-spacing: 0;
	/* The script's ascenders and descenders are long; without this the loop of
	   the S is clipped. */
	padding-block: 6px;
}

.account-col__intro,
.account-col__copy {
	max-width: 46ch;
	margin: 0 0 22px;
	font-size: 16px;
	line-height: 1.5;
}

.account-col__copy {
	margin-block-end: 34px;
}

.account-col__note {
	margin: 0 0 18px;
	font-size: 15px;
	color: var(--color-text-muted);
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */

.account-form {
	width: 100%;
	max-width: var(--account-field-width);
	text-align: start;
}

.account-field {
	position: relative;
	margin: 0 0 15px;
}

.account-input {
	display: block;
	width: 100%;
	height: 45px;
	padding: 0 15px;
	border: 1px solid var(--account-field-border);
	border-radius: 0;
	background: var(--color-white);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.4;
}

.account-input::placeholder {
	color: var(--color-text-muted);
	opacity: 1;
}

.account-input:focus {
	border-color: var(--color-ink);
	outline: 2px solid var(--color-navy);
	outline-offset: 1px;
}

/* Room for the reveal button, so a long password never runs under it. */
.account-field--password .account-input {
	padding-inline-end: 46px;
}

.account-reveal {
	position: absolute;
	inset-block-start: 0;
	inset-inline-end: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 45px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-text-muted);
	cursor: pointer;
}

.account-reveal:hover {
	color: var(--color-ink);
}

.account-reveal .icon {
	width: 18px;
	height: 18px;
}

/* One icon at a time: pressed means the password is visible, so show the
   struck-through eye as the way to hide it again. */
.account-reveal .icon--eye-off {
	display: none;
}

.account-reveal[aria-pressed="true"] .icon--eye {
	display: none;
}

.account-reveal[aria-pressed="true"] .icon--eye-off {
	display: block;
}

/* ─── Checkbox ───────────────────────────────────────────────────────────── */

.account-field--checkbox {
	margin-block-end: 20px;
}

.account-check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	cursor: pointer;
}

/*
 * The real input stays in the document and keeps its own focus and toggle
 * behaviour; it is only moved out of sight, so the drawn box below is never
 * a control a keyboard cannot reach.
 */
.account-check__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.account-check__box {
	position: relative;
	flex: none;
	width: 18px;
	height: 18px;
	border: 1px solid var(--account-field-border);
	background: var(--color-white);
}

.account-check__box::after {
	content: "";
	position: absolute;
	inset-block-start: 1px;
	inset-inline-start: 5px;
	width: 5px;
	height: 10px;
	border: solid var(--color-ink);
	border-width: 0 1.5px 1.5px 0;
	opacity: 0;
	transform: rotate(45deg);
}

.account-check__input:checked + .account-check__box::after {
	opacity: 1;
}

.account-check__input:focus-visible + .account-check__box {
	outline: 2px solid var(--color-navy);
	outline-offset: 2px;
}

/* ─── Actions ────────────────────────────────────────────────────────────── */

.account-submit {
	width: 100%;
	max-width: var(--account-field-width);
	height: 45px;
	min-height: 45px;
}

.account-forgot {
	margin: 15px 0 0;
	font-size: 16px;
	line-height: 1.5;
}

.account-forgot a {
	color: var(--color-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ─── Signed in: WooCommerce's own dashboard ─────────────────────────────── */

/*
 * Not in the reference design — it only covers the logged-out page. This is
 * enough to keep the dashboard in the theme's type and spacing rather than
 * WooCommerce's defaults, and should be replaced when that design lands.
 */
.woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-MyAccount-navigation li {
	border-block-end: 1px solid var(--color-border-light);
}

.woocommerce-MyAccount-navigation a {
	display: block;
	padding-block: 12px;
	color: var(--color-ink);
	font-size: 14px;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}

.woocommerce-MyAccount-navigation .is-active a {
	font-weight: 600;
}

.woocommerce-MyAccount-content {
	font-size: 16px;
	line-height: 1.6;
}

/* ─── Narrow screens ─────────────────────────────────────────────────────── */

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

	.account-col {
		padding-inline: 0;
	}

	/* Stacked, so the divider runs across rather than down. */
	.account-page > .account-col + .account-col {
		margin-block-start: 30px;
		padding-block-start: 34px;
		border-inline-start: 0;
		border-block-start: 1px solid var(--color-border);
	}

	.account-col__heading--script {
		font-size: 30px;
	}
}
