/**
 * Popup Login/Register System Styles
 * Modern responsive popup design
 */

/* Popup Overlay */
.popup-wrap {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.popup-wrap.active {
	display: flex;
}

.popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}

/* Popup Block */
.popup-block {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
	width: 100%;
	max-width: 458px;
	max-height: 90vh;
	overflow-y: auto;
	transform: scale(0.9);
	opacity: 0;
	transition: all 0.3s ease;
	display: none;
}

.popup-block.active {
	display: block;
	transform: scale(1);
	opacity: 1;
}

/* Popup Header */
.popup-header {
	position: relative;
	padding: 20px 20px 15px;
	border-bottom: 1px solid #e0e0e0;
}

.popup-title {
	font-size: 20px;
	font-weight: 600;
	color: #333;
	margin: 0;
}

.required-mark {
	position: absolute;
	top: 20px;
	right: 50px;
	font-size: 14px;
	color: #666;
	font-weight: 400;
}

.popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 28px;
	height: 28px;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 20px;
	color: #666;
	transition: all 0.2s ease;
	outline: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.popup-close:hover {
	color: #333;
}

/* Popup Content */
.popup-content {
	padding: 20px;
}

/* Auth Switch */
.auth-switch {
	text-align: left;
	margin-bottom: 25px;
	font-size: 14px;
	color: #333;
}

.auth-switch a {
	color: #007cba;
	text-decoration: underline;
	font-weight: 500;
	margin-left: 5px;
}

.auth-switch a:hover {
	text-decoration: none;
}

/* Form Groups */
.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 400;
	color: #333;
	font-size: 14px;
}

.form-control {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: all 0.2s ease;
	box-sizing: border-box;
	background: #fff;
	color: #333;
}

.form-control:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: none;
}

.form-control.error {
	border-color: #dc3545;
}

.form-control::placeholder {
	color: #999;
	font-size: 14px;
}

/* Password Wrapper */
.password-wrapper {
	position: relative;
}

.view-pass {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	cursor: pointer;
	width: 20px;
	height: 20px;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

.view-pass:hover {
	opacity: 0.8;
}

.view-pass.active {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"/></svg>');
}

/* Form Options */
.form-options {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
}

.remember-me {
	display: flex;
	align-items: center;
	gap: 8px;
}

.remember-me input[type="checkbox"] {
	margin: 0;
	width: 16px;
	height: 16px;
}

.remember-me label {
	margin: 0;
	font-size: 14px;
	color: #333;
	cursor: pointer;
	font-weight: 400;
}

.forgot-password a {
	color: #007cba;
	text-decoration: none;
	font-size: 14px;
}

.forgot-password a:hover {
	text-decoration: underline;
}

/* Checkbox Wrapper */
.checkbox-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
	margin: 4px 0 0 0;
	flex-shrink: 0;
}

.checkbox-wrapper label {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}

.checkbox-wrapper a {
	color: #36513C;
	text-decoration: none;
}

.checkbox-wrapper a:hover {
	text-decoration: underline;
}

/* Buttons */
.btn {
	display: inline-block;
	font-weight: 500;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	user-select: none;
	border: 1px solid transparent;
	padding: 12px 24px;
	font-size: 14px;
	line-height: 1.5;
	border-radius: 8px;
	transition: all 0.2s ease;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}

.btn-primary {
	color: #fff;
	background-color: #4a6741;
	border-color: #4a6741;
	font-weight: 500;
	font-size: 14px;
	min-height: 44px;
}

.btn-primary:hover {
	background-color: #3e5537;
	border-color: #3e5537;
}

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

.w-full {
	width: 100%;
}

/* Error Messages */
.error-message {
	color: #dc3545;
	font-size: 12px;
	margin-top: 5px;
	display: none;
}

.error-message.visible {
	display: block;
}

.error-block {
	background: #f8d7da;
	color: #721c24;
	padding: 10px 15px;
	border-radius: 6px;
	font-size: 14px;
	margin-top: 15px;
	display: none;
}

.error-block.visible {
	display: block;
}

.success-block {
	background: #d4edda;
	color: #155724;
	padding: 10px 15px;
	border-radius: 6px;
	font-size: 14px;
	margin-top: 15px;
	display: none;
}

.success-block.visible {
	display: block;
}

/* Loading State */
.btn.loading {
	position: relative;
	color: transparent;
}

.btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-radius: 50%;
	border-top-color: transparent;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	.popup-wrap {
		padding: 10px;
	}

	.popup-block {
		max-width: 100%;
		border-radius: 8px;
	}

	.popup-header {
		padding: 20px 20px 15px;
	}

	.popup-content {
		padding: 20px;
	}

	.popup-title {
		font-size: 20px;
	}

	.form-options {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
}

@media (max-width: 480px) {
	.popup-header {
		padding: 15px 15px 10px;
	}

	.popup-content {
		padding: 15px;
	}

	.form-group {
		margin-bottom: 15px;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.popup-block {
		border: 2px solid #000;
	}

	.form-control {
		border-width: 2px;
	}

	.btn-primary {
		border-width: 2px;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

	.popup-block,
	.popup-close,
	.form-control,
	.btn {
		transition: none;
	}

	.btn.loading::after {
		animation: none;
	}
}