/* ============================================================
 * Comment OTP – front-end styles.
 * استایل فرانت‌اند؛ رنگ‌ها از متغیرهای قالب جنه (Jannah) ارث می‌برند.
 * برای هماهنگی با قالب از var(--brand-color …) با مقدار fallback استفاده شده.
 * ============================================================ */

.comment-otp-inline-note {
	display: block;
	margin-top: 6px;
	color: #b32d2e;
	font-size: 0.85em;
}

/* --- Phone + submit button layout --- */
/* Desktop: behaves like normal stacked blocks (unchanged look). */
.comment-otp-mrow { display: block; }

/* Mobile: submit button sits on the same row as the phone field. */
/* موبایل: دکمه ثبت دیدگاه کنار فیلد شماره موبایل. */
@media ( max-width: 782px ) {
	.comment-otp-mrow {
		display: flex;
		gap: 10px;
		align-items: flex-end; /* line up the bottoms of the input and the button */
	}

	/* Phone field: label on top, input pinned to the very bottom (no gap under
	   it) so the button aligns with the input itself, not with empty space.
	   !important defeats theme rules (e.g. #commentform input { margin-bottom }). */
	.comment-otp-mrow .comment-form-otp-phone {
		flex: 1 1 auto;
		min-width: 0;
		margin: 0 !important;
		padding: 0 !important;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
	}
	.comment-otp-mrow .comment-form-otp-phone label {
		margin: 0 0 4px !important;
	}
	.comment-otp-mrow .comment-form-otp-phone input {
		width: 100%;
		margin: 0 !important;
		box-sizing: border-box;
	}

	/* Submit button: no extra spacing, keeps the theme's natural button height. */
	.comment-otp-mrow .form-submit {
		flex: 0 0 auto;
		margin: 0 !important;
		padding: 0 !important;
	}
	.comment-otp-mrow .form-submit .submit {
		margin: 0 !important;
		white-space: nowrap;
	}
}

/* Prevent background scroll while the modal is open. */
body.comment-otp-modal-open {
	overflow: hidden;
}

/* --- Overlay --- */
.comment-otp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba( 17, 17, 17, 0.55 );
	-webkit-backdrop-filter: blur( 2px );
	backdrop-filter: blur( 2px );
}

.comment-otp-overlay.is-open {
	display: flex;
}

/* --- Box --- */
.comment-otp-box {
	position: relative;
	width: 100%;
	max-width: 380px;
	background: var( --bg-color, #ffffff );
	color: var( --base-color, #2c2f34 );
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.30 );
	padding: 24px 22px 22px;
	font-family: inherit;
	text-align: center;
	animation: comment-otp-pop 0.18s ease-out;
}

@keyframes comment-otp-pop {
	from { transform: translateY( 12px ); opacity: 0; }
	to   { transform: translateY( 0 );    opacity: 1; }
}

.comment-otp-close {
	position: absolute;
	top: 8px;
	left: 10px; /* RTL: close sits on the left */
	width: 32px;
	height: 32px;
	line-height: 1;
	font-size: 26px;
	color: #999;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 0;
}
.comment-otp-close:hover { color: #333; }

.comment-otp-title {
	margin: 0 0 12px;
	font-size: 1.15em;
	font-weight: 700;
}

.comment-otp-status {
	min-height: 20px;
	margin-bottom: 14px;
	font-size: 0.9em;
	line-height: 1.6;
}
.comment-otp-status.is-error   { color: #b32d2e; }
.comment-otp-status.is-success { color: #1a7f37; }
.comment-otp-status.is-pending { color: #6c757d; }

.comment-otp-code-label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.9em;
	color: inherit;
}

.comment-otp-code-input {
	width: 100%;
	max-width: 220px;
	margin: 0 auto 18px;
	padding: 12px 10px;
	font-size: 1.5em;
	letter-spacing: 0.4em;
	text-align: center;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	background: #fafafa;
	color: #222;
	display: block;
}
.comment-otp-code-input:focus {
	outline: none;
	border-color: var( --brand-color, #ddbe0d );
	box-shadow: 0 0 0 3px rgba( 221, 190, 13, 0.20 );
}

.comment-otp-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

.comment-otp-confirm {
	width: 100%;
	padding: 12px 16px;
	font-size: 1em;
	font-weight: 700;
	color: #fff;
	background: var( --brand-color, #ddbe0d );
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.15s ease;
}
.comment-otp-confirm:hover:not(:disabled) { filter: brightness( 0.94 ); }
.comment-otp-confirm:disabled { opacity: 0.6; cursor: default; }

.comment-otp-resend {
	background: transparent;
	border: 0;
	color: var( --brand-color, #b8860b );
	font-size: 0.88em;
	cursor: pointer;
	padding: 4px;
	text-decoration: underline;
}
.comment-otp-resend:disabled {
	color: #999;
	cursor: default;
	text-decoration: none;
}

/* --- Dark skin (Jannah data-skin="dark") --- */
[data-skin="dark"] .comment-otp-box {
	background: #1f2227;
	color: #e6e6e6;
}
[data-skin="dark"] .comment-otp-code-input {
	background: #2a2e35;
	border-color: #3a3f47;
	color: #f2f2f2;
}
[data-skin="dark"] .comment-otp-close { color: #aaa; }
[data-skin="dark"] .comment-otp-close:hover { color: #fff; }
