/**
 * Hayat OTP Widget — base styles
 * Elementor controls override most visual properties.
 */

.hayat-otp-widget {
	direction: rtl;
	text-align: right;
	width: 100%;
}

.hayat-otp-widget *,
.hayat-otp-widget *::before,
.hayat-otp-widget *::after {
	box-sizing: border-box;
}

.hayat-otp-step {
	display: none !important;
	width: 100%;
}

.hayat-otp-step.is-active {
	display: block !important;
}

.hayat-otp-step[hidden] {
	display: none !important;
}

.hayat-otp-header {
	width: 100%;
}

.hayat-otp-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.5;
	color: #111827;
}

.hayat-otp-description {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.7;
	color: #4b5563;
}

.hayat-otp-phone-highlight {
	color: #5fa87a;
	font-weight: 600;
}

.hayat-otp-divider {
	display: block;
	width: 100%;
	height: 1px;
	background-color: #e5e7eb;
	margin: 16px 0;
	border: none;
}

.hayat-otp-field-label {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.5;
	color: #111827;
}

.hayat-otp-field-label.is-hidden,
.hayat-otp-field-label[hidden] {
	display: none !important;
	margin: 0;
}

.hayat-otp-phone-wrap {
	position: relative;
	width: 100%;
}

.hayat-otp-phone-input {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	direction: ltr;
	text-align: left;
	font-family: inherit;
	letter-spacing: 0.02em;
}

.hayat-otp-phone-input::placeholder {
	opacity: 1;
}

.hayat-otp-phone-box {
	display: flex;
	align-items: center;
	width: 100%;
	background-color: #ffffff;
	border: 1px solid #e8e8e8;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hayat-otp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border: none;
	cursor: pointer;
	font-family: inherit;
	text-decoration: none;
	background-color: #a8d5b5;
	color: #ffffff;
	transform: none !important;
	box-shadow: none !important;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease !important;
}

.hayat-otp-btn:hover,
.hayat-otp-btn:focus,
.hayat-otp-btn:active {
	transform: none !important;
	box-shadow: none !important;
}

.hayat-otp-widget .hayat-otp-continue-btn.is-ready:hover,
.hayat-otp-widget .hayat-otp-resend-btn:not(.is-disabled):hover {
	background-color: #95c9a3;
}

.hayat-otp-btn:disabled,
.hayat-otp-btn.is-disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.hayat-otp-continue-btn.is-disabled,
.hayat-otp-verify-btn.is-disabled {
	background-color: #d8e2dc;
	color: #9ca3af;
}

.hayat-otp-continue-btn.is-ready {
	opacity: 1;
	cursor: pointer;
}

.hayat-otp-edit-phone-wrap {
	display: flex;
	width: 100%;
	justify-content: center;
}

.hayat-otp-edit-phone-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border: none;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	text-decoration: underline;
	color: #6b7280;
	padding: 8px 0;
	transform: none !important;
	box-shadow: none !important;
	transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease !important;
}

.hayat-otp-edit-phone-btn:hover,
.hayat-otp-edit-phone-btn:focus,
.hayat-otp-edit-phone-btn:active {
	transform: none !important;
	box-shadow: none !important;
	color: #374151;
}

.hayat-otp-btn.is-loading {
	pointer-events: none;
}

.hayat-otp-digits {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	flex-wrap: nowrap;
	width: 100%;
	direction: ltr;
}

.hayat-otp-digit {
	text-align: center;
	border: 1px solid #ececec;
	outline: none;
	padding: 0;
	font-family: inherit;
	background-color: #ffffff;
	direction: ltr;
	unicode-bidi: plaintext;
	transition: background-color 0.2s ease, border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

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

.hayat-otp-digit[type='number'] {
	-moz-appearance: textfield;
}

.hayat-otp-phone-box.is-error {
	border-color: #c2185b;
	background-color: #fdf2f8;
}

.hayat-otp-phone-box.is-error .hayat-otp-phone-input {
	color: #c2185b;
}

.hayat-otp-phone-box.is-error:focus-within {
	border-color: #c2185b;
	background-color: #fdf2f8;
}

.hayat-otp-inline-error {
	display: none;
	width: 100%;
	font-size: 0.875rem;
	line-height: 1.6;
	color: #c2185b;
	margin-top: 8px;
}

.hayat-otp-inline-error.is-visible {
	display: block;
}

.hayat-otp-digits.is-error .hayat-otp-digit {
	border-color: #c2185b;
	background-color: #fdf2f8;
	color: #c2185b;
}

.hayat-otp-digits.is-error .hayat-otp-digit:focus {
	border-color: #c2185b;
	background-color: #fdf2f8;
	color: #c2185b;
}

.hayat-otp-digit:focus {
	background-color: #edf8f0;
	border-color: #7bc49a;
}

.hayat-otp-message {
	display: none;
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.6;
}

.hayat-otp-message.is-visible {
	display: block;
}

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

.hayat-otp-message.is-success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* پیش‌نمایش استاتیک در ویرایشگر — فقط قبل از شروع فرآیند واقعی */
.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="phone"] .hayat-otp-step[data-step="phone"] {
	display: block !important;
}

