/**
 * Freedomman Theme - Authentication Stylesheet (Auth V1)
 *
 * Visual Source of Truth: Approved Auth Mockup V1 (Desktop 1440px / Mobile 375px)
 * Strictly adheres to Freedomman Design System v1.0 (LOCKED)
 *
 * Scope:
 * - Login (/dang-nhap/)
 * - Register (/dang-ky/)
 * - Forgot Password (/quen-mat-khau/)
 * - Reset Password (/dat-lai-mat-khau/)
 *
 * @package Freedomman
 * @version 1.0.0
 */

/* --------------------------------------------------------------------------
 * 1. Global Auth Layout & Page Backdrop
 * -------------------------------------------------------------------------- */
body.fm-auth-body {
	background-color: var(--fm-bg-page, #030812);
	color: var(--fm-text-primary, #F7F9FC);
	font-family: var(--fm-font-primary, 'Be Vietnam Pro', sans-serif);
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow-x: hidden;
}

.fm-auth-page {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	position: relative;
	min-height: 100vh;
	box-sizing: border-box;
}

/* Ambient Radial Glows (Controlled Glows Only per Section 4) */
.fm-auth-ambient {
	position: absolute;
	width: 600px;
	height: 600px;
	border-radius: 50%;
	filter: blur(140px);
	pointer-events: none;
	opacity: 0.12;
	z-index: 0;
}

.fm-auth-ambient-cyan {
	top: -100px;
	left: 10%;
	background: radial-gradient(circle, var(--fm-brand-cyan, #00DDFB) 0%, transparent 70%);
}

.fm-auth-ambient-violet {
	bottom: -100px;
	right: 10%;
	background: radial-gradient(circle, var(--fm-brand-violet, #7357FF) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
 * 2. Main Authentication Card (Split Two-Column on Desktop)
 * -------------------------------------------------------------------------- */
.fm-auth-container {
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.fm-auth-card {
	background-color: var(--fm-bg-surface, #09111F);
	border: 1px solid var(--fm-border-subtle, #1B2940);
	border-radius: 24px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 50px rgba(0, 221, 251, 0.04);
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	overflow: hidden;
	min-height: 640px;
}

/* --------------------------------------------------------------------------
 * 3. Left Column: Form & Core Interactions
 * -------------------------------------------------------------------------- */
.fm-auth-panel-form {
	padding: 48px 44px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: var(--fm-bg-surface, #09111F);
	position: relative;
	z-index: 2;
}

/* Brand Header Logo */
.fm-auth-brand-row {
	margin-bottom: 28px;
}

.fm-auth-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--fm-text-primary, #F7F9FC);
	transition: opacity 0.2s ease;
}

.fm-auth-logo:hover {
	opacity: 0.9;
}

.fm-auth-logo-text {
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #FFFFFF;
}

.fm-auth-logo-text .fm-logo-tld {
	color: var(--fm-brand-cyan, #00DDFB);
}

/* Title & Description */
.fm-auth-header {
	margin-bottom: 24px;
}

.fm-auth-title {
	font-size: 1.875rem;
	font-weight: 700;
	line-height: 1.25;
	color: #FFFFFF;
	margin: 0 0 8px 0;
	letter-spacing: -0.02em;
}

.fm-auth-desc {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--fm-text-secondary, #C7D0DE);
	margin: 0;
}

/* --------------------------------------------------------------------------
 * 4. Alert & Feedback Banners (Matches Mockup Notifications Exactly)
 * -------------------------------------------------------------------------- */
.fm-auth-alert {
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 20px;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 0.875rem;
	line-height: 1.45;
}

.fm-auth-alert .fm-alert-icon {
	flex-shrink: 0;
	margin-top: 1px;
}

.fm-auth-alert-error {
	background: rgba(255, 93, 108, 0.1);
	border: 1px solid rgba(255, 93, 108, 0.35);
	color: #FF7B88;
}

.fm-auth-alert-error .fm-alert-icon {
	stroke: var(--fm-color-error, #FF5D6C);
}

.fm-auth-alert-success {
	background: rgba(37, 214, 149, 0.1);
	border: 1px solid rgba(37, 214, 149, 0.35);
	color: #38E6A6;
}

.fm-auth-alert-success .fm-alert-icon {
	stroke: var(--fm-color-success, #25D695);
}

.fm-auth-alert-info {
	background: rgba(0, 221, 251, 0.08);
	border: 1px solid rgba(0, 221, 251, 0.3);
	color: #00DDFB;
}

.fm-auth-alert-info .fm-alert-icon {
	stroke: var(--fm-brand-cyan, #00DDFB);
}

.fm-alert-content p {
	margin: 0;
}

.fm-alert-content p + p {
	margin-top: 4px;
}

/* --------------------------------------------------------------------------
 * 5. Form Elements & Input States
 * -------------------------------------------------------------------------- */
.fm-auth-form {
	display: flex;
	flex-direction: column;
}

.fm-form-group {
	margin-bottom: 18px;
}

.fm-auth-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--fm-text-secondary, #C7D0DE);
	margin-bottom: 6px;
}

.fm-auth-input {
	width: 100%;
	height: 48px;
	border-radius: 10px;
	background-color: var(--fm-bg-surface-raised, #0D1728);
	border: 1px solid var(--fm-border-subtle, #1B2940);
	color: #FFFFFF;
	padding: 0 16px;
	font-size: 0.9375rem;
	font-family: inherit;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.fm-auth-input::placeholder {
	color: var(--fm-text-muted, #8F9BAE);
	opacity: 0.7;
}

.fm-auth-input:hover {
	border-color: var(--fm-border-visible, #2B4164);
}

.fm-auth-input:focus {
	outline: none;
	border-color: var(--fm-brand-cyan, #00DDFB);
	box-shadow: 0 0 0 3px rgba(0, 221, 251, 0.22);
	background-color: #111C32;
}

.fm-auth-input.is-error {
	border-color: var(--fm-color-error, #FF5D6C);
	box-shadow: 0 0 0 3px rgba(255, 93, 108, 0.2);
}

.fm-auth-input.is-valid {
	border-color: var(--fm-color-success, #25D695);
}

/* Password Input with Show/Hide Toggle */
.fm-password-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.fm-password-wrap .fm-auth-input {
	padding-right: 48px;
}

.fm-password-toggle {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	color: var(--fm-text-muted, #8F9BAE);
	cursor: pointer;
	padding: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.fm-password-toggle:hover {
	color: #FFFFFF;
	background-color: rgba(255, 255, 255, 0.06);
}

.fm-password-toggle:focus-visible {
	outline: 2px solid var(--fm-brand-cyan, #00DDFB);
	outline-offset: 1px;
}

/* --------------------------------------------------------------------------
 * 6. Password Requirements Live Checklist
 * -------------------------------------------------------------------------- */
.fm-password-reqs {
	list-style: none;
	padding: 0;
	margin: -6px 0 18px 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fm-req-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8125rem;
	color: var(--fm-text-disabled, #596579);
	transition: color 0.2s ease;
}

.fm-req-icon {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: rgba(89, 101, 121, 0.2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 700;
	color: #8F9BAE;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.fm-req-item.is-met {
	color: var(--fm-color-success, #25D695);
	font-weight: 500;
}

.fm-req-item.is-met .fm-req-icon {
	background: rgba(37, 214, 149, 0.18);
	color: var(--fm-color-success, #25D695);
}

.fm-req-item.is-unmet.is-dirty {
	color: var(--fm-color-error, #FF5D6C);
}

.fm-req-item.is-unmet.is-dirty .fm-req-icon {
	background: rgba(255, 93, 108, 0.18);
	color: var(--fm-color-error, #FF5D6C);
}

/* --------------------------------------------------------------------------
 * 7. Checkboxes & Auxiliary Rows
 * -------------------------------------------------------------------------- */
.fm-auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 4px 0 20px 0;
	font-size: 0.875rem;
}

.fm-auth-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	color: var(--fm-text-secondary, #C7D0DE);
	user-select: none;
	font-size: 0.875rem;
	line-height: 1.4;
}

.fm-auth-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fm-checkbox-custom {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	background: var(--fm-bg-surface-raised, #0D1728);
	border: 1px solid var(--fm-border-visible, #2B4164);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.fm-auth-checkbox:checked + .fm-checkbox-custom {
	background: var(--fm-brand-blue, #2788FF);
	border-color: var(--fm-brand-cyan, #00DDFB);
}

.fm-auth-checkbox:checked + .fm-checkbox-custom::after {
	content: '';
	width: 5px;
	height: 9px;
	border: solid #FFFFFF;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	margin-bottom: 2px;
}

.fm-auth-checkbox:focus-visible + .fm-checkbox-custom {
	outline: 2px solid var(--fm-brand-cyan, #00DDFB);
	outline-offset: 2px;
}

.fm-auth-link-forgot {
	color: var(--fm-brand-cyan, #00DDFB);
	text-decoration: none;
	font-weight: 500;
	transition: opacity 0.2s ease;
}

.fm-auth-link-forgot:hover {
	opacity: 0.85;
	text-decoration: underline;
}

.fm-terms-group {
	margin-top: 4px;
	margin-bottom: 22px;
}

.fm-link-terms {
	color: var(--fm-brand-cyan, #00DDFB);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.fm-link-terms:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
 * 8. Primary CTA Buttons & Social UI
 * -------------------------------------------------------------------------- */
.fm-auth-btn-submit {
	width: 100%;
	height: 48px;
	border-radius: 10px;
	background: var(--fm-gradient-primary);
	color: #FFFFFF;
	font-size: 1rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 0 4px 18px rgba(115, 87, 255, 0.35);
	transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.fm-auth-btn-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 22px rgba(0, 221, 251, 0.4);
}

.fm-auth-btn-submit:active {
	transform: translateY(0);
}

.fm-auth-btn-submit:focus-visible {
	outline: 2px solid var(--fm-brand-cyan, #00DDFB);
	outline-offset: 2px;
}

/* Divider "hoặc" */
.fm-auth-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 20px 0;
	color: var(--fm-text-muted, #8F9BAE);
	font-size: 0.8125rem;
}

.fm-divider-line {
	flex: 1;
	height: 1px;
	background-color: var(--fm-border-subtle, #1B2940);
}

/* Social Buttons */
.fm-auth-social-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 22px;
}

.fm-auth-social-btn {
	height: 44px;
	border-radius: 10px;
	background: var(--fm-bg-surface-raised, #0D1728);
	border: 1px solid var(--fm-border-subtle, #1B2940);
	color: var(--fm-text-secondary, #C7D0DE);
	font-size: 0.84375rem;
	font-weight: 500;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: not-allowed;
	opacity: 0.65;
	transition: opacity 0.2s ease;
	user-select: none;
}

.fm-auth-social-btn:hover {
	opacity: 0.75;
}

/* Switch Links (Đăng ký / Đăng nhập) */
.fm-auth-switch-text {
	text-align: center;
	font-size: 0.875rem;
	color: var(--fm-text-muted, #8F9BAE);
	margin: 6px 0 0 0;
}

.fm-auth-switch-link {
	color: var(--fm-brand-cyan, #00DDFB);
	font-weight: 600;
	text-decoration: none;
	margin-left: 4px;
	transition: opacity 0.2s ease;
}

.fm-auth-switch-link:hover {
	opacity: 0.85;
	text-decoration: underline;
}

.fm-auth-secondary-action {
	text-align: center;
	margin-top: 18px;
}

.fm-auth-link-secondary {
	color: var(--fm-brand-cyan, #00DDFB);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: opacity 0.2s ease;
}

.fm-auth-link-secondary:hover {
	opacity: 0.85;
	text-decoration: underline;
}

.fm-auth-success-action,
.fm-auth-expired-action {
	margin-top: 16px;
}

/* --------------------------------------------------------------------------
 * 9. Right Column: Artwork & Benefit Cards (Desktop)
 * -------------------------------------------------------------------------- */
.fm-auth-panel-artwork {
	background: linear-gradient(180deg, #070D18 0%, #050A13 100%);
	border-left: 1px solid var(--fm-border-subtle, #1B2940);
	padding: 40px 36px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.fm-auth-artwork-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	margin-bottom: 20px;
}

.fm-auth-art-glow {
	position: absolute;
	width: 180px;
	height: 180px;
	background: radial-gradient(circle, rgba(0, 221, 251, 0.2) 0%, rgba(115, 87, 255, 0.08) 50%, transparent 70%);
	filter: blur(25px);
	pointer-events: none;
}

.fm-auth-art-svg {
	max-width: 100%;
	height: auto;
	filter: drop-shadow(0 0 16px rgba(0, 221, 251, 0.2));
	position: relative;
	z-index: 1;
}

.fm-auth-benefits-title {
	font-size: 1.125rem;
	font-weight: 700;
	color: #FFFFFF;
	margin: 0 0 14px 0;
	letter-spacing: -0.01em;
}

.fm-auth-benefits-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.fm-benefit-card {
	background: var(--fm-bg-surface, #09111F);
	border: 1px solid var(--fm-border-subtle, #1B2940);
	border-radius: 12px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
	transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.fm-benefit-card:hover {
	border-color: rgba(0, 221, 251, 0.35);
	background: var(--fm-bg-surface-raised, #0D1728);
	transform: translateX(3px);
}

.fm-benefit-icon-box {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(0, 221, 251, 0.08);
	border: 1px solid rgba(0, 221, 251, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fm-brand-cyan, #00DDFB);
	flex-shrink: 0;
}

.fm-benefit-body {
	flex: 1;
}

.fm-benefit-title {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fm-text-primary, #F7F9FC);
	margin: 0 0 2px 0;
}

.fm-benefit-desc {
	font-size: 0.78125rem;
	color: var(--fm-text-muted, #8F9BAE);
	margin: 0;
	line-height: 1.35;
}

/* --------------------------------------------------------------------------
 * 10. Responsive Adaptations (Tablet & Mobile Breakpoints)
 * -------------------------------------------------------------------------- */

/* Tablet (1024px - 768px): Collapse to focused single card before cramping */
@media (max-width: 1024px) {
	.fm-auth-container {
		max-width: 580px;
	}

	.fm-auth-card {
		grid-template-columns: 1fr;
		min-height: auto;
	}

	.fm-auth-panel-artwork {
		display: none; /* Hide artwork on tablet to prioritize form usability (Section 22) */
	}

	.fm-auth-panel-form {
		padding: 40px 36px;
	}
}

/* Mobile (767px and below: 430px, 390px, 375px) */
@media (max-width: 767px) {
	.fm-auth-page {
		padding: 24px 16px;
		align-items: flex-start;
	}

	.fm-auth-card {
		background: transparent;
		border: none;
		box-shadow: none;
		border-radius: 0;
	}

	.fm-auth-panel-form {
		padding: 0;
		background: transparent;
	}

	.fm-auth-title {
		font-size: 1.625rem;
	}

	.fm-auth-desc {
		font-size: 0.875rem;
	}

	.fm-auth-input {
		height: 48px;
		font-size: 16px; /* Prevents auto-zoom on iOS */
	}

	.fm-auth-social-list {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.fm-auth-social-btn {
		height: 46px;
	}

	.fm-auth-btn-submit {
		height: 48px;
	}
}
