/**
 * Auth page styles — register, login.
 *
 * @since 1.10.0
 */

/* v1.30.0 — Theme-fighting block removed per WP plugin handbook doctrine.
 * Previously hid #sidebar, .page-title, .entry-title and forced #left-area
 * width on Divi. Those are theme regions the plugin should not touch.
 * Sites that need a borderless auth surface should use a blank-page template
 * (Divi → "Blank Page" template, or theme equivalent). The MemberPress
 * de-duplication below is still legitimate (it removes a SECOND login form
 * the same shortcode page rendered, not a theme region).
 */
.pma-auth-wrap ~ #mepr-template-login,
.pma-auth-wrap ~ .mp_wrapper,
.pma-auth-wrap ~ .mp_wrapper.mp_login_form {
	display: none;
}

/* Wrap */
.pma-auth-wrap {
	max-width: 460px;
	margin: 40px auto;
	font: inherit;
	color: var(--pma-text);
}

/* Hero */
.pma-auth-hero {
	background: var(--pma-gradient);
	color: #fff;
	text-align: center;
	padding: 40px 32px 32px;
	border-radius: var(--pma-radius-lg) var(--pma-radius-lg) 0 0;
}

.pma-auth-hero .pma-auth-logo {
	margin-bottom: 16px;
}

.pma-auth-hero .pma-auth-logo img {
	max-height: 48px;
	width: auto;
	border-radius: 6px;
}

.pma-auth-hero .pma-auth-logo-text {
	font-size: 20px;
	font-weight: 700;
	opacity: 0.9;
	letter-spacing: 0.5px;
}

.pma-auth-hero h1 {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

.pma-auth-hero p {
	margin: 0;
	font-size: 15px;
	opacity: 0.85;
	color: #fff;
}

/* Card */
.pma-auth-card {
	background: var(--pma-bg);
	border: 1px solid var(--pma-border);
	border-top: 0;
	border-radius: 0 0 var(--pma-radius-lg) var(--pma-radius-lg);
	padding: 32px;
	box-shadow: var(--pma-shadow-md);
}

/* Form */
.pma-auth-card .pma-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.pma-auth-card .pma-form-group {
	margin-bottom: 20px;
}

.pma-auth-card .pma-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--pma-text);
	margin-bottom: 6px;
}

/*
 * v1.30.2 (CYCLE-1 F-CYC1-2): stronger, always-visible form borders. The
 * --pma-border token uses a 12%-currentColor mix that goes invisible against
 * a white card on a white page. Auth fields need to LOOK like fields without
 * focus — fresh users couldn't tell whether to type in the box or above it.
 * Use --pma-border-strong (22%) + a base slate fallback so the field is
 * clearly outlined on any host theme.
 */
.pma-auth-card .pma-form-group input[type="text"],
.pma-auth-card .pma-form-group input[type="email"],
.pma-auth-card .pma-form-group input[type="password"],
.pma-auth-card .pma-form-group input[type="number"],
.pma-auth-card .pma-form-group input[type="tel"] {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--pma-border-strong, #cbd5e1);
	border-radius: var(--pma-radius-sm);
	font-size: 15px;
	font: inherit;
	color: var(--pma-text);
	background: var(--pma-bg);
	transition: border-color var(--pma-transition), box-shadow var(--pma-transition);
	box-sizing: border-box;
}

.pma-auth-card .pma-form-group input[type="text"]:hover,
.pma-auth-card .pma-form-group input[type="email"]:hover,
.pma-auth-card .pma-form-group input[type="password"]:hover {
	border-color: var(--pma-primary);
}

.pma-auth-card .pma-form-group input:focus,
.pma-auth-card .pma-form-group input:focus-visible {
	border-color: var(--pma-primary);
	box-shadow: var(--pma-shadow-ring);
	outline: none;
}

.pma-auth-card .pma-form-group input.pma-input-error {
	border-color: var(--pma-danger);
}

.pma-required {
	color: var(--pma-danger);
}

.pma-field-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--pma-text-light);
}

/* Password toggle */
.pma-password-wrap {
	position: relative;
}

.pma-password-wrap input {
	padding-right: 44px !important;
}

.pma-password-toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--pma-text-light);
	line-height: 1;
}

.pma-password-toggle:hover {
	color: var(--pma-text-secondary);
}

.pma-password-toggle .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* T&C Section */
.pma-tc-section {
	margin-bottom: 20px;
}

.pma-tc-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--pma-text);
	margin-bottom: 8px;
}

