/**
 * VMS Elements Form Guard - Auth Forms Styles
 */

/* Form wrapper */
.vefg-auth-form-wrap {
	--vefg-primary: #2563eb;
	--vefg-secondary: #1e40af;
	--vefg-text: #1f2937;
	--vefg-bg: #ffffff;
	--vefg-radius: 8px;
	--vefg-width: 400px;
	--vefg-error: #dc2626;
	--vefg-success: #16a34a;
	--vefg-border: #d1d5db;
	--vefg-muted: #6b7280;
	
	display: flex;
	justify-content: center;
	padding: 20px;
}

.vefg-auth-form {
	width: 100%;
	max-width: var(--vefg-width);
	background: var(--vefg-bg);
	padding: 32px;
	border-radius: var(--vefg-radius);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.vefg-auth-title {
	margin: 0 0 8px 0;
	font-size: 24px;
	font-weight: 600;
	color: var(--vefg-text);
	text-align: center;
}

.vefg-auth-subtitle {
	margin: 0 0 24px 0;
	color: var(--vefg-muted);
	text-align: center;
	font-size: 14px;
}

/* Fields */
.vefg-auth-field {
	margin-bottom: 20px;
}

.vefg-auth-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--vefg-text);
}

.vefg-auth-field label .required {
	color: var(--vefg-error);
}

.vefg-auth-field input[type="text"],
.vefg-auth-field input[type="email"],
.vefg-auth-field input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	border: 1px solid var(--vefg-border);
	border-radius: var(--vefg-radius);
	background: var(--vefg-input-bg);
	color: var(--vefg-text);
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
	box-sizing: border-box;
}

.vefg-auth-field input:hover:not(:focus) {
	border-color: var(--vefg-border-hover);
}

.vefg-auth-field input:focus {
	outline: none;
	border-color: var(--vefg-border-focus);
	background: var(--vefg-input-focus-bg);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vefg-auth-field:focus-within label {
	color: var(--vefg-primary);
}

.vefg-auth-field input.vefg-field-error {
	border-color: var(--vefg-error);
	background: #fef2f2;
}

.vefg-auth-field input.vefg-field-error:focus {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.vefg-auth-field input.vefg-field-success {
	border-color: var(--vefg-success);
	background: #f0fdf4;
}

.vefg-auth-field input.vefg-field-success:focus {
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Password wrapper */
.vefg-auth-password-wrap {
	position: relative;
}

.vefg-auth-password-wrap input {
	padding-right: 44px;
}

.vefg-auth-toggle-pass {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--vefg-muted);
	display: flex;
	align-items: center;
	justify-content: center;
}

.vefg-auth-toggle-pass:hover {
	color: var(--vefg-text);
}

.vefg-auth-toggle-pass .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Password strength */
.vefg-auth-password-strength {
	margin-top: 8px;
	height: 4px;
	border-radius: 2px;
	background: var(--vefg-border);
	overflow: hidden;
}

.vefg-auth-password-strength::after {
	content: '';
	display: block;
	height: 100%;
	width: 0;
	transition: width 0.3s, background 0.3s;
}

.vefg-auth-password-strength.weak::after {
	width: 33%;
	background: var(--vefg-error);
}

.vefg-auth-password-strength.medium::after {
	width: 66%;
	background: #f59e0b;
}

.vefg-auth-password-strength.strong::after {
	width: 100%;
	background: var(--vefg-success);
}

/* Remember me */
.vefg-auth-remember {
	margin-bottom: 24px;
}

.vefg-auth-remember label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.vefg-auth-remember input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--vefg-primary);
}

/* Submit button */
.vefg-auth-submit {
	width: 100%;
	padding: 14px 20px;
	font-size: 16px;
	font-weight: 500;
	background: var(--vefg-primary);
	color: #fff;
	border: none;
	border-radius: var(--vefg-radius);
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.vefg-auth-submit:hover:not(:disabled) {
	background: var(--vefg-secondary);
}

.vefg-auth-submit:active:not(:disabled) {
	transform: scale(0.98);
}

.vefg-auth-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.vefg-auth-submit.vefg-btn-outline {
	background: transparent;
	color: var(--vefg-primary);
	border: 2px solid var(--vefg-primary);
}

.vefg-auth-submit.vefg-btn-outline:hover:not(:disabled) {
	background: var(--vefg-primary);
	color: #fff;
}

.vefg-auth-submit.vefg-btn-gradient {
	background: linear-gradient(135deg, var(--vefg-primary), var(--vefg-secondary));
}

.vefg-auth-submit.vefg-btn-gradient:hover:not(:disabled) {
	opacity: 0.9;
}

/* Spinner */
.vefg-auth-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vefg-spin 0.8s linear infinite;
}

