/* LD OTP Verification — UI v2.0
   Mode A: .ld-otp2-* — modal overlay (2.0 submit-then-verify flow)
   Mode B: .ld-otp-*  — inline field (1.x legacy custom field type) */

/* -------------------------------------------------------------------------
   Wrapper
   ------------------------------------------------------------------------- */
.ld-otp-wrap {
	width: 100%;
}

/* -------------------------------------------------------------------------
   Phone input row — looks like one seamless input field
   ------------------------------------------------------------------------- */
.ld-otp-phone-row {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--e-global-color-text, #d4d4d4);
	border-radius: 3px;
	background: #fff;
	overflow: hidden;
	transition: border-color 0.2s;
}

.ld-otp-phone-row:focus-within {
	border-color: #aaa;
}

.ld-otp-prefix {
	display: flex;
	align-items: center;
	padding: 0 12px;
	font-size: 14px;
	color: #777;
	background: #fafafa;
	border-right: 1px solid #e5e5e5;
	white-space: nowrap;
	flex-shrink: 0;
	user-select: none;
}

.ld-otp-phone-input {
	flex: 1 1 0;
	min-width: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 10px 12px !important;
	font-size: 14px;
	background: transparent;
	color: #333;
}

.ld-otp-phone-input[readonly] {
	color: #555;
	cursor: default;
}

/* "Send OTP" — simple text link inside the row */
.ld-otp-send-btn {
	display: flex;
	align-items: center;
	padding: 0 14px;
	border: none;
	border-left: 1px solid #e5e5e5;
	background: none;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s, background 0.15s;
	flex-shrink: 0;
}

.ld-otp-send-btn:hover:not(:disabled) {
	color: #222;
	background: #f5f5f5;
}

