/**
 * FairBusiness Auth — Structural CSS
 *
 * Provides base layout and structure for auth forms.
 * Theme should override visual styles (colors, fonts, borders).
 * Uses BEM naming convention.
 */

/* Wrapper */
.fb-auth-wrapper {
	display: flex;
	justify-content: center;
	padding: 40px 20px;
}

/* Card */
.fb-auth-card {
	width: 100%;
	max-width: 440px;
	padding: 32px;
}

.fb-auth-card__title {
	margin: 0 0 8px;
	font-size: 24px;
	text-align: center;
}

.fb-auth-card__subtitle {
	margin: 0 0 24px;
	text-align: center;
	font-size: 14px;
}

.fb-auth-card__footer {
	margin-top: 24px;
	text-align: center;
	font-size: 14px;
}

/* Tabs */
.fb-auth-tabs {
	display: flex;
	margin-bottom: 24px;
	border-bottom: 2px solid #eee;
}

.fb-auth-tabs__tab {
	flex: 1;
	padding: 12px;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: border-color 0.2s;
}

.fb-auth-tabs__tab--active {
	border-bottom-color: currentColor;
}

/* Form groups — scoped to .fb-auth-card (3-M15 fix) */
.fb-auth-card .fb-form-group {
	margin-bottom: 16px;
}

.fb-auth-card .fb-form-group label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
}

.fb-auth-card .fb-form-group input,
.fb-auth-card .fb-form-group select,
.fb-auth-card .fb-form-group textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-sizing: border-box;
}

.fb-auth-card .fb-form-group input:focus,
.fb-auth-card .fb-form-group select:focus,
.fb-auth-card .fb-form-group textarea:focus {
	outline: none;
	border-color: #666;
}

.fb-auth-card .fb-form-group--row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.fb-auth-card .fb-form-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #888;
}

/* Checkbox — scoped (3-M15 fix) */
.fb-auth-card .fb-checkbox {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	cursor: pointer;
}

.fb-auth-card .fb-checkbox input {
	width: auto;
}

/* Buttons */
.fb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 500;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: opacity 0.2s;
	text-decoration: none;
}

.fb-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.fb-btn--primary {
	background: #333;
	color: #fff;
	border-color: #333;
}

.fb-btn--secondary {
	background: #fff;
	color: #333;
	border-color: #ddd;
}

.fb-btn--full {
	width: 100%;
}

/* Form message — scoped (3-M15, 3-L9 fix) */
.fb-auth-card .fb-form-message {
	margin-bottom: 16px;
	padding: 0;
	font-size: 14px;
	border-radius: 4px;
	display: none;
}

.fb-auth-card .fb-form-message--error {
	display: block;
	padding: 10px 12px;
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.fb-auth-card .fb-form-message--success {
	display: block;
	padding: 10px 12px;
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* Auth link */
.fb-auth-link {
	font-size: 14px;
	text-decoration: none;
}

/* Registration choice cards */
.fb-auth-choices {
	display: flex;
	gap: 16px;
	margin-bottom: 24px;
}

.fb-auth-choice {
	flex: 1;
	display: block;
	padding: 24px;
	text-align: center;
	text-decoration: none;
	color: inherit;
	border: 1px solid #ddd;
	border-radius: 8px;
	transition: border-color 0.2s;
}

.fb-auth-choice:hover {
	border-color: #999;
}

.fb-auth-choice__icon {
	font-size: 32px;
	margin-bottom: 12px;
}

.fb-auth-choice__title {
	margin: 0 0 8px;
	font-size: 16px;
}

.fb-auth-choice__desc {
	margin: 0;
	font-size: 13px;
	color: #666;
}

/* Multi-step form */
.fb-auth-step__title {
	margin: 0 0 20px;
	font-size: 16px;
}

.fb-auth-step__buttons {
	display: flex;
	gap: 12px;
}

.fb-auth-step__buttons .fb-btn {
	flex: 1;
}

/* Loading spinner */
.fb-loading-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid transparent;
	border-top-color: currentColor;
	border-radius: 50%;
	animation: fb-spin 0.6s linear infinite;
	margin-right: 8px;
}

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

/* Auth notice */
.fb-auth-notice {
	text-align: center;
	padding: 16px;
	font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
	.fb-auth-card {
		padding: 20px;
	}

	.fb-auth-choices {
		flex-direction: column;
	}

	.fb-auth-card .fb-form-group--row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
