/**
 * Boksiowo Portal Engine PRO — Accounts module (login/register/password
 * reset/account) styles. Scoped under .bpe-accounts so nothing here can
 * leak into the rest of the theme, same convention as header.css.
 *
 * Deliberately avoids `position: fixed`/`position: absolute` on any real
 * form field or the submit button — every field stays in normal document
 * flow, so there is nothing for the mobile on-screen keyboard to cover or
 * fight with as it opens/closes. This was one of the previous
 * registration form's reported mobile failure points; the fix here is
 * simply to never introduce the problem in the layout in the first place.
 */

.bpe-accounts {
	box-sizing: border-box;
	max-width: 420px;
	margin: 2.5rem auto;
	padding: 0 1rem;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: #111827;
}

.bpe-accounts *,
.bpe-accounts *::before,
.bpe-accounts *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ *
 * Notice banner — target of the #bpe-accounts-notice scroll anchor.
 * ------------------------------------------------------------------ */

.bpe-accounts__notice {
	margin: 0 0 1.25rem;
	padding: 0.85rem 1rem;
	border-radius: 10px;
	font-size: 14.5px;
	line-height: 1.5;
	scroll-margin-top: 90px; /* keeps the sticky site header from covering it when scrolled/anchored into view */
}

.bpe-accounts__notice--error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.bpe-accounts__notice--success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #15803d;
}

.bpe-accounts__hint {
	margin: 0 0 1.25rem;
	font-size: 14.5px;
	line-height: 1.5;
	color: #4b5563;
}

/* ------------------------------------------------------------------ *
 * Tabs (login/register)
 * ------------------------------------------------------------------ */

.bpe-accounts__tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 1.5rem;
	padding: 4px;
	background: #f3f4f6;
	border-radius: 12px;
}

.bpe-accounts__tab {
	flex: 1;
	text-align: center;
	padding: 0.6rem 0.75rem;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
	text-decoration: none;
}

.bpe-accounts__tab.is-active {
	background: #ffffff;
	color: #2563eb;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

/* ------------------------------------------------------------------ *
 * Form fields — normal document flow only (see file docblock).
 * ------------------------------------------------------------------ */

.bpe-accounts__form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.bpe-accounts__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.bpe-accounts__field label {
	font-size: 13.5px;
	font-weight: 600;
	color: #374151;
}

.bpe-accounts__field input[type="text"],
.bpe-accounts__field input[type="email"],
.bpe-accounts__field input[type="password"] {
	/* 44px+ tall touch target and 16px font — the latter specifically
	   stops iOS Safari auto-zooming the page on focus, which is what
	   makes a field feel like it "jumps" under the keyboard. */
	height: 46px;
	padding: 0 14px;
	font-size: 16px;
	font-family: inherit;
	color: #111827;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.bpe-accounts__field input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Show/hide password toggle — the button sits inside its own relatively
   positioned wrapper (not the field itself), so it never affects where
   the field sits in the page's normal flow. */
.bpe-accounts__password-wrap {
	position: relative;
}

.bpe-accounts__password-wrap input {
	width: 100%;
	padding-right: 64px;
}

.bpe-accounts__password-toggle {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	height: 34px;
	padding: 0 10px;
	border: none;
	background: transparent;
	color: #2563eb;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 7px;
}

.bpe-accounts__password-toggle:hover {
	background: rgba(37, 99, 235, 0.08);
}

.bpe-accounts__field--inline {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.bpe-accounts__field--inline label,
.bpe-accounts__field--checkbox label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
	font-size: 13.5px;
}

.bpe-accounts__field--checkbox {
	font-size: 13.5px;
	line-height: 1.5;
}

.bpe-accounts__field--checkbox a {
	color: #2563eb;
}

.bpe-accounts__field input[type="checkbox"] {
	/* Real 20px hit target, not the ~13px browser default — easier to tap
	   accurately on a phone. */
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.bpe-accounts__link {
	font-size: 13.5px;
	color: #2563eb;
	text-decoration: none;
}

.bpe-accounts__link:hover {
	text-decoration: underline;
}

/* Honeypot — off-screen, not display:none (some simple bots skip
   display:none fields but still fill this one in). */
.bpe-accounts__honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Submit button + submitting state (assets/js/accounts.js toggles
 * .is-submitting on the <form>; see that file for why this is a class,
 * not the `disabled` attribute).
 * ------------------------------------------------------------------ */

.bpe-accounts__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 48px;
	padding: 0 1.5rem;
	border: none;
	border-radius: 10px;
	background: #2563eb;
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 150ms ease, transform 120ms ease;
}

.bpe-accounts__submit:hover {
	background: #1d4ed8;
}

.bpe-accounts__submit:active {
	transform: scale(0.98);
}

.bpe-accounts__submit--secondary {
	background: transparent;
	color: #6b7280;
	border: 1px solid #d1d5db;
}

.bpe-accounts__submit--secondary:hover {
	background: #f3f4f6;
	color: #374151;
}

.bpe-accounts__form.is-submitting .bpe-accounts__submit {
	position: relative;
	color: transparent;
	pointer-events: none;
}

.bpe-accounts__form.is-submitting .bpe-accounts__submit::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: bpe-accounts-spin 700ms linear infinite;
}

@keyframes bpe-accounts-spin {
	to {
		transform: rotate(360deg);
	}
}

.bpe-accounts__logout-form {
	margin-top: 1.5rem;
}

/* ------------------------------------------------------------------ *
 * Account page header
 * ------------------------------------------------------------------ */

.bpe-accounts__account-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.bpe-accounts__account-header img {
	border-radius: 50%;
	flex-shrink: 0;
}

.bpe-accounts__account-name {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
}

.bpe-accounts__account-email {
	margin: 0.15rem 0 0;
	font-size: 13.5px;
	color: #6b7280;
}

.bpe-accounts__section-title {
	margin: 0.5rem 0 0;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #6b7280;
}

.bpe-accounts__submit--link {
	display: inline-flex;
}

@media (prefers-reduced-motion: reduce) {
	.bpe-accounts *,
	.bpe-accounts *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
