/*
 WooCommerce My Account login and registration, restyled to match the
 custom navy card layout: one centred white card, grey placeholder fields,
 Lost Password above the buttons, navy LOGIN and grey SIGNUP side by side.
 The Remember me tick and the show-password eye are kept.

 Works with assets/woocommerce-login.js, which adds the placeholders and the
 SIGNUP / BACK toggle buttons.
*/

:root {
	--zap-brand: #002448;
	--zap-brand-hover: #003a6e;
	--zap-secondary: #4a4a4a;
	--zap-secondary-hover: #333333;
	--zap-field: #ececec;
	--zap-text: #1f2933;
	--zap-muted: #6b7682;
}

/* Stack the login and register columns into one centred card column */
.woocommerce #customer_login.u-columns {
	display: block;
}

.woocommerce #customer_login .col-1,
.woocommerce #customer_login .col-2 {
	width: 100%;
	max-width: 620px;
	margin: 0 auto;
	float: none;
	padding: 0;
}

/* Hide the "Login" and "Register" headings to match the clean card */
.woocommerce #customer_login .col-1 > h2,
.woocommerce #customer_login .col-2 > h2 {
	display: none;
}

/* The card is the form itself */
.woocommerce form.woocommerce-form-login,
.woocommerce form.woocommerce-form-register {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #e1e6ec;
	border-radius: 22px;
	box-shadow: 0 24px 60px rgba(0, 36, 72, 0.16);
	padding: 44px 46px;
	margin: 0;
	box-sizing: border-box;
}

/* Reorder the login card: fields, lost password, then the button row */
.woocommerce-form-login .woocommerce-form-row { order: 1; }
.woocommerce-form-login .lost_password { order: 2; }
.woocommerce-form-login .form-row:has(.woocommerce-form-login__submit) { order: 3; }

/* Visually hide the field labels; placeholders (added by the JS) replace them.
   Kept in the DOM for screen readers. */
.woocommerce-form-login label[for="username"],
.woocommerce-form-login label[for="password"],
.woocommerce-form-register label[for="reg_first_name"],
.woocommerce-form-register label[for="reg_last_name"],
.woocommerce-form-register label[for="reg_email"],
.woocommerce-form-register label[for="reg_username"],
.woocommerce-form-register label[for="reg_password"] {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Grey rounded fields */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row input[type="text"],
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="password"] {
	width: 100%;
	background: var(--zap-field);
	border: 1px solid transparent;
	border-radius: 12px;
	padding: 16px 18px;
	font-size: 16px;
	color: var(--zap-text);
	box-sizing: border-box;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.woocommerce form .form-row input::placeholder {
	color: #8a949e;
}

.woocommerce form .form-row input:focus {
	outline: none;
	background: #ffffff;
	border-color: var(--zap-brand);
	box-shadow: 0 0 0 3px rgba(0, 36, 72, 0.15);
}

/* Keep the show-password eye inside the grey field */
.woocommerce form .password-input {
	display: block;
	position: relative;
	width: 100%;
}

.woocommerce form .password-input input {
	width: 100%;
	padding-right: 18px;
}

.woocommerce form .show-password-input {
	display: none;
}

/* Field spacing */
.woocommerce-form-login .woocommerce-form-row,
.woocommerce-form-register .woocommerce-form-row {
	margin: 0 0 18px;
}

/* First and last name side by side on the register card */
.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
	width: 48%;
	display: inline-block;
	vertical-align: top;
}
.woocommerce form .form-row-first { margin-right: 3%; }

/* Lost password link, above the buttons */
.woocommerce-form-login .lost_password {
	margin: 2px 0 22px;
}
.woocommerce-form-login .lost_password a,
.woocommerce-LostPassword a {
	color: var(--zap-muted);
	font-size: 14px;
	text-decoration: none;
}
.woocommerce-form-login .lost_password a:hover,
.woocommerce-LostPassword a:hover {
	color: var(--zap-brand);
}

/* Button row: Remember me on its own line, then LOGIN + SIGNUP */
.woocommerce-form-login .form-row:has(.woocommerce-form-login__submit) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 0;
}
.woocommerce-form-login__rememberme {
	display: none;
}

/* Buttons */
.woocommerce .woocommerce-form-login__submit,
.woocommerce .woocommerce-form-register__submit,
.woocommerce .esg-signup-toggle,
.woocommerce .esg-back-toggle {
	border: none;
	border-radius: 10px;
	padding: 13px 30px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: #ffffff;
	cursor: pointer;
	transition: background .15s ease, transform .05s ease;
}

.woocommerce .woocommerce-form-login__submit,
.woocommerce .woocommerce-form-register__submit {
	background: var(--zap-brand);
	box-shadow: 0 8px 18px rgba(0, 36, 72, 0.28);
}
.woocommerce .woocommerce-form-login__submit:hover,
.woocommerce .woocommerce-form-register__submit:hover {
	background: var(--zap-brand-hover);
}

.woocommerce .esg-signup-toggle,
.woocommerce .esg-back-toggle {
	background: var(--zap-secondary);
	box-shadow: 0 8px 18px rgba(74, 74, 74, 0.22);
}
.woocommerce .esg-signup-toggle:hover,
.woocommerce .esg-back-toggle:hover {
	background: var(--zap-secondary-hover);
}

.woocommerce .woocommerce-form-login__submit:active,
.woocommerce .esg-signup-toggle:active,
.woocommerce .woocommerce-form-register__submit:active,
.woocommerce .esg-back-toggle:active {
	transform: translateY(1px);
}

/* Register button row */
.woocommerce-form-register .woocommerce-form-row:has(.woocommerce-form-register__submit) {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
}

@media (max-width: 560px) {
	.woocommerce form.woocommerce-form-login,
	.woocommerce form.woocommerce-form-register {
		padding: 30px 22px;
	}
	.woocommerce form .form-row-first,
	.woocommerce form .form-row-last {
		width: 100%;
		display: block;
		margin-right: 0;
	}
}
