/**
 * MBF Events & Membership - the sign in and create account screen.
 *
 * WooCommerce renders this page, so there is no markup of ours to change
 * beyond the extra fields the plugin adds: this dresses WooCommerce's own
 * form in the site's design. Same palette and type as the event pages and
 * the checkout, so a visitor sent here from an event does not arrive
 * somewhere that looks like a different site.
 *
 * Scoped to the account page body class, so nothing here reaches the rest of
 * the site, and no rule changes layout structure: sizes, spacing, colour and
 * type only, which keeps it safe across WooCommerce updates.
 *
 * Loaded by MBF_Public on the account page while signed out.
 */

/* --- Tokens ------------------------------------------------------------- */

body.woocommerce-account {
	--mbf-accent: #369a32;
	--mbf-accent-light: #9ec828;
	--mbf-accent-dark: #2b7c28;
	--mbf-heading: #292929;
	--mbf-text: #4a5565;
	--mbf-subtle: #717680;
	--mbf-line: #e9eaeb;
	--mbf-field-line: #d5d7da;
	--mbf-tint: #f6fbef;
	--mbf-danger: #a32724;
	--mbf-font-heading: "Times New Roman", Times, serif;
	--mbf-font-body: "Inter", sans-serif;
	--mbf-radius: 8px;
}

/* --- Page width --------------------------------------------------------- */
/* Matching the header, the footer, /event/ and the checkout. */

body.woocommerce-account main.site-main {
	max-width: none;
	padding-left: 40px;
	padding-right: 40px;
}

body.woocommerce-account .woocommerce {
	font-family: var(--mbf-font-body);
	color: var(--mbf-text);
	font-size: 15px;
	line-height: 24px;
	padding-top: 80px;
    padding-bottom: 80px;
}

/* --- The two columns ---------------------------------------------------- */

/*
 * WooCommerce clears its float layout with ::before and ::after on this
 * container. In a grid they become grid items and take the first cells,
 * which pushed the register column onto a second row.
 */
body.woocommerce-account .u-columns.col2-set::before,
body.woocommerce-account .u-columns.col2-set::after {
	content: none;
}

body.woocommerce-account .u-columns.col2-set {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
	max-width: 1100px;
	margin: 0 auto;
	float: none;
	width: auto;
}

body.woocommerce-account .u-columns .col-1,
body.woocommerce-account .u-columns .col-2,
body.woocommerce-account .u-columns .u-column1,
body.woocommerce-account .u-columns .u-column2 {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.woocommerce-account .u-columns h2 {
	font-family: var(--mbf-font-heading);
	font-size: 30px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--mbf-heading);
	margin: 0 0 20px;
}

/* --- The cards ---------------------------------------------------------- */

body.woocommerce-account .woocommerce-form-login,
body.woocommerce-account .woocommerce-form-register {
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
	padding: 32px;
	margin: 0;
}

/* --- Fields ------------------------------------------------------------- */

body.woocommerce-account .woocommerce-form .form-row {
	margin: 0 0 20px;
	padding: 0;
}

body.woocommerce-account .woocommerce-form .form-row label {
	display: block;
	margin-bottom: 6px;
	color: var(--mbf-subtle);
	font-family: var(--mbf-font-body);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

body.woocommerce-account .woocommerce-form .form-row .required {
	color: var(--mbf-danger);
	text-decoration: none;
	border: 0;
}

body.woocommerce-account .woocommerce-form .woocommerce-Input,
body.woocommerce-account .woocommerce-form input[type="text"],
body.woocommerce-account .woocommerce-form input[type="email"],
body.woocommerce-account .woocommerce-form input[type="tel"],
body.woocommerce-account .woocommerce-form input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--mbf-field-line);
	border-radius: var(--mbf-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
	color: var(--mbf-heading);
	font-family: var(--mbf-font-body);
	font-size: 15px;
	line-height: 24px;
}

body.woocommerce-account .woocommerce-form .woocommerce-Input:focus,
body.woocommerce-account .woocommerce-form input:focus {
	border-color: var(--mbf-accent);
	outline: none;
	box-shadow: 0 0 0 3px rgba(54, 154, 50, .18);
}

/*
 * First and last name share a row. The form is a two column grid and every
 * other row spans it, which keeps the pair aligned however long the labels
 * are; inline-block left them a few pixels out of step.
 */
body.woocommerce-account .woocommerce-form-register {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
}

body.woocommerce-account .woocommerce-form-register > * {
	grid-column: 1 / -1;
	min-width: 0;
}

body.woocommerce-account .woocommerce-form-register > .mbf-account-field--half {
	grid-column: span 1;
}

/* WooCommerce's show/hide password button. */
body.woocommerce-account .woocommerce-form .password-input {
	display: block;
	position: relative;
}

