/**
 * Front-end authentication styles (login + registration).
 *
 * Enqueued only on the auth pages (see inc/auth/hooks.php), so nothing here
 * costs the rest of the site anything. All selectors are namespaced under
 * `body.wlsb-kc-auth` and use the `wlsb-auth-*` class prefix so they never
 * collide with Kadence, the WLSB Connect plugin's own `wlsb-login` styles, or
 * anything else on the page.
 *
 * Design tokens are exposed as CSS custom properties up top for easy
 * re-theming; override them from the Customizer's Additional CSS or a child
 * stylesheet without touching this file.
 *
 * @package WLSB_Kadence_Child
 */

body.wlsb-kc-auth {
	--wlsb-auth-navy: #0a375e;
	--wlsb-auth-slate: #457095;
	--wlsb-auth-border: #c7d7e8;
	--wlsb-auth-border-strong: #dbe6f4;
	--wlsb-auth-bg-field: #f7fafd;
	--wlsb-auth-muted: #6b7c8c;
	--wlsb-auth-label: #33475b;
	--wlsb-auth-track: #e3ebf3;
	--wlsb-auth-weak: #c0392b;
	--wlsb-auth-fair: #c77d16;
	--wlsb-auth-good: #2e7d5b;
	--wlsb-auth-strong: #1f7a4d;
	--wlsb-auth-focus-ring: rgba(69, 112, 149, 0.18);
	--wlsb-auth-radius: 6px;
	--wlsb-auth-font: 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;

	margin: 0;
	font-family: var(--wlsb-auth-font);
	color: var(--wlsb-auth-label);
}

body.wlsb-kc-auth a {
	color: var(--wlsb-auth-slate);
	text-decoration: none;
}

body.wlsb-kc-auth a:hover {
	color: var(--wlsb-auth-navy);
	text-decoration: underline;
}

body.wlsb-kc-auth a:focus-visible,
body.wlsb-kc-auth button:focus-visible,
body.wlsb-kc-auth input:focus-visible {
	outline: 2px solid var(--wlsb-auth-slate);
	outline-offset: 2px;
}

/* Layout shell -------------------------------------------------------- */
.wlsb-auth-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: linear-gradient(180deg, #dcebfe 0%, #eef5ff 45%, #f6faff 100%);
}

/* Header -------------------------------------------------------------- */
.wlsb-auth-header {
	background: #fff;
	border-bottom: 1px solid var(--wlsb-auth-border-strong);
	padding: 18px 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.wlsb-auth-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wlsb-auth-brand a:hover {
	text-decoration: none;
}

.wlsb-auth-brand img {
	max-height: 46px;
	width: auto;
	display: block;
}

.wlsb-auth-brand-text {
	font-size: 15px;
	font-weight: 700;
	color: var(--wlsb-auth-navy);
	letter-spacing: -0.01em;
}

.wlsb-auth-back {
	font-size: 13px;
	font-weight: 600;
	color: var(--wlsb-auth-navy) !important;
	letter-spacing: 0.02em;
}

/* Main content ------------------------------------------------------- */
.wlsb-auth-main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 20px;
}

.wlsb-auth-wrap {
	width: 100%;
	max-width: 420px;
}

.wlsb-auth-card {
	background: #fff;
	border: 1px solid var(--wlsb-auth-border-strong);
	border-top: 4px solid var(--wlsb-auth-navy);
	border-radius: 10px;
	box-shadow: 0 18px 44px rgba(10, 55, 94, 0.12);
	padding: 40px 36px 34px;
}

@media (max-width: 480px) {
	.wlsb-auth-card {
		padding: 32px 22px 26px;
	}
}

.wlsb-auth-title {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: var(--wlsb-auth-navy);
	letter-spacing: -0.01em;
}

.wlsb-auth-subtitle {
	margin: 0 0 26px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wlsb-auth-muted);
}

/* Notice banner ------------------------------------------------------ */
.wlsb-auth-notice {
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: var(--wlsb-auth-radius);
}

.wlsb-auth-notice p {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}

.wlsb-auth-notice--error {
	background: #fdecea;
	border: 1px solid #f3c4bd;
}

.wlsb-auth-notice--error p {
	color: var(--wlsb-auth-weak);
}

.wlsb-auth-notice--success {
	background: #eaf5ee;
	border: 1px solid #bfe0cb;
}

.wlsb-auth-notice--success p {
	color: var(--wlsb-auth-strong);
}

/* Form --------------------------------------------------------------- */
.wlsb-auth-row {
	display: flex;
	gap: 14px;
}

@media (max-width: 480px) {
	.wlsb-auth-row {
		flex-direction: column;
		gap: 0;
	}
}

.wlsb-auth-row .wlsb-auth-field {
	flex: 1;
}

.wlsb-auth-field {
	margin-bottom: 20px;
}

.wlsb-auth-field > label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--wlsb-auth-label);
	margin-bottom: 7px;
}