.vefg-auth-submit.loading .vefg-auth-submit-text {
	display: none;
}

.vefg-auth-submit.loading .vefg-auth-spinner {
	display: block;
}

@keyframes vefg-spin {
	to { transform: rotate(360deg); }
}

/* Links */
.vefg-auth-links {
	margin-top: 20px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vefg-auth-links a {
	color: var(--vefg-primary);
	text-decoration: none;
	font-size: 14px;
	transition: color 0.2s;
}

.vefg-auth-links a:hover {
	color: var(--vefg-secondary);
	text-decoration: underline;
}

/* Messages */
.vefg-auth-message-area {
	margin-bottom: 16px;
}

.vefg-auth-message {
	padding: 12px 16px;
	border-radius: var(--vefg-radius);
	font-size: 14px;
	margin-bottom: 16px;
}

.vefg-auth-message--error {
	background: #fef2f2;
	color: var(--vefg-error);
	border: 1px solid #fecaca;
}

.vefg-auth-message--success {
	background: #f0fdf4;
	color: var(--vefg-success);
	border: 1px solid #bbf7d0;
}

.vefg-auth-success-icon {
	text-align: center;
	margin-bottom: 20px;
}

.vefg-auth-success-icon .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: var(--vefg-success, #16a34a);
}

.vefg-auth-link-hint {
	font-size: 13px;
	color: #6b7280;
	margin-top: 12px;
}

/* Field status indicator */
.vefg-auth-field-status {
	display: block;
	margin-top: 4px;
	font-size: 12px;
}

.vefg-auth-field-status.checking {
	color: var(--vefg-muted);
}

.vefg-auth-field-status.valid {
	color: var(--vefg-success);
}

.vefg-auth-field-status.invalid {
	color: var(--vefg-error);
}

/* Validation info */
.vefg-auth-validation-info {
	margin-bottom: 20px;
}

.vefg-auth-rules-note {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--vefg-muted);
	margin: 0;
	padding: 10px 12px;
	background: #f9fafb;
	border-radius: var(--vefg-radius);
}

.vefg-auth-rules-note .dashicons {
	color: var(--vefg-primary);
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* reCAPTCHA */
.vefg-auth-recaptcha {
	margin-bottom: 20px;
	display: flex;
	justify-content: center;
}

/* Logged in message */
.vefg-auth-message {
	text-align: center;
	padding: 20px;
	background: #f9fafb;
	border-radius: 8px;
	color: #6b7280;
}

/* OTP inputs */
.vefg-auth-otp-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 20px 0;
}

.vefg-otp-digit {
	width: 48px;
	height: 56px;
	text-align: center;
	font-size: 24px;
	font-weight: 600;
	border: 2px solid var(--vefg-border);
	border-radius: var(--vefg-radius);
	background: #fff;
	color: var(--vefg-text);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.vefg-otp-digit:focus {
	outline: none;
	border-color: var(--vefg-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vefg-otp-digit.filled {
	border-color: var(--vefg-primary);
	background: #f0f9ff;
}

.vefg-auth-resend {
	font-size: 14px;
	color: var(--vefg-muted);
	margin: 0;
}

.vefg-auth-resend a {
	color: var(--vefg-primary);
	text-decoration: none;
	font-weight: 500;
}

.vefg-auth-resend a:hover {
	text-decoration: underline;
}

/* Success icon */
.vefg-auth-success-icon {
	margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 480px) {
	.vefg-auth-form {
		padding: 24px 20px;
	}
	
	.vefg-auth-title {
		font-size: 20px;
	}

	.vefg-otp-digit {
		width: 40px;
		height: 48px;
		font-size: 20px;
	}
}