body.woocommerce-account .woocommerce-form .show-password-input {
	top: 26px;
	right: 16px;
	color: var(--mbf-subtle);
}

/* --- Password guidance -------------------------------------------------- */

/* WooCommerce's own verdict, restyled as a strip under the field. */
body.woocommerce-account .woocommerce-password-strength {
	margin-top: -12px;
	margin-bottom: 12px;
	padding: 8px 12px;
	border: 1px solid var(--mbf-line);
	border-radius: var(--mbf-radius);
	background: #fafafa;
	font-family: var(--mbf-font-body);
	font-size: 13px;
	font-weight: 600;
	text-align: left;
}

body.woocommerce-account .woocommerce-password-strength.short,
body.woocommerce-account .woocommerce-password-strength.bad {
	border-color: rgba(163, 39, 36, .35);
	background: #fdf4f4;
	color: var(--mbf-danger);
}

body.woocommerce-account .woocommerce-password-strength.good {
	border-color: rgba(138, 91, 0, .35);
	background: #fdf8ee;
	color: #8a5b00;
}

body.woocommerce-account .woocommerce-password-strength.strong {
	border-color: rgba(54, 154, 50, .35);
	background: var(--mbf-tint);
	color: var(--mbf-accent-dark);
}

body.woocommerce-account .woocommerce-password-hint {
	display: block;
	margin: 0 0 12px;
	color: var(--mbf-subtle);
	font-size: 13px;
	line-height: 20px;
}

/* The rules that verdict is measured against. */
.mbf-password-hint {
	margin: 0 0 20px;
	font-size: 13px;
	line-height: 20px;
}

.mbf-password-hint__title {
	margin: 0 0 6px;
	color: var(--mbf-subtle);
	font-weight: 600;
}

.mbf-password-hint__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 4px;
}

.mbf-password-hint__list li {
	position: relative;
	margin: 0;
	padding-left: 24px;
	color: var(--mbf-subtle);
}

/* A tick or a dash, so a met rule is never signalled by colour alone. */
.mbf-password-hint__list li:before {
	content: "–";
	position: absolute;
	left: 6px;
	font-weight: 700;
}

.mbf-password-hint__list li[data-met="true"] {
	color: var(--mbf-accent-dark);
}

.mbf-password-hint__list li[data-met="true"]:before {
	content: "✓";
	left: 4px;
}

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

body.woocommerce-account .woocommerce-form button[type="submit"],
body.woocommerce-account .woocommerce-form .woocommerce-Button,
body.woocommerce-account .woocommerce-form .woocommerce-form-login__submit,
body.woocommerce-account .woocommerce-form .woocommerce-form-register__submit {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 4px 0 0;
	padding: 14px 28px;
	border: none;
	border-radius: var(--mbf-radius);
	background-image: linear-gradient(90deg, var(--mbf-accent-light) 0%, var(--mbf-accent) 100%);
	background-color: var(--mbf-accent);
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
	color: #fff;
	font-family: var(--mbf-font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	cursor: pointer;
	transition: filter .15s ease;
}

body.woocommerce-account .woocommerce-form button[type="submit"]:hover,
body.woocommerce-account .woocommerce-form .woocommerce-Button:hover {
	filter: brightness(.94);
	color: #fff;
}

body.woocommerce-account .woocommerce-form button[type="submit"]:focus-visible {
	outline: 3px solid var(--mbf-accent);
	outline-offset: 2px;
}

/* Remember me sits on its own line above the button. */
body.woocommerce-account .woocommerce-form-login__rememberme {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	color: var(--mbf-text);
	font-size: 14px;
}

body.woocommerce-account .woocommerce-form-login__rememberme input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--mbf-accent);
}

/* --- Links and small print ---------------------------------------------- */

