/**
 * سبک فرانت‌اند «ما را از کجا یافتید؟»
 * همهٔ اندازه‌ها با ویژگی‌های منطقی (logical) نوشته شده‌اند تا RTL خودکار بچرخد.
 */

.wf-card {
	--wf-accent: #1f6feb;
	--wf-border: #e2e6eb;
	--wf-muted: #5b6472;
	--wf-ink: #1c2128;
	--wf-radius: 16px;
	--wf-gap: 10px;

	box-sizing: border-box;
	max-width: 720px;
	margin-block: 0;
	padding: clamp(18px, 3vw, 28px);
	border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius);
	background: #fff;
	color: var(--wf-ink);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .06);
	font-size: 16px;
	line-height: 1.6;
}

.wf-card *,
.wf-card *::before,
.wf-card *::after {
	box-sizing: border-box;
}

.wf-card--soft {
	background: #f7f8fa;
	box-shadow: none;
}

.wf-card--transparent {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	padding-inline: 0;
}

.wf-card__head {
	margin-block-end: 18px;
}

.wf-title {
	margin: 0 0 6px;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: -.01em;
	color: inherit;
}

.wf-question {
	margin: 0;
	font-size: 1rem;
	font-weight: 500;
}

.wf-note,
.wf-help-inline {
	margin: 8px 0 0;
	font-size: .875rem;
	color: var(--wf-muted);
}

.wf-text-center,
.wf-text-center .wf-options {
	text-align: center;
}

.wf-text-center .wf-card__head {
	text-align: center;
}

/* ---------------------------------------------------------------- گزینه‌ها */

.wf-options {
	display: grid;
	gap: var(--wf-gap);
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

.wf-options.wf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wf-options.wf-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wf-options.wf-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 560px) {
	.wf-options.wf-cols-2,
	.wf-options.wf-cols-3,
	.wf-options.wf-cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}
}

.wf-option {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
	cursor: pointer;
}

.wf-option__face {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--wf-border);
	border-radius: 12px;
	background: #fff;
	color: var(--wf-ink);
	font-size: .95rem;
	font-weight: 500;
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.wf-layout-list .wf-option__face {
	width: 100%;
}

.wf-option:hover .wf-option__face {
	border-color: color-mix(in srgb, var(--wf-accent) 55%, #e2e6eb);
}

.wf-option__face:hover,
.wf-option:focus-within .wf-option__face {
	border-color: var(--wf-accent);
}

.wf-option:focus-within .wf-option__face {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-accent) 22%, transparent);
}

.wf-radio {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.wf-option__dot {
	flex: 0 0 auto;
	inline-size: 16px;
	block-size: 16px;
	border: 1.5px solid #b6bec8;
	border-radius: 50%;
	display: grid;
	place-items: center;
	transition: border-color .15s ease;
}

.wf-option__dot::after {
	content: "";
	inline-size: 8px;
	block-size: 8px;
	border-radius: 50%;
	background: transparent;
	transition: background .15s ease;
}

.wf-radio:checked + .wf-option__face {
	border-color: var(--wf-accent);
	background: color-mix(in srgb, var(--wf-accent) 6%, #fff);
	box-shadow: inset 0 0 0 1px var(--wf-accent);
}

.wf-radio:checked + .wf-option__face .wf-option__dot {
	border-color: var(--wf-accent);
}

.wf-radio:checked + .wf-option__face .wf-option__dot::after {
	background: var(--wf-accent);
}

.wf-option__icon {
	margin-inline-end: 4px;
}

/* ------------------------------------------------------------- کرکره‌ای */

.wf-select-wrap {
	display: block;
	margin: 0;
}

.wf-select-label {
	display: block;
	margin-block-end: 6px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--wf-muted);
}

.wf-select {
	inline-size: 100%;
	padding: 12px 14px;
	border: 1px solid var(--wf-border);
	border-radius: 12px;
	background: #fff;
	color: var(--wf-ink);
	font-size: .95rem;
}

.wf-select:focus {
	outline: none;
	border-color: var(--wf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-accent) 22%, transparent);
}

/* ------------------------------------------------------------------ فیلدها */

.wf-fields {
	display: grid;
	gap: var(--wf-gap);
	margin-block-start: 14px;
}

.wf-field {
	display: block;
	margin: 0;
}

.wf-field__label {
	display: block;
	margin-block-end: 6px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--wf-muted);
}

.wf-req {
	color: #b42318;
}

.wf-input {
	inline-size: 100%;
	padding: 11px 14px;
	border: 1px solid var(--wf-border);
	border-radius: 12px;
	background: #fff;
	color: var(--wf-ink);
	font-size: .95rem;
}

.wf-input:focus {
	outline: none;
	border-color: var(--wf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-accent) 22%, transparent);
}

.wf-other {
	margin-block-start: 12px;
}

.wf-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-block-start: 14px;
	font-size: .85rem;
	color: var(--wf-muted);
	cursor: pointer;
}

.wf-consent input {
	margin-block-start: 3px;
}

/* ------------------------------------------------------------------ دکمه‌ها */

.wf-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-block-start: 16px;
}

