/**
 * Login Popup Styles
 *
 * @package miniorange-otp-verification/includes/css
 */

.mo-login-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.mo-login-popup-container {
	background: #ffffff;
	border-radius: 8px;
	width: 100%;
	max-width: 550px;
	max-height: 100vh;
	overflow-y: auto;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	position: relative;
	border: 1px solid #000;
	z-index: 1000000;
	pointer-events: auto;
}

.mo-login-popup-header {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 24px 24px 16px;
	border-bottom: 1px solid #e5e5e5;
	position: relative;
}

.mo-login-popup-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
	color: #000;
	font-family: serif;
	letter-spacing: 0.5px;
}

.mo-login-popup-close {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: color 0.2s;
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 10;
}

.mo-login-popup-close:hover {
	color: #000;
}

.mo-login-popup-tabs {
	display: flex;
	border-bottom: 1px solid #e5e5e5;
	padding: 0 24px;
	justify-content: center;
}

.mo-login-tab {
	background: none;
	border: none;
	padding: 16px 20px;
	font-size: 14px;
	cursor: pointer;
	color: #999;
	position: relative;
	transition: color 0.2s;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	flex: 1;
	max-width: 50%;
	text-align: center;
}

.mo-login-tab:hover {
	color: #333;
}

.mo-login-tab.active {
	color: #000;
}

.mo-login-tab.active::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #000;
}

.mo-login-tab-content {
	display: none;
	padding: 24px;
}

.mo-login-tab-content.active {
	display: block;
}

.mo-login-popup-form {
	width: 100%;
}

.mo-login-form-group {
	margin-bottom: 20px;
}

.mo-login-label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

.mo-login-input-wrapper {
	position: relative;
}

.mo-login-input {
	line-height: 20px;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

/* intlTelInput styles */
.mo-login-input-wrapper .iti {
	width: 100%;
	display: block;
}

.mo-login-input-wrapper .iti__selected-flag {
	z-index: 1;
}

.mo-login-input-wrapper .iti__selected-flag:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.mo-login-input-wrapper .iti__country-list {
	z-index: 9999;
	max-height: 200px;
	overflow-y: auto;
}

/* When dropdown is open, allow it to extend beyond container */
.mo-login-popup-container.iti-dropdown-open {
	overflow: visible;
}

.mo-login-popup-container.iti-dropdown-open .mo-login-input-wrapper {
	overflow: visible;
}

/* Ensure consistent font for country code and phone number */
.mo-login-input-wrapper .iti input,
.mo-login-input-wrapper .iti__selected-dial-code {
	font-size: 14px;
	font-family: inherit;
	line-height: 1.5;
}

/* Hide the separate dial code display since we're using separateDialCode: false */
.mo-login-input-wrapper .iti__selected-dial-code {
	display: none !important;
}

/* Ensure input field has consistent styling */
.mo-login-input-wrapper .iti input {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	width: 100%;
	box-sizing: border-box;
}

.mo-login-input:focus {
	outline: none;
	border-color: #0073aa;
}

.mo-login-send-otp-wrapper {
	margin-top: 16px;
}

.mo-login-button {
	text-align: center;
	width: 100%;
	padding: 12px 24px;
	background-color: #1e3a8a;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mo-login-button:hover:not(:disabled) {
	background-color: #1e40af;
}

.mo-login-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mo-login-send-otp-btn {
	background-color: #fbbf24;
	color: #000;
}

.mo-login-send-otp-btn:hover:not(:disabled) {
	background-color: #f59e0b;
}

.mo-login-button-wrapper {
	margin-top: 24px;
}

.mo-login-main-btn {
	width: 100%;
	padding: 12px 24px;
	background-color: #1e3a8a;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mo-login-main-btn:hover:not(:disabled) {
	background-color: #1e40af;
}

.mo-login-main-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mo-login-otp-section {
	margin-top: 24px;
}

.mo-login-otp-inputs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 16px;
}

.mo-login-otp-input {
	width: 45px;
	height: 45px;
	text-align: center;
	font-size: 20px;
	font-weight: 600;
	border: 1px solid #ddd;
	border-radius: 4px;
	transition: border-color 0.2s;
}

.mo-login-otp-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.mo-login-resend-wrapper {
	text-align: center;
	margin-bottom: 20px;
}

.mo-login-resend-link {
	color: #1e3a8a;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s;
}

.mo-login-resend-link:hover:not(:disabled) {
	color: #1e40af;
	text-decoration: underline;
}

.mo-login-resend-link:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

/* Loader for resend button */
.mo-resend-loader {
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid #ffffff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: mo-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

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

.mo-login-message {
	padding: 10px 12px;
	border-radius: 4px;
	margin-top: 8px;
	font-size: 13px;
	text-align: left;
	display: block;
}

.mo-login-message.success {
	background-color: #d1fae5;
	color: #065f46;
	border: 1px solid #6ee7b7;
}

.mo-login-message.error {
	background-color: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.mo-login-new-user-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 14px;
	text-align: left;
	display: block;
	background-color: #fef3c7;
	color: #92400e;
	border: 1px solid #fcd34d;
	line-height: 1.5;
}

.mo-login-social-options,
.mo-login-singpass-options {
	padding: 40px 20px;
	text-align: center;
}

.mo-login-placeholder-text {
	color: #666;
	font-size: 14px;
	margin-bottom: 24px;
}

.mo-login-social-icons {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 300px;
	margin: 0 auto;
}

.mo-login-social-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 12px 24px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	cursor: not-allowed;
	opacity: 0.6;
	transition: all 0.2s;
}

.mo-login-social-btn:disabled {
	cursor: not-allowed;
}

.mo-login-social-btn span {
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

/* Responsive */
@media (max-width: 600px) {
	.mo-login-popup-container {
		max-width: 100%;
		margin: 0;
		border-radius: 0;
		max-height: 100vh;
	}

	.mo-login-popup-header {
		padding: 16px;
	}

	.mo-login-popup-tabs {
		padding: 0 16px;
	}

	.mo-login-tab {
		padding: 12px 12px;
		font-size: 12px;
		flex: 1;
		max-width: 50%;
	}

	.mo-login-tab-content {
		padding: 16px;
	}

	.mo-login-otp-input {
		width: 40px;
		height: 40px;
		font-size: 18px;
	}
}

/* Additional field for registration */
#mo-login-additional-field-wrapper {
	margin-top: 20px;
}

#mo-login-additional-message {
	margin-top: 8px;
	font-size: 13px;
}

/* Hide WooCommerce default login/registration forms on my-account page */
.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register,
.woocommerce-account .woocommerce .woocommerce-form-login,
.woocommerce-account .woocommerce .woocommerce-form-register,
.woocommerce-account .woocommerce .u-columns,
.woocommerce-account .woocommerce .u-column1,
.woocommerce-account .woocommerce .u-column2 {
	display: none !important;
}

/* Hide WooCommerce account navigation when not logged in */
body:not(.logged-in) .woocommerce-account .woocommerce-MyAccount-navigation {
	display: none !important;
}

/* Hide WooCommerce account content wrapper when not logged in */
body:not(.logged-in) .woocommerce-account .woocommerce-MyAccount-content {
	display: none !important;
}

/* Hide WooCommerce checkout login form */
.woocommerce-checkout .woocommerce-form-login,
.woocommerce-checkout .woocommerce-form-login-toggle,
.woocommerce-checkout .showlogin {
	display: none !important;
}