body.woocommerce-account .woocommerce a {
	color: var(--mbf-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

body.woocommerce-account .woocommerce a:hover {
	color: var(--mbf-accent-dark);
}

body.woocommerce-account .woocommerce-LostPassword {
	margin: 16px 0 0;
	font-size: 14px;
}

body.woocommerce-account .woocommerce-privacy-policy-text p {
	margin: 0 0 20px;
	color: var(--mbf-subtle);
	font-size: 13px;
	line-height: 20px;
}

/* The line explaining why the visitor was sent here. */
.mbf-account-prompt {
	max-width: 1100px;
	margin: 0 auto 28px;
	padding: 16px 20px;
	border: 1px solid var(--mbf-line);
	border-left: 3px solid var(--mbf-accent);
	border-radius: var(--mbf-radius);
	background: var(--mbf-tint);
	color: var(--mbf-heading);
	font-family: var(--mbf-font-body);
	font-size: 15px;
}

/* --- Notices ------------------------------------------------------------ */

body.woocommerce-account .woocommerce-error,
body.woocommerce-account .woocommerce-message,
body.woocommerce-account .woocommerce-info {
	max-width: 1100px;
	margin: 0 auto 24px;
	border-radius: var(--mbf-radius);
	font-family: var(--mbf-font-body);
	font-size: 15px;
}

/* Inside the account area a notice sits in the content card, not the page. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-message,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info {
	max-width: none;
	margin: 0 0 20px;
	border-top-color: var(--mbf-accent);
	background: var(--mbf-tint);
	color: var(--mbf-heading);
}

body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-message::before,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info::before {
	color: var(--mbf-accent);
}

body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-error {
	max-width: none;
	margin: 0 0 20px;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 880px) {
	body.woocommerce-account .u-columns.col2-set {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
}

@media (max-width: 782px) {
	body.woocommerce-account main.site-main {
		padding-left: 20px;
		padding-right: 20px;
	}

	body.woocommerce-account .woocommerce-form-login,
	body.woocommerce-account .woocommerce-form-register {
		padding: 24px 20px;
	}

	body.woocommerce-account .u-columns h2 {
		font-size: 26px;
	}

	body.woocommerce-account .woocommerce-form-register > .mbf-account-field--half {
		grid-column: 1 / -1;
	}

	body.woocommerce-account .woocommerce {
		font-family: var(--mbf-font-body);
		color: var(--mbf-text);
		font-size: 15px;
		line-height: 24px;
		padding-top: 60px;
		padding-bottom: 60px;
	}
}

/* --- The signed in account area ----------------------------------------- */
/*
 * Once someone is signed in this page is their account: a list of sections
 * down the side and whichever one they are reading beside it. WooCommerce
 * floats those two columns; they are a grid here so the side list can keep
 * its own width without the content wrapping underneath it.
 */

/*
 * The theme's own page header is hidden on this site, so MBF_Accounts prints
 * this heading instead. The .entry-title rule stays for a site where the
 * theme header is shown.
 */
.mbf-account-title,
body.woocommerce-account .entry-title {
	font-family: var(--mbf-font-heading);
	font-size: 40px;
	font-weight: 400;
	line-height: 1.15;
	color: var(--mbf-heading);
	margin: 0 0 32px;
}

/*
 * WooCommerce clears its float layout with ::before and ::after here too. In
 * a grid they count as items and take the first two cells, which put the
 * section list in the second column and the content on a row of its own.
 */
body.woocommerce-account.logged-in .woocommerce::before,
body.woocommerce-account.logged-in .woocommerce::after {
	content: none;
}

body.woocommerce-account.logged-in .woocommerce {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	align-items: start;
	gap: 40px;

	/* The heading above already opens the page; the sign in screen keeps the
	   wrapper's own top padding, since it has no heading of its own. */
	padding-top: 0;
}

body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
	margin: 0;
	min-width: 0;
}

/*
 * The plugin's own membership and registration blocks declare their tokens
 * again on .mbf-account, taking the accent from the Elementor kit, which
 * defines no colours on this site and so falls back to a blue that belongs
 * nowhere else here. Inside the account page they follow the same greens as
 * everything around them.
 */
body.woocommerce-account .mbf-account,
body.woocommerce-account .mbf-account-card,
body.woocommerce-account .mbf-notice,
body.woocommerce-account .mbf-registration {
	--mbf-accent: #369a32;
	--mbf-heading: #292929;
	--mbf-text: #4a5565;
	--mbf-font-heading: "Times New Roman", Times, serif;
	--mbf-font-body: "Inter", sans-serif;
}

/* --- The section list --------------------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
}

body.woocommerce-account .woocommerce-MyAccount-navigation li {
	margin: 0;
	padding: 0;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 10px 14px;
	border-radius: var(--mbf-radius);
	color: var(--mbf-text);
	font-family: var(--mbf-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 22px;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
	background: #fafafa;
	color: var(--mbf-heading);
}

/* The section being read: named by weight and a green marker, never colour
   alone, and announced to assistive technology by WooCommerce's own markup. */
body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	background: var(--mbf-tint);
	box-shadow: inset 3px 0 0 var(--mbf-accent);
	color: var(--mbf-heading);
	font-weight: 600;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li a:focus-visible {
	outline: 3px solid var(--mbf-accent);
	outline-offset: -3px;
}

/* Signing out is not one of the sections. */
body.woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout,
body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--mbf-line);
}

body.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a {
	color: var(--mbf-subtle);
}