.wf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 20px;
	border: 1px solid transparent;
	border-radius: 11px;
	background: #eef1f4;
	color: var(--wf-ink, #1c2128);
	font-size: .93rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.wf-btn--primary {
	background: var(--wf-accent, #1f6feb);
	color: #fff;
}

.wf-btn--primary:hover {
	filter: brightness(.95);
}

.wf-btn--outline {
	background: transparent;
	border-color: #cfd6de;
}

.wf-btn--outline:hover {
	border-color: var(--wf-accent, #1f6feb);
	color: var(--wf-accent, #1f6feb);
}

.wf-btn--ghost {
	background: transparent;
	border-color: transparent;
	color: #5b6472;
}

.wf-btn--ghost:hover {
	color: #1c2128;
}

.wf-btn--sm {
	padding: 8px 14px;
	font-size: .85rem;
}

.wf-btn:disabled {
	opacity: .6;
	cursor: progress;
}

.wf-btn:focus-visible {
	outline: 2px solid var(--wf-accent, #1f6feb);
	outline-offset: 2px;
}

.wf-align-center { text-align: center; }
.wf-align-end { text-align: end; }

.wf-error {
	margin: 0;
	flex-basis: 100%;
	color: #b42318;
	font-size: .85rem;
}

.wf-result {
	margin-block-start: 14px;
	padding: 14px 16px;
	border: 1px solid #c7e6d2;
	border-radius: 12px;
	background: #f2fbf5;
}

.wf-result__title {
	margin: 0 0 4px;
	font-weight: 700;
	color: #12703a;
}

.wf-result__text {
	margin: 0;
	font-size: .9rem;
	color: #2c3b33;
}

/* تلهٔ عسل */
.wf-hp {
	position: absolute;
	inline-start: -9999px;
	block-size: 0;
	overflow: hidden;
	pointer-events: none;
}

/* ------------------------------------------------------------------ پاپ‌آپ */

.wf-popup {
	position: fixed;
	inset: 0;
	z-index: 999980;
	display: grid;
	pointer-events: none;
}

.wf-popup[hidden] {
	display: none;
}

.wf-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .45);
	pointer-events: auto;
	animation: wf-fade .2s ease-out;
}

.wf-popup__panel {
	position: relative;
	inline-size: var(--wf-width, 460px);
	max-inline-size: calc(100vw - 28px);
	max-block-size: min(85vh, 720px);
	overflow: auto;
	margin: auto;
	padding: clamp(18px, 4vw, 26px);
	border: 1px solid #e2e6eb;
	border-radius: 18px;
	background: #fff;
	color: #1c2128;
	box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
	pointer-events: auto;
	animation: wf-pop .22s cubic-bezier(.2, .8, .3, 1);
}

.wf-popup--center .wf-popup__panel {
	align-self: center;
}

.wf-popup__panel > * {
	position: relative;
}

.wf-popup--bottom-start .wf-popup__panel,
.wf-popup--bottom-end .wf-popup__panel,
.wf-popup--top-start .wf-popup__panel,
.wf-popup--top-end .wf-popup__panel {
	position: absolute;
	margin: 0;
	inset-inline: auto;
}

.wf-popup--bottom-start .wf-popup__panel {
	inset-block-end: 22px;
	inset-inline-start: 22px;
}

.wf-popup--bottom-end .wf-popup__panel {
	inset-block-end: 22px;
	inset-inline-end: 22px;
}

.wf-popup--top-start .wf-popup__panel {
	inset-block-start: 22px;
	inset-inline-start: 22px;
}

.wf-popup--top-end .wf-popup__panel {
	inset-block-start: 22px;
	inset-inline-end: 22px;
}

@media (max-width: 640px) {
	.wf-popup--bottom-start .wf-popup__panel,
	.wf-popup--bottom-end .wf-popup__panel,
	.wf-popup--top-start .wf-popup__panel,
	.wf-popup--top-end .wf-popup__panel {
		inset-inline: 12px;
		inset-block-end: 12px;
		inset-block-start: auto;
		max-block-size: 82vh;
		inline-size: auto;
	}
}

.wf-popup__close {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-end: 10px;
	inline-size: 32px;
	block-size: 32px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f2f4f7;
	color: #5b6472;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.wf-popup__close:hover {
	background: #e6e9ee;
	color: #1c2128;
}

.wf-kicker {
	margin: 0 0 4px;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--wf-accent, #1f6feb);
	text-transform: none;
}

.wf-title--popup {
	margin-block-end: 14px;
	padding-inline-end: 26px;
}

.wf-note--popup {
	margin-block-start: 12px;
}

.wf-detected {
	margin-block-end: 14px;
	padding: 14px;
	border: 1px solid #e2e6eb;
	border-radius: 12px;
	background: #f7f8fa;
}

.wf-detected__text {
	margin: 0 0 10px;
	font-size: .95rem;
	font-weight: 600;
}

.wf-detected__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wf-popup-is-open {
	overflow: hidden;
}

@keyframes wf-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wf-pop {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.wf-popup__panel,
	.wf-popup__backdrop {
		animation: none;
	}

	.wf-option__face,
	.wf-btn {
		transition: none;
	}
}