.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="phone"] .hayat-otp-step[data-step="otp"] {
	display: none !important;
}

.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="otp"] .hayat-otp-step[data-step="otp"] {
	display: block !important;
}

.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="otp"] .hayat-otp-step[data-step="phone"] {
	display: none !important;
}

.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="profile"] .hayat-otp-step[data-step="profile"] {
	display: block !important;
}

.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="profile"] .hayat-otp-step[data-step="phone"],
.elementor-editor-active .hayat-otp-widget:not(.is-flow-started)[data-editor-step="profile"] .hayat-otp-step[data-step="otp"] {
	display: none !important;
}

/* ── Profile step ── */

.hayat-otp-avatar-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	flex-direction: row;
}

.hayat-otp-avatar-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	flex: 1;
	min-width: 0;
	text-align: right;
}

.hayat-otp-avatar-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: #111827;
}

.hayat-otp-avatar-hint {
	font-size: 0.8rem;
	color: #9ca3af;
}

.hayat-otp-avatar-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	flex-shrink: 0;
}

.hayat-otp-avatar-frame {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border: 2px dashed #7bc49a;
	border-radius: 50%;
	padding: 3px;
	overflow: hidden;
	transition: border-color 0.2s ease;
}

.hayat-otp-avatar-trigger:hover .hayat-otp-avatar-frame,
.hayat-otp-avatar-trigger:focus .hayat-otp-avatar-frame {
	border-color: #5fa87a;
}

.hayat-otp-avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	background-color: #e8f5ec;
}

.hayat-otp-avatar-delete {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 12px;
	background-color: #fce4ec;
	color: #e91e63;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.hayat-otp-avatar-delete[hidden] {
	display: none !important;
}

.hayat-otp-avatar-delete:hover {
	background-color: #f8bbd0;
}

.hayat-otp-name-wrap {
	width: 100%;
	margin-bottom: 16px;
}

.hayat-otp-name-label {
	display: block;
	margin: 0 0 10px;
	font-size: 0.95rem;
	font-weight: 500;
	color: #111827;
}

.hayat-otp-name-box {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 14px 16px;
	background-color: #ffffff;
	border: 1px solid transparent;
	border-radius: 16px;
	transition: border-color 0.2s ease;
}

.hayat-otp-name-box:focus-within {
	border-color: #7bc49a;
	background-color: #ffffff;
}

.hayat-otp-name-box.is-error {
	border-color: #c2185b;
	background-color: #fdf2f8;
}

.hayat-otp-name-input {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	color: #111827;
}

.hayat-otp-name-input::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.hayat-otp-widget .hayat-otp-profile-save-btn,
.hayat-otp-widget .hayat-otp-profile-skip-btn {
	padding: 12px;
}

.hayat-otp-profile-skip-btn {
	background-color: #edf8f0 !important;
	color: #5fa87a !important;
	border: 2px dashed #7bc49a !important;
}

.hayat-otp-profile-skip-btn:hover,
.hayat-otp-profile-skip-btn:focus {
	background-color: #e0f2e8 !important;
	color: #4a9a68 !important;
}

.hayat-otp-avatar-card.has-photo .hayat-otp-avatar-frame {
	border-style: solid;
}

/* ── Crop modal ── */

.hayat-otp-crop-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.hayat-otp-crop-modal[hidden] {
	display: none !important;
}

.hayat-otp-crop-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
}

.hayat-otp-crop-dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 360px);
	padding: 20px;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.hayat-otp-crop-title {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	color: #111827;
}

.hayat-otp-crop-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 16px;
	background: #f3f4f6;
	touch-action: none;
	cursor: grab;
}

.hayat-otp-crop-stage.is-dragging {
	cursor: grabbing;
}

.hayat-otp-crop-viewport {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.hayat-otp-crop-viewport::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 9999px rgba(17, 24, 39, 0.45);
	pointer-events: none;
}

.hayat-otp-crop-image {
	position: absolute;
	top: 50%;
	left: 50%;
	max-width: none;
	user-select: none;
	-webkit-user-drag: none;
	transform-origin: center center;
	will-change: transform;
}

.hayat-otp-crop-zoom {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 0 16px;
}

.hayat-otp-crop-zoom-out,
.hayat-otp-crop-zoom-in {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #ffffff;
	color: #374151;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.hayat-otp-crop-zoom-slider {
	flex: 1;
	accent-color: #7bc49a;
}

.hayat-otp-crop-actions {
	display: flex;
	gap: 10px;
}

.hayat-otp-crop-cancel,
.hayat-otp-crop-confirm {
	flex: 1;
	padding: 12px 16px;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	border: none;
}

.hayat-otp-crop-cancel {
	background: #f3f4f6;
	color: #374151;
}

.hayat-otp-crop-confirm {
	background: #7bc49a;
	color: #ffffff;
}

.hayat-otp-crop-confirm:hover {
	background: #5fa87a;
}

body.hayat-otp-crop-open {
	overflow: hidden;
}
