/* FundMart — Auth Pages (Login, Register) */

.fm-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - var(--fm-header-height) - 80px);
	padding: 40px 16px;
}

.fm-auth__card {
	background: var(--fm-surface);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius-lg);
	box-shadow: var(--fm-shadow-lg);
	padding: 40px;
	width: 100%;
	max-width: 440px;
}

.fm-auth__card--wide {
	max-width: 600px;
}

.fm-auth__title {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 8px;
}

.fm-auth__subtitle {
	color: var(--fm-text-muted);
	margin-bottom: 24px;
}

.fm-auth__error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: var(--fm-danger);
	padding: 12px 16px;
	border-radius: var(--fm-radius);
	margin-bottom: 16px;
	font-size: 0.875rem;
}

.fm-auth__success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: var(--fm-success);
	padding: 12px 16px;
	border-radius: var(--fm-radius);
	margin-bottom: 16px;
	font-size: 0.875rem;
}

.fm-auth__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.fm-auth__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.fm-auth__field--full {
	grid-column: 1 / -1;
}

.fm-auth__field label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 6px;
}

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

.fm-auth__field .optional {
	color: var(--fm-text-muted);
	font-weight: 400;
}

.fm-auth__field input,
.fm-auth__field select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	font-size: 0.9375rem;
	font-family: var(--fm-font);
	transition: border-color 0.15s;
}

.fm-auth__field input:focus,
.fm-auth__field select:focus {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fm-auth__field--row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.fm-auth__section-title {
	grid-column: 1 / -1;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fm-text-muted);
	margin: 8px 0 -2px;
	padding-top: 16px;
	border-top: 1px solid var(--fm-border);
}

.fm-auth__grid > .fm-auth__section-title:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.fm-auth__field textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	font-size: 0.9375rem;
	font-family: var(--fm-font);
	resize: vertical;
	min-height: 64px;
	transition: border-color 0.15s;
}

.fm-auth__field textarea:focus {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fm-phone-input {
	display: flex;
	align-items: stretch;
}

.fm-phone-input__code {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 12px;
	border: 1px solid var(--fm-border);
	border-right: none;
	border-radius: var(--fm-radius) 0 0 var(--fm-radius);
	background: var(--fm-surface-alt, #f3f4f6);
	color: var(--fm-text-muted);
	font-size: 0.9375rem;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
	transition: color 0.15s;
}

.fm-phone-input__code.is-set {
	color: var(--fm-text);
}

.fm-phone-input input {
	border-radius: 0 var(--fm-radius) var(--fm-radius) 0 !important;
}

/* Multi-step registration wizard */
.fm-wizard-progress {
	display: flex;
	align-items: center;
	margin-bottom: 24px;
}

.fm-wizard-step {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.fm-wizard-step__num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--fm-surface-alt, #f3f4f6);
	border: 1px solid var(--fm-border);
	color: var(--fm-text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	flex-shrink: 0;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fm-wizard-step__label {
	font-size: 0.8125rem;
	color: var(--fm-text-muted);
	font-weight: 500;
	white-space: nowrap;
}

.fm-wizard-step.is-active .fm-wizard-step__num {
	background: var(--fm-primary);
	border-color: var(--fm-primary);
	color: #fff;
}

.fm-wizard-step.is-active .fm-wizard-step__label {
	color: var(--fm-text);
}

.fm-wizard-step.is-done .fm-wizard-step__num {
	background: var(--fm-success);
	border-color: var(--fm-success);
	color: #fff;
}

.fm-wizard-line {
	flex: 1;
	height: 1px;
	background: var(--fm-border);
	margin: 0 10px;
}

.fm-wizard-panel {
	display: none;
}

.fm-wizard-panel.is-active {
	display: grid;
}

.fm-wizard-actions {
	display: none !important;
}

.fm-wizard-actions.is-active {
	display: flex !important;
}

.fm-wizard-review__box {
	background: var(--fm-surface-alt, #f9fafb);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	padding: 12px 16px;
	margin-top: 8px;
}

.fm-wizard-review__box > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid var(--fm-border);
	font-size: 0.875rem;
}

.fm-wizard-review__box > div:last-child {
	border-bottom: none;
}

.fm-wizard-review__box span {
	color: var(--fm-text-muted);
}

.fm-wizard-review__box strong {
	text-align: right;
	word-break: break-word;
	max-width: 60%;
}

.fm-auth__link {
	color: var(--fm-primary);
	text-decoration: none;
	font-size: 0.875rem;
}

.fm-auth__link:hover {
	text-decoration: underline;
}

.fm-auth__footer {
	text-align: center;
	margin-top: 20px;
	font-size: 0.875rem;
	color: var(--fm-text-muted);
}

.fm-auth__footer a {
	color: var(--fm-primary);
	text-decoration: none;
	font-weight: 500;
}

/* Password Strength Meter */
.fm-password-strength {
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.fm-password-strength__bar {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--fm-border);
	transition: width 0.3s, background 0.3s;
	width: 0%;
}

.fm-password-strength__text {
	font-size: 0.75rem;
	font-weight: 600;
	min-width: 80px;
}

/* OTP Input */
.fm-otp-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 24px 0;
}

.fm-otp-input {
	width: 48px;
	height: 56px;
	text-align: center;
	font-size: 1.5rem;
	font-weight: 700;
	border: 2px solid var(--fm-border);
	border-radius: var(--fm-radius);
	font-family: var(--fm-font);
	transition: border-color 0.15s;
}

.fm-otp-input:focus {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fm-otp-resend {
	text-align: center;
	margin-top: 16px;
}

@media (max-width: 640px) {
	.fm-auth__card {
		padding: 24px;
	}

	.fm-auth__grid {
		grid-template-columns: 1fr;
	}
}