.ld-otp-send-btn:disabled {
	color: #aaa;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   OTP verify section (shown after Send)
   ------------------------------------------------------------------------- */
.ld-otp-verify-section {
	margin-top: 8px;
}

.ld-otp-code-row {
	display: flex;
	align-items: stretch;
	border: 1px solid #d4d4d4;
	border-radius: 3px;
	background: #fff;
	overflow: hidden;
}

.ld-otp-code-input {
	flex: 1 1 0;
	min-width: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 10px 12px !important;
	font-size: 15px;
	letter-spacing: 6px;
	background: transparent;
	color: #333;
}

/* "Verify OTP" — mirrors the Send button style */
.ld-otp-verify-btn {
	display: flex;
	align-items: center;
	padding: 0 14px;
	border: none;
	border-left: 1px solid #e5e5e5;
	background: none;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s, background 0.15s;
	flex-shrink: 0;
}

.ld-otp-verify-btn:hover:not(:disabled) {
	color: #222;
	background: #f5f5f5;
}

.ld-otp-verify-btn:disabled {
	color: #aaa;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Timer + Resend row
   ------------------------------------------------------------------------- */
.ld-otp-timer-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 5px;
	padding-left: 2px;
}

.ld-otp-timer {
	font-size: 11px;
	color: #999;
}

.ld-otp-resend-btn {
	background: none;
	border: none;
	padding: 0;
	font-size: 12px;
	color: #666;
	cursor: pointer;
	text-decoration: underline;
}

.ld-otp-resend-btn:hover {
	color: #333;
}

/* -------------------------------------------------------------------------
   Status messages — small, below the field
   ------------------------------------------------------------------------- */
.ld-otp-message {
	margin-top: 4px;
	padding: 0 2px;
	font-size: 12px;
	line-height: 1.4;
	display: none;
}

.ld-otp-msg-error   { color: #c0392b; display: block; }
.ld-otp-msg-success { color: #27ae60; display: block; }
.ld-otp-msg-verified {
	color: #27ae60;
	font-weight: 600;
	font-size: 13px;
	display: block;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.ld-otp-send-btn,
	.ld-otp-verify-btn {
		padding: 0 10px;
		font-size: 12px;
	}
}

/* =============================================================================
   MODE A — v2 field type (.ld-otp2-input-wrap + .ld-otp2-phone-field)
   The <input> carries elementor-field + elementor-field-textual so it gets
   100% of Elementor's border/radius/background/color/font from the form's
   Style tab — no overrides needed. Works on every site, every theme.
   We only add the +91 prefix as an absolute overlay.
   ============================================================================= */

/* Wrapper is just a positioning context — no visual styles */
.ld-otp2-input-wrap {
	position: relative;
	display: block;
	width: 100%;
}

/* +91 floats over the left side of the input */
.ld-otp2-prefix {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	padding: 0 10px 0 14px;
	font-size: inherit;
	color: inherit;
	opacity: 0.65;
	pointer-events: none;
	white-space: nowrap;
	z-index: 1;
}

/* Indent the input so the text doesn't sit behind +91 (~52 px covers "+91 |") */
.ld-otp2-phone-field {
	padding-left: 52px !important;
	width: 100%;
	box-sizing: border-box;
}

/* =============================================================================
   MODE A — 2.0 OTP Modal
   ============================================================================= */

/* Overlay — full screen dim */
.ld-otp2-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	padding: 16px;
	box-sizing: border-box;
}

.ld-otp2-overlay.ld-otp2-active {
	opacity: 1;
	visibility: visible;
}

/* Card */
.ld-otp2-card {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 40px 36px 32px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
	text-align: center;
	transform: translateY(16px) scale(0.97);
	transition: transform 0.25s ease;
}

.ld-otp2-overlay.ld-otp2-active .ld-otp2-card {
	transform: translateY(0) scale(1);
}

/* Close button */
.ld-otp2-close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: #aaa;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}

.ld-otp2-close:hover {
	color: #444;
	background: #f2f2f2;
}

/* Phone icon */
.ld-otp2-icon {
	margin: 0 auto 14px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #f0f4ff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4a6cf7;
}

/* Heading */
.ld-otp2-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1.3;
}

/* Subtitle */
.ld-otp2-sub {
	margin: 0 0 24px;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
}

.ld-otp2-phone {
	color: #1a1a2e;
	font-size: 15px;
}

/* 6 digit boxes */
.ld-otp2-digits {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 16px;
}

.ld-otp2-digit {
	width: 48px;
	height: 56px;
	border: 2px solid #dde1ea;
	border-radius: 10px;
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	color: #1a1a2e;
	background: #fafbff;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	-moz-appearance: textfield;
	appearance: textfield;
}

.ld-otp2-digit::-webkit-outer-spin-button,
.ld-otp2-digit::-webkit-inner-spin-button { -webkit-appearance: none; }

.ld-otp2-digit:focus {
	border-color: #4a6cf7;
	box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
	background: #fff;
}

/* Status message */
.ld-otp2-message {
	font-size: 13px;
	line-height: 1.4;
	min-height: 18px;
	margin: 0 0 12px;
	display: none;
}

.ld-otp2-msg-error   { color: #c0392b; display: block; }
.ld-otp2-msg-success { color: #27ae60; display: block; }

/* Countdown timer */
.ld-otp2-timer {
	font-size: 12px;
	color: #999;
	margin-bottom: 20px;
	min-height: 16px;
}

/* Verify & Submit button */
.ld-otp2-verify-btn {
	display: block;
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 10px;
	background: #1a1a2e;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.5px;
	transition: background 0.2s, transform 0.1s;
	margin-bottom: 18px;
}

.ld-otp2-verify-btn:hover:not(:disabled) {
	background: #2d2d50;
}

.ld-otp2-verify-btn:active:not(:disabled) {
	transform: scale(0.98);
}

.ld-otp2-verify-btn:disabled {
	background: #b0b3c1;
	cursor: not-allowed;
}

/* Resend row */
.ld-otp2-resend-row {
	font-size: 13px;
	color: #888;
}

.ld-otp2-resend-btn {
	background: none;
	border: none;
	padding: 0;
	font-size: 13px;
	color: #4a6cf7;
	cursor: pointer;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ld-otp2-resend-btn:hover { color: #2d4fc0; }
.ld-otp2-resend-btn:disabled { color: #aaa; cursor: not-allowed; }

/* Prevent body scroll when modal is open */
.ld-otp2-noscroll { overflow: hidden; }

/* Responsive — smaller phones */
@media (max-width: 480px) {
	.ld-otp2-card {
		padding: 32px 20px 24px;
	}

	.ld-otp2-digit {
		width: 40px;
		height: 50px;
		font-size: 18px;
		border-radius: 8px;
	}

	.ld-otp2-digits {
		gap: 7px;
	}

	.ld-otp2-title {
		font-size: 18px;
	}
}
