.moa-auth-wrap {
	--moa-page-bg: #f5f6fa;
	--moa-box-bg: #ffffff;
	--moa-box-border: #e5e7eb;
	--moa-btn-bg: #2563eb;
	--moa-btn-text: #ffffff;
	--moa-link-color: #2563eb;

	direction: rtl;
	text-align: right;
	font-family: inherit;
	width: 100%;
	max-width: 380px;
	margin: 0 auto;
	box-sizing: border-box;
}

.moa-auth-wrap * {
	box-sizing: border-box;
}

.moa-logo {
	text-align: center;
	margin-bottom: 22px;
}

.moa-logo img {
	max-width: 150px;
	max-height: 72px;
	height: auto;
}

.moa-box {
	position: relative;
	background: var(--moa-box-bg);
	border: 1px solid var(--moa-box-border);
	border-radius: 20px;
	padding: 32px 26px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -8px rgba(16, 24, 40, 0.12);
}

.moa-title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-align: center;
}

.moa-subtitle {
	margin: 0 0 22px;
	font-size: 13px;
	color: #6b7280;
	text-align: center;
}

.moa-field {
	display: block;
	margin-bottom: 16px;
}

.moa-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	color: #374151;
}

.moa-input {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--moa-box-border);
	border-radius: 10px;
	font-size: 15px;
	background: #fff;
	direction: ltr;
	text-align: right;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.moa-input:focus {
	outline: none;
	border-color: var(--moa-btn-bg);
	box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
}

.moa-btn {
	display: block;
	width: 100%;
	padding: 12px 16px;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.1s ease;
}

.moa-btn:hover {
	opacity: 0.92;
}

.moa-btn:active {
	transform: scale(0.98);
}

.moa-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.moa-btn-primary {
	background: var(--moa-btn-bg);
	color: var(--moa-btn-text);
	box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--moa-btn-bg) 60%, transparent);
}

.moa-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: var(--moa-link-color);
	font-size: 13px;
	cursor: pointer;
	text-decoration: underline;
	margin-bottom: 14px;
	display: inline-block;
}

.moa-back-btn {
	background: none;
	border: none;
	padding: 0;
	color: #6b7280;
	font-size: 13px;
	cursor: pointer;
	margin-bottom: 14px;
}

.moa-cancel-link {
	display: block;
	text-align: center;
	margin-top: 14px;
	font-size: 13px;
	color: #9ca3af;
	text-decoration: none;
}

.moa-cancel-link:hover {
	color: #6b7280;
	text-decoration: underline;
}

.moa-otp-label {
	text-align: center;
}

.moa-otp-boxes {
	display: flex;
	justify-content: center;
	gap: 9px;
	margin-bottom: 10px;
}

.moa-otp-box {
	width: 44px;
	height: 52px;
	text-align: center;
	font-size: 20px;
	font-weight: 700;
	border: 1.5px solid var(--moa-box-border);
	border-radius: 12px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.moa-otp-box:focus {
	outline: none;
	border-color: var(--moa-btn-bg);
	box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
	transform: translateY(-1px);
}

.moa-otp-box::-webkit-outer-spin-button,
.moa-otp-box::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.moa-resend-row {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 4px 0 16px;
	font-size: 12px;
	color: #6b7280;
}

.moa-message {
	font-size: 13px;
	border-radius: 10px;
	margin-bottom: 0;
	transition: all 0.15s ease;
}

.moa-message:not(:empty) {
	padding: 10px 12px;
	margin-bottom: 16px;
}

.moa-message.moa-message-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.moa-message.moa-message-success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.moa-loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 20px;
	backdrop-filter: blur(1px);
}

.moa-spinner {
	width: 26px;
	height: 26px;
	border: 3px solid var(--moa-box-border);
	border-top-color: var(--moa-btn-bg);
	border-radius: 50%;
	animation: moa-spin 0.7s linear infinite;
}

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

.moa-required {
	color: #dc2626;
}

.moa-already-logged-in {
	direction: rtl;
	text-align: center;
	padding: 16px;
}

/* Modal (used on WooCommerce checkout) */
.moa-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.moa-modal-overlay .moa-auth-wrap {
	max-width: 400px;
}

.moa-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 400px;
}

.moa-modal-close {
	position: absolute;
	top: 10px;
	left: 10px;
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}

body.moa-standalone-page-body {
	background: var(--moa-page-bg);
}

.moa-standalone-container {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 16px;
	background: var(--moa-page-bg);
}

@media (max-width: 360px) {
	.moa-otp-boxes {
		gap: 6px;
	}

	.moa-otp-box {
		width: 38px;
		height: 46px;
		font-size: 18px;
	}
}