.wlsb-auth-field input[type='text'],
.wlsb-auth-field input[type='email'],
.wlsb-auth-field input[type='password'] {
	width: 100%;
	padding: 12px 13px;
	font-size: 15px;
	font-family: inherit;
	color: var(--wlsb-auth-navy);
	background: var(--wlsb-auth-bg-field);
	border: 1px solid var(--wlsb-auth-border);
	border-radius: var(--wlsb-auth-radius);
	outline: none;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.wlsb-auth-field input:focus {
	border-color: var(--wlsb-auth-slate);
	background: #fff;
	box-shadow: 0 0 0 3px var(--wlsb-auth-focus-ring);
}

/* Password field with show/hide toggle ------------------------------- */
.wlsb-auth-pw {
	position: relative;
	display: flex;
}

.wlsb-auth-pw input {
	padding-right: 64px;
}

.wlsb-auth-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 12px;
	font-weight: 600;
	color: var(--wlsb-auth-slate);
	cursor: pointer;
	padding: 6px 8px;
}

.wlsb-auth-toggle:hover {
	color: var(--wlsb-auth-navy);
}

.wlsb-auth-field--check > label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	cursor: pointer;
	margin: 0;
}

.wlsb-auth-field--check input {
	width: 16px;
	height: 16px;
}

/* Password strength meter -------------------------------------------- */
.wlsb-auth-strength {
	margin-top: 10px;
}

.wlsb-auth-strength-bars {
	display: flex;
	gap: 6px;
}

.wlsb-auth-strength-bar {
	flex: 1;
	height: 5px;
	border-radius: 3px;
	background: var(--wlsb-auth-track);
	transition: background 0.2s;
}

[data-score='1'] .wlsb-auth-strength-bar:nth-child(-n + 1) {
	background: var(--wlsb-auth-weak);
}

[data-score='2'] .wlsb-auth-strength-bar:nth-child(-n + 2) {
	background: var(--wlsb-auth-fair);
}

[data-score='3'] .wlsb-auth-strength-bar:nth-child(-n + 3) {
	background: var(--wlsb-auth-good);
}

[data-score='4'] .wlsb-auth-strength-bar:nth-child(-n + 4) {
	background: var(--wlsb-auth-strong);
}

.wlsb-auth-strength-label {
	min-height: 16px;
	margin: 7px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--wlsb-auth-muted);
}

[data-score='1'] .wlsb-auth-strength-label {
	color: var(--wlsb-auth-weak);
}

[data-score='2'] .wlsb-auth-strength-label {
	color: var(--wlsb-auth-fair);
}

[data-score='3'] .wlsb-auth-strength-label {
	color: var(--wlsb-auth-good);
}

[data-score='4'] .wlsb-auth-strength-label {
	color: var(--wlsb-auth-strong);
}

/* Confirm-password match indicator ----------------------------------- */
.wlsb-auth-match {
	min-height: 16px;
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--wlsb-auth-muted);
}

[data-wlsb-auth-confirm][data-state='match'] input {
	border-color: #9dc9ad;
}

[data-wlsb-auth-confirm][data-state='match'] .wlsb-auth-match {
	color: var(--wlsb-auth-strong);
}

[data-wlsb-auth-confirm][data-state='mismatch'] input {
	border-color: #e0a49c;
}

[data-wlsb-auth-confirm][data-state='mismatch'] .wlsb-auth-match {
	color: var(--wlsb-auth-weak);
}

/* Honeypot: hidden from sighted users and assistive tech, removed from
   the tab order via tabindex="-1" in the markup. */
.wlsb-auth-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Submit button ------------------------------------------------------ */
.wlsb-auth-submit,
.wlsb-auth-btn {
	display: inline-block;
	width: 100%;
	padding: 13px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	text-align: center;
	color: #fff;
	background: var(--wlsb-auth-navy);
	border: none;
	border-radius: var(--wlsb-auth-radius);
	cursor: pointer;
	letter-spacing: 0.01em;
	transition: background 0.15s;
}

.wlsb-auth-submit:hover,
.wlsb-auth-btn:hover {
	background: var(--wlsb-auth-slate);
	color: #fff;
	text-decoration: none;
}

.wlsb-auth-btn--ghost {
	color: var(--wlsb-auth-navy);
	background: transparent;
	border: 1px solid var(--wlsb-auth-border);
	margin-top: 10px;
}

.wlsb-auth-btn--ghost:hover {
	color: var(--wlsb-auth-navy);
	background: var(--wlsb-auth-bg-field);
}

/* Secondary links ---------------------------------------------------- */
.wlsb-auth-aux {
	display: flex;
	justify-content: center;
	gap: 22px;
	margin-top: 22px;
	font-size: 13.5px;
}

.wlsb-auth-divider {
	color: #b7c6d6;
}

.wlsb-auth-site {
	text-align: center;
	margin-top: 18px;
}

.wlsb-auth-site a {
	font-size: 13px;
	color: var(--wlsb-auth-muted) !important;
}

/* "Already signed in" / "closed" simple card ------------------------- */
.wlsb-auth-lead {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--wlsb-auth-label);
}

/* Footer ------------------------------------------------------------- */
.wlsb-auth-footer {
	background: var(--wlsb-auth-navy);
	color: #b9cde2;
	padding: 22px 28px;
}

.wlsb-auth-footer-inner {
	max-width: 1080px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wlsb-auth-copy {
	margin: 0;
	font-size: 12.5px;
	color: #8fabc9;
}

.wlsb-auth-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	font-size: 12.5px;
}

.wlsb-auth-footer-links a {
	color: #b9cde2 !important;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	body.wlsb-kc-auth * {
		transition: none !important;
	}
}