.pma-tc-box {
	max-height: 200px;
	overflow-y: auto;
	border: 1.5px solid var(--pma-border);
	border-radius: var(--pma-radius-sm);
	padding: 16px;
	font-size: 12px;
	line-height: 1.6;
	color: var(--pma-text-secondary);
	background: var(--pma-bg-secondary);
	margin-bottom: 8px;
}

.pma-tc-box:focus {
	border-color: var(--pma-primary);
	outline: none;
}

.pma-tc-box h2, .pma-tc-box h3, .pma-tc-box h4 {
	color: var(--pma-text);
	margin-top: 16px;
	margin-bottom: 8px;
}

.pma-tc-box h2 { font-size: 15px; }
.pma-tc-box h3 { font-size: 13px; }
.pma-tc-box h4 { font-size: 12px; }

.pma-tc-box ul {
	padding-left: 20px;
	margin: 8px 0;
}

.pma-tc-box li {
	margin-bottom: 4px;
}

.pma-tc-box p {
	margin: 8px 0;
}

.pma-tc-fulllink {
	display: inline-block;
	font-size: 12px;
	color: var(--pma-primary);
	margin-bottom: 12px;
}

.pma-tc-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
}

.pma-tc-checkbox input[type="checkbox"] {
	margin-top: 2px;
	flex-shrink: 0;
}

.pma-tc-checkbox span {
	font-size: 13px;
	color: var(--pma-text);
	line-height: 1.4;
}

/* Privacy Pledge — semantic "trust / success" surface */
.pma-privacy-pledge {
	background: var(--pma-success-bg);
	border: 1px solid color-mix(in oklch, var(--pma-success) 30%, transparent);
	border-radius: var(--pma-radius-sm);
	padding: 16px;
	margin-bottom: 20px;
}

.pma-privacy-pledge-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	color: var(--pma-success-ink);
}

.pma-privacy-pledge-icon {
	flex-shrink: 0;
	color: var(--pma-success);
}