/* --- The section being read --------------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-content {
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
	padding: 32px;
}

body.woocommerce-account .woocommerce-MyAccount-content h2,
body.woocommerce-account .woocommerce-MyAccount-content h3 {
	font-family: var(--mbf-font-heading);
	font-weight: 400;
	color: var(--mbf-heading);
	margin: 0 0 16px;
}

body.woocommerce-account .woocommerce-MyAccount-content h2 {
	font-size: 26px;
	line-height: 1.25;
}

body.woocommerce-account .woocommerce-MyAccount-content h3 {
	font-size: 20px;
	line-height: 1.3;
}

body.woocommerce-account .woocommerce-MyAccount-content p {
	margin: 0 0 16px;
}

body.woocommerce-account .woocommerce-MyAccount-content > :last-child {
	margin-bottom: 0;
}

/* --- Tables: orders, downloads, registrations --------------------------- */

body.woocommerce-account .woocommerce-MyAccount-content table.shop_table,
body.woocommerce-account .woocommerce-MyAccount-content table.woocommerce-table {
	width: 100%;
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	font-size: 14px;
}

body.woocommerce-account .woocommerce-MyAccount-content table th {
	padding: 12px 16px;
	border-bottom: 1px solid var(--mbf-line);
	background: #fafafa;
	color: var(--mbf-subtle);
	font-family: var(--mbf-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-align: left;
}

body.woocommerce-account .woocommerce-MyAccount-content table td {
	padding: 14px 16px;
	border-top: 1px solid var(--mbf-line);
	color: var(--mbf-text);
	vertical-align: middle;
}

body.woocommerce-account .woocommerce-MyAccount-content table tr:first-child td {
	border-top: 0;
}

/* --- Addresses ---------------------------------------------------------- */

body.woocommerce-account .woocommerce-Addresses {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

body.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
	width: auto;
	float: none;
	padding: 20px;
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
}

body.woocommerce-account .woocommerce-Address-title h2,
body.woocommerce-account .woocommerce-Address-title h3 {
	margin: 0 0 12px;
}

body.woocommerce-account .woocommerce-Address address {
	font-style: normal;
	line-height: 24px;
}

/* --- Buttons in the account area ---------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-content .button,
body.woocommerce-account .woocommerce-MyAccount-content button[type="submit"],
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Button {
	display: inline-block;
	width: auto;
	min-height: 48px;
	padding: 12px 24px;
	border: none;
	border-radius: var(--mbf-radius);
	background-image: linear-gradient(90deg, var(--mbf-accent-light) 0%, var(--mbf-accent) 100%);
	background-color: var(--mbf-accent);
	box-shadow: 0 1px 2px rgba(10, 13, 18, .05);
	color: #fff;
	font-family: var(--mbf-font-body);
	font-size: 15px;
	font-weight: 600;
	line-height: 24px;
	text-decoration: none;
	cursor: pointer;
	transition: filter .15s ease;
}

body.woocommerce-account .woocommerce-MyAccount-content .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content button[type="submit"]:hover {
	filter: brightness(.94);
	color: #fff;
}

/* A second action beside the first reads as the quieter one. */
body.woocommerce-account .woocommerce-MyAccount-content .button.edit,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-button--view {
	background: #fff;
	background-image: none;
	border: 1px solid var(--mbf-field-line);
	color: var(--mbf-heading);
}

body.woocommerce-account .woocommerce-MyAccount-content .button.edit:hover,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-button--view:hover {
	border-color: var(--mbf-accent);
	color: var(--mbf-accent);
	filter: none;
}

/* --- The account details form ------------------------------------------- */

body.woocommerce-account .woocommerce-MyAccount-content fieldset {
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var(--mbf-line);
	border-radius: 12px;
}

body.woocommerce-account .woocommerce-MyAccount-content fieldset legend {
	padding: 0 8px;
	font-family: var(--mbf-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--mbf-heading);
}

body.woocommerce-account .woocommerce-MyAccount-content .form-row-first,
body.woocommerce-account .woocommerce-MyAccount-content .form-row-last {
	box-sizing: border-box;
	display: inline-block;
	width: calc(50% - 8px);
	vertical-align: top;
}

body.woocommerce-account .woocommerce-MyAccount-content .form-row-last {
	margin-left: 14px;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 880px) {
	body.woocommerce-account.logged-in .woocommerce {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	body.woocommerce-account .woocommerce-Addresses {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 782px) {
	.mbf-account-title,
	body.woocommerce-account .entry-title {
		font-size: 32px;
		margin-bottom: 24px;
	}

	body.woocommerce-account .woocommerce-MyAccount-content {
		padding: 24px 20px;
	}

	body.woocommerce-account .woocommerce-MyAccount-content .form-row-first,
	body.woocommerce-account .woocommerce-MyAccount-content .form-row-last {
		display: block;
		width: 100%;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce-account .woocommerce-form button[type="submit"],
	body.woocommerce-account .woocommerce-MyAccount-navigation li a,
	body.woocommerce-account .woocommerce-MyAccount-content .button {
		transition: none;
	}
}
