/* -------------------------------------------------------------------------
   Standalone login / register / lost-password (Lumo)
   ------------------------------------------------------------------------- */

.leafs-auth-standalone .leafs-main.leafs-auth-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - 120px);
	padding: 32px 16px 48px;
	position: relative;
	z-index: 1;
}

.leafs-auth-screen__bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

/* 底层纹理（::before）：不遮挡 gradient / neural 前景层 */
body.leafs-auth-standalone .leafs-auth-screen__bg::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: url("../images/ambient/ambient-auth-light.webp");
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	opacity: 0.2;
}

html[data-leafs-theme="dark"] body.leafs-auth-standalone .leafs-auth-screen__bg::before {
	background-image: url("../images/ambient/ambient-auth-dark.webp");
	opacity: 0.24;
}

.leafs-auth-screen__bg-gradient {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	background: linear-gradient(168deg, #dbe8f2 0%, #b8cad8 50%, #9fb8d4 100%);
}

html[data-leafs-theme="dark"] .leafs-auth-screen__bg-gradient {
	background: linear-gradient(168deg, #0a192f 0%, #061525 55%, #020c18 100%);
}

.leafs-auth-screen__neural {
	position: absolute;
	inset: 0;
	z-index: 1;
	min-height: 100%;
	pointer-events: none;
}

.leafs-auth-screen__neural .leafs-hero__bg {
	position: absolute;
	inset: 0;
}

.leafs-auth-screen__neural .leafs-hero__solid {
	background: linear-gradient(168deg, #dbe8f2 0%, #c8dae8 42%, #b2ccde 100%);
}

html[data-leafs-theme="dark"] .leafs-auth-screen__neural .leafs-hero__solid {
	background: linear-gradient(168deg, #0a192f 0%, #061525 52%, #020c18 100%);
}

.leafs-auth-screen__neural-overlay {
	opacity: 0.42 !important;
}

.leafs-auth-screen__card {
	width: 100%;
	max-width: 480px;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
	padding: 32px;
}

.leafs-auth-card-page--narrow {
	max-width: 400px;
}

html[data-leafs-theme="dark"] .leafs-auth-screen__card {
	background: #1e2128;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.leafs-auth-brand {
	display: inline-flex;
	align-items: center;
	margin-bottom: 20px;
	text-decoration: none;
	color: inherit;
}

.leafs-auth-brand__img {
	max-height: 44px;
	width: auto;
	display: block;
}

.leafs-auth-brand__title {
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--leafs-text, #1a1a1a);
}

html[data-leafs-theme="dark"] .leafs-auth-brand__title {
	color: var(--leafs-text, #e8eaed);
}

.leafs-auth-card-page__title {
	margin: 0 0 8px;
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.leafs-auth-card-page__lead {
	margin: 0 0 24px;
	color: var(--leafs-muted, #5c6570);
	font-size: 0.95rem;
}

.leafs-auth-card-page__alert {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	border-radius: 14px;
	margin-bottom: 16px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--leafs-text);
	background: var(--leafs-card);
	border: 1px solid color-mix(in srgb, var(--leafs-danger) 32%, var(--leafs-border));
	box-shadow: var(--leafs-shadow-card);
}

.leafs-auth-card-page__alert::before {
	content: '!';
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	font-weight: 700;
	background: var(--leafs-danger);
	color: var(--leafs-on-primary);
	box-shadow: 0 6px 14px color-mix(in srgb, var(--leafs-danger) 35%, transparent);
}

.leafs-auth-card-page__alert.is-success {
	color: var(--leafs-text);
	background: var(--leafs-card);
	border-color: color-mix(in srgb, var(--leafs-success) 32%, var(--leafs-border));
	box-shadow: var(--leafs-shadow-card);
	animation: leafs-auth-success-in 0.35s ease;
}

.leafs-auth-card-page__alert.is-success::before {
	content: '✓';
	background: var(--leafs-success);
	box-shadow: 0 6px 14px color-mix(in srgb, var(--leafs-success) 38%, transparent);
}

@keyframes leafs-auth-success-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

html[data-leafs-theme="dark"] .leafs-auth-card-page__alert.is-success {
	border-color: color-mix(in srgb, var(--leafs-success) 42%, var(--leafs-border));
}

.leafs-auth-card-page__notice {
	padding: 10px 14px;
	border-radius: 12px;
	margin-bottom: 16px;
	font-size: 0.9rem;
}

.leafs-auth-card-page__notice--err {
	background: rgba(220, 53, 69, 0.12);
	color: #b02a37;
}

.leafs-auth-card-page__notice--ok {
	background: var(--leafs-card);
	color: var(--leafs-text);
	border: 1px solid color-mix(in srgb, var(--leafs-success) 32%, var(--leafs-border));
}

.leafs-auth-fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.leafs-auth-field-row {
	display: flex;
	align-items: stretch;
	gap: 12px;
}

.leafs-auth-field-row--noicon .leafs-auth-field-row__main {
	margin-left: 0;
}

.leafs-auth-field-row__icon {
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--leafs-muted, #6c757d);
	border: 1px solid #e9ecef;
	border-radius: 12px;
	background: transparent;
}

html[data-leafs-theme="dark"] .leafs-auth-field-row__icon {
	border-color: #2d2f36;
	color: #9aa0a6;
}

.leafs-auth-field-row__main {
	position: relative;
	flex: 1;
	min-width: 0;
}

.leafs-auth-field-row__input {
	width: 100%;
	height: 48px;
	padding: 0 44px 0 16px;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	font-size: 15px;
	background: transparent;
	color: inherit;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

html[data-leafs-theme="dark"] .leafs-auth-field-row__input {
	border-color: #2d2f36;
}

.leafs-auth-field-row__input:focus {
	outline: none;
	border-color: var(--leafs-brand, #2d6a4f);
	box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.leafs-auth-field-row__input.is-invalid {
	border-color: #dc3545;
}

.leafs-auth-toggle-pass {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--leafs-muted, #6c757d);
	cursor: pointer;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.leafs-auth-toggle-pass:hover {
	color: var(--leafs-brand, #2d6a4f);
}

.leafs-auth-field-row__err {
	display: block;
	margin-top: 6px;
	font-size: 0.82rem;
	color: #dc3545;
}

.leafs-auth-field-row__hint {
	display: block;
	margin-top: 6px;
	font-size: 0.82rem;
	color: var(--leafs-muted, #6c757d);
}

.leafs-auth-field-row__hint.is-ok {
	color: #2d6a4f;
}

.leafs-auth-row-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: -4px;
}

.leafs-auth-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	cursor: pointer;
}

.leafs-auth-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--leafs-brand, #2d6a4f);
	border-radius: 4px;
}

.leafs-auth-link-muted {
	font-size: 0.9rem;
	color: var(--leafs-link, #2d6a4f);
	text-decoration: none;
}

.leafs-auth-link-muted:hover {
	color: var(--leafs-brand-hover, #1b9c85);
}

.leafs-auth-btn-primary {
	position: relative;
	width: 100%;
	height: 48px;
	margin-top: 4px;
	border: none;
	border-radius: 40px;
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(135deg, #2d6a4f, #1b9c85);
	box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
	transition:
		filter 0.2s ease,
		box-shadow 0.2s ease;
}

.leafs-auth-btn-primary:hover:not(:disabled) {
	filter: brightness(1.05);
	box-shadow: 0 6px 18px rgba(45, 106, 79, 0.45);
}

.leafs-auth-btn-primary:disabled {
	opacity: 0.72;
	cursor: not-allowed;
}

.leafs-auth-btn-primary.is-loading .leafs-auth-btn-primary__text {
	opacity: 0.35;
}

.leafs-auth-btn-primary__spin {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: leafs-auth-spin 0.7s linear infinite;
}

.leafs-auth-btn-primary.is-loading .leafs-auth-btn-primary__spin {
	display: block !important;
}

@keyframes leafs-auth-spin {
	to {
		transform: rotate(360deg);
	}
}

.leafs-auth-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	margin-top: 12px;
	border-radius: 40px;
	border: 1px solid var(--leafs-brand, #2d6a4f);
	color: var(--leafs-brand, #2d6a4f);
	font-weight: 600;
	text-decoration: none;
	background: transparent;
}

.leafs-auth-btn-secondary:hover {
	background: rgba(45, 106, 79, 0.08);
}

.leafs-auth-pass-meter {
	height: 4px;
	border-radius: 2px;
	background: #e9ecef;
	margin-top: 8px;
	overflow: hidden;
}

html[data-leafs-theme="dark"] .leafs-auth-pass-meter {
	background: #2d2f36;
}

.leafs-auth-pass-meter__bar {
	height: 100%;
	width: 0;
	border-radius: 2px;
	transition:
		width 0.25s ease,
		background 0.25s ease;
}

.leafs-auth-pass-meter__bar.is-weak {
	width: 33%;
	background: #e74c3c;
}

.leafs-auth-pass-meter__bar.is-medium {
	width: 66%;
	background: #f1c40f;
}

.leafs-auth-pass-meter__bar.is-strong {
	width: 100%;
	background: #27ae60;
}

.leafs-auth-pass-meter__label {
	margin: 4px 0 0;
	font-size: 0.78rem;
	color: var(--leafs-muted, #6c757d);
	min-height: 1.2em;
}

.leafs-auth-social-page {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid #e9ecef;
	text-align: center;
}

html[data-leafs-theme="dark"] .leafs-auth-social-page {
	border-color: #2d2f36;
}

.leafs-auth-social-page__label {
	display: block;
	font-size: 0.85rem;
	color: var(--leafs-muted, #6c757d);
	margin-bottom: 14px;
}

.leafs-auth-social-page__grid {
	display: flex;
	justify-content: center;
	gap: 14px;
}

.leafs-auth-social-page__btn {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f1f3f5;
	color: #495057;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	transition:
		background 0.2s ease,
		color 0.2s ease;
}

.leafs-auth-social-page__btn:hover:not(.is-disabled) {
	background: var(--leafs-brand, #2d6a4f);
	color: #fff;
}

.leafs-auth-social-page__btn.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

html[data-leafs-theme="dark"] .leafs-auth-social-page__btn {
	background: #2d2f36;
	color: #ced4da;
}

.leafs-auth-card-page__switch {
	margin: 24px 0 0;
	text-align: center;
	font-size: 0.92rem;
	color: var(--leafs-muted, #6c757d);
}

.leafs-auth-card-page__switch a {
	color: var(--leafs-brand, #2d6a4f);
	font-weight: 600;
	text-decoration: none;
}

.leafs-auth-card-page__switch a:hover {
	color: var(--leafs-brand-hover, #1b9c85);
}

.leafs-auth-screen__footer {
	margin-top: 28px;
	text-align: center;
	font-size: 0.85rem;
	color: var(--leafs-muted, #6c757d);
	position: relative;
	z-index: 1;
}

.leafs-auth-screen__footer a {
	color: inherit;
	text-decoration: none;
}

.leafs-auth-screen__footer a:hover {
	color: var(--leafs-brand, #2d6a4f);
}

.leafs-auth-screen__dot {
	margin: 0 6px;
	opacity: 0.5;
}

.leafs-auth-lost-done {
	text-align: center;
}

@media (max-width: 768px) {
	.leafs-auth-screen__card {
		max-width: 90%;
		padding: 24px 20px;
	}

	.leafs-auth-card-page--narrow {
		max-width: 90%;
	}

	.leafs-auth-field-row__input {
		height: 44px;
		font-size: 16px;
	}

	.leafs-auth-btn-primary {
		height: 46px;
	}

	.leafs-auth-social-page__btn {
		width: 40px;
		height: 40px;
		font-size: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.leafs-auth-btn-primary__spin {
		animation: none;
		border-color: rgba(255, 255, 255, 0.6);
	}
}
