/**
 * Passwordless Email OTP Login — Styles
 * Modern, premium, WooCommerce-compatible, fully responsive.
 */

:root {
	--otp-primary: var( --e-global-color-blocksy_palette_2 );
	--otp-primary-dark: color-mix( in srgb, var( --e-global-color-blocksy_palette_2 ) 80%, black );
	--otp-primary-light: color-mix( in srgb, var( --e-global-color-blocksy_palette_2 ) 12%, white );
	--otp-error: #d63638;
	--otp-error-light: #fbeaea;
	--otp-success: var( --e-global-color-blocksy_palette_2 );
	--otp-success-light: color-mix( in srgb, var( --e-global-color-blocksy_palette_2 ) 12%, white );
	--otp-border: #dcdcdc;
	--otp-text: #1e1e1e;
	--otp-text-muted: #6b6b6b;
	--otp-radius: 12px;
	--otp-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
	--otp-transition: all 0.2s ease;
}

.otp-login-wrapper {
	display: flex;
	justify-content: center;
	padding: 32px 16px;
	width: 100%;
	box-sizing: border-box;
}

.otp-login-wrapper *,
.otp-login-wrapper *::before,
.otp-login-wrapper *::after {
	box-sizing: border-box;
}

.otp-login-card {
	width: 100%;
	max-width: 420px;
	background: #ffffff;
	border: 1px solid var(--otp-border);
	border-radius: var(--otp-radius);
	box-shadow: var(--otp-shadow);
	padding: 36px 32px;
	animation: otp-fade-in 0.35s ease;
}

@keyframes otp-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.otp-login-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--otp-text);
	margin: 0 0 6px;
	text-align: center;
}

.otp-login-subtitle {
	font-size: 14px;
	color: var(--otp-text-muted);
	margin: 0 0 24px;
	text-align: center;
	line-height: 1.5;
}

.otp-login-alert {
	display: none;
	font-size: 14px;
	line-height: 1.5;
	padding: 12px 14px;
	border-radius: 8px;
	margin-bottom: 18px;
	animation: otp-fade-in 0.2s ease;
}

.otp-login-alert.is-visible {
	display: block;
}

.otp-login-alert.is-error {
	background: var(--otp-error-light);
	color: var(--otp-error);
	border: 1px solid rgba(214, 54, 56, 0.25);
}

.otp-login-alert.is-success {
	background: var(--otp-success-light);
	color: var(--otp-success);
	border: 1px solid color-mix( in srgb, var( --otp-success ) 25%, transparent );
}

.otp-login-form {
	display: block;
}

.otp-step-hidden {
	display: none !important;
}

.otp-login-field {
	margin-bottom: 20px;
}

.otp-login-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--otp-text);
	margin-bottom: 8px;
}

.otp-login-input {
	width: 100%;
	padding: 13px 14px;
	font-size: 15px;
	border: 1.5px solid var(--otp-border);
	border-radius: 8px;
	background: #fafafa;
	color: var(--otp-text);
	transition: var(--otp-transition);
	outline: none;
}

.otp-login-input:focus {
	border-color: var(--otp-primary);
	background: #ffffff;
	box-shadow: 0 0 0 3px var(--otp-primary-light);
}

.otp-login-input.is-invalid {
	border-color: var(--otp-error);
}

.otp-login-btn {
	position: relative;
	width: 100%;
	padding: 13px 20px;
	font-size: 15px;
	font-weight: 600;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: var(--otp-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.otp-login-btn-primary {
	background: linear-gradient(135deg, var(--otp-primary), var(--otp-primary-dark));
	color: #ffffff;
	box-shadow: 0 4px 14px color-mix( in srgb, var( --otp-primary ) 28%, transparent );
}

.otp-login-btn-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px color-mix( in srgb, var( --otp-primary ) 35%, transparent );
}

.otp-login-btn-primary:active:not(:disabled) {
	transform: translateY(0);
}

.otp-login-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.otp-login-btn .otp-login-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: otp-spin 0.6s linear infinite;
}

.otp-login-btn.is-loading .otp-login-btn-text {
	opacity: 0.7;
}

.otp-login-btn.is-loading .otp-login-spinner {
	display: inline-block;
}

@keyframes otp-spin {
	to {
		transform: rotate(360deg);
	}
}

.otp-login-sent-to {
	font-size: 14px;
	color: var(--otp-text-muted);
	text-align: center;
	margin: 0 0 22px;
	line-height: 1.5;
}

.otp-login-sent-to strong {
	color: var(--otp-text);
}

.otp-login-boxes {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 24px;
}

.otp-login-box {
	width: 100%;
	aspect-ratio: 1 / 1;
	max-width: 52px;
	text-align: center;
	font-size: 22px;
	font-weight: 700;
	border: 1.5px solid var(--otp-border);
	border-radius: 8px;
	background: #fafafa;
	color: var(--otp-text);
	outline: none;
	transition: var(--otp-transition);
	-moz-appearance: textfield;
}

.otp-login-box::-webkit-outer-spin-button,
.otp-login-box::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.otp-login-box:focus {
	border-color: var(--otp-primary);
	background: #ffffff;
	box-shadow: 0 0 0 3px var(--otp-primary-light);
}

.otp-login-box.is-filled {
	border-color: var(--otp-primary);
	background: #ffffff;
}

.otp-login-box.is-invalid {
	border-color: var(--otp-error);
	animation: otp-shake 0.3s ease;
}

@keyframes otp-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

.otp-login-meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 18px;
	flex-wrap: wrap;
	gap: 10px;
}

.otp-login-link {
	background: none;
	border: none;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--otp-primary);
	cursor: pointer;
	text-decoration: none;
	transition: var(--otp-transition);
}

.otp-login-link:hover:not(:disabled) {
	text-decoration: underline;
}

.otp-login-link:disabled {
	color: var(--otp-text-muted);
	cursor: not-allowed;
}

/* Tablet */
@media (max-width: 600px) {
	.otp-login-card {
		padding: 28px 22px;
	}

	.otp-login-title {
		font-size: 20px;
	}
}

/* Mobile */
@media (max-width: 380px) {
	.otp-login-card {
		padding: 22px 16px;
	}

	.otp-login-box {
		font-size: 18px;
	}

	.otp-login-boxes {
		gap: 6px;
	}

	.otp-login-meta-row {
		flex-direction: column;
		align-items: flex-start;
	}
}