.pma-privacy-pledge-header strong {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.pma-privacy-pledge-list {
	margin: 0 0 10px;
	padding-left: 18px;
	list-style: none;
}

.pma-privacy-pledge-list li {
	position: relative;
	font-size: 12px;
	line-height: 1.55;
	color: var(--pma-success-ink);
	margin-bottom: 6px;
	padding-left: 6px;
}

.pma-privacy-pledge-list li:last-child {
	margin-bottom: 0;
}

.pma-privacy-pledge-list li::before {
	content: "\2713";
	position: absolute;
	left: -16px;
	font-weight: 700;
	color: var(--pma-success);
}

.pma-privacy-pledge-note {
	margin: 0;
	font-size: 11px;
	line-height: 1.5;
	color: var(--pma-text-secondary);
	font-style: italic;
	padding-top: 8px;
	border-top: 1px solid color-mix(in oklch, var(--pma-success) 20%, transparent);
}

/* Submit button */
.pma-btn-full {
	width: 100%;
	padding: 12px;
	font-size: 16px;
	font-weight: 600;
	margin-top: 4px;
}

/*
 * v1.30.1: ensure the auth form Sign In / Create Account buttons render the
 * brand gradient even when block themes (Divi, etc.) cascade a dark default
 * style onto wp-element-button. The auth surface is a hero — black-on-white
 * looks anti-climactic next to the purple gradient hero header.
 */
.pma-auth-wrap .pma-btn-primary,
.pma-auth-wrap .pma-btn-primary.wp-element-button,
.pma-auth-wrap button.pma-btn-primary {
	background: var(--pma-gradient, var(--pma-primary)) !important;
	color: var(--pma-primary-ink, #fff) !important;
	border: none !important;
	box-shadow: var(--pma-shadow-sm) !important;
	transition: var(--pma-transition, all 180ms ease) !important;
}
.pma-auth-wrap .pma-btn-primary:hover,
.pma-auth-wrap .pma-btn-primary.wp-element-button:hover,
.pma-auth-wrap button.pma-btn-primary:hover {
	filter: brightness(0.94);
	box-shadow: var(--pma-shadow-md) !important;
	transform: translateY(-1px);
}
.pma-auth-wrap .pma-btn-primary:focus-visible {
	outline: none;
	box-shadow: var(--pma-shadow-ring, 0 0 0 3px rgba(99, 102, 241, 0.4)) !important;
}

.pma-btn-full:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

/* ── Already-logged-in card (v1.30.2 F-CYC1-1) ───────────────── */
.pma-auth-logged-in {
	max-width: 420px;
	margin: 60px auto;
	padding: 0;
	overflow: hidden;
	box-shadow: var(--pma-shadow-lg);
}
.pma-auth-logged-in .pma-auth-card-hero {
	background: var(--pma-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
	color: #fff;
	padding: 32px 28px 28px;
	text-align: center;
}
.pma-auth-logged-in .pma-auth-card-title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	line-height: 1.3;
}
.pma-auth-logged-in .pma-auth-card-sub {
	margin: 0;
	color: rgba(255, 255, 255, 0.92);
	font-size: 14px;
	line-height: 1.5;
}
.pma-auth-logged-in .pma-auth-card-actions {
	padding: 24px 28px 28px;
	background: var(--pma-bg, #fff);
	text-align: center;
}
.pma-auth-logged-in .pma-auth-card-actions .pma-btn-primary {
	margin-bottom: 14px;
}

/* ── Password strength meter (v1.30.3 ROUND-4 F-R4-C) ───────── */
.pma-pw-meter {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	font-size: 12px;
	min-height: 18px;
}
.pma-pw-bars {
	display: inline-flex;
	gap: 4px;
	flex: 0 0 auto;
}
.pma-pw-bars i {
	width: 36px;
	height: 5px;
	border-radius: 3px;
	background: var(--pma-border-soft, #e5e7eb);
	transition: background 200ms ease;
}
.pma-pw-label {
	color: var(--pma-ink-muted, #6b7280);
	font-weight: 600;
	letter-spacing: 0.02em;
}
.pma-pw-meter[data-score="1"] .pma-pw-bars i:nth-child(-n+1),
.pma-pw-meter[data-score="2"] .pma-pw-bars i:nth-child(-n+1) {
	background: var(--pma-danger, #ef4444);
}
.pma-pw-meter[data-score="1"] .pma-pw-label,
.pma-pw-meter[data-score="2"] .pma-pw-label {
	color: var(--pma-danger, #ef4444);
}
.pma-pw-meter[data-score="3"] .pma-pw-bars i:nth-child(-n+2) {
	background: var(--pma-warning, #f59e0b);
}
.pma-pw-meter[data-score="3"] .pma-pw-label {
	color: var(--pma-warning, #f59e0b);
}
.pma-pw-meter[data-score="4"] .pma-pw-bars i:nth-child(-n+3) {
	background: var(--pma-info, #3b82f6);
}
.pma-pw-meter[data-score="4"] .pma-pw-label {
	color: var(--pma-info, #3b82f6);
}
.pma-pw-meter[data-score="5"] .pma-pw-bars i {
	background: var(--pma-success, #10b981);
}
.pma-pw-meter[data-score="5"] .pma-pw-label {
	color: var(--pma-success, #10b981);
}
.pma-auth-secondary-link {
	display: inline-block;
	color: var(--pma-ink-muted, #6b7280);
	font-size: 13px;
	text-decoration: none;
	transition: color 150ms;
}
.pma-auth-secondary-link:hover { color: var(--pma-primary, #6366f1); }

/* Messages */
.pma-auth-message {
	padding: 10px 14px;
	border-radius: var(--pma-radius-sm);
	font-size: 13px;
	margin-bottom: 16px;
	line-height: 1.4;
}

.pma-auth-message.pma-msg-error {
	background: var(--pma-danger-bg);
	color: var(--pma-danger-ink);
	border: 1px solid color-mix(in oklch, var(--pma-danger) 30%, transparent);
}

.pma-auth-message.pma-msg-success {
	background: var(--pma-success-bg);
	color: var(--pma-success-ink);
	border: 1px solid color-mix(in oklch, var(--pma-success) 30%, transparent);
}

/* Footer */
.pma-auth-footer {
	text-align: center;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--pma-border);
}

.pma-auth-footer p {
	margin: 0;
	font-size: 14px;
	color: var(--pma-text-secondary);
}

.pma-auth-footer a {
	color: var(--pma-primary);
	font-weight: 600;
	text-decoration: none;
}

.pma-auth-footer a:hover {
	text-decoration: underline;
}

/* Auth links row */
.pma-auth-links {
	text-align: right;
	margin-bottom: 20px;
}

.pma-auth-links a {
	font-size: 13px;
	color: var(--pma-primary);
	text-decoration: none;
}

.pma-auth-links a:hover {
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 520px) {
	.pma-auth-wrap {
		margin: 20px 16px;
	}

	.pma-auth-hero {
		padding: 28px 20px 24px;
	}

	.pma-auth-card {
		padding: 24px 20px;
	}

	.pma-auth-card .pma-form-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.pma-auth-hero h1 {
		font-size: 22px;
	}
}
