/*
 * Dr20 Smart Advisor — Frontend wizard styles (RTL).
 * Redesigned card-based UI: dark navy header + progress, illustrated question
 * card, radio-style option rows, single prominent CTA.
 * Brand color is injected inline via --dr20sa-primary on the root container;
 * the dark header/CTA navy is derived from it automatically.
 */
.dr20sa-advisor {
	--dr20sa-primary: #2c51a1;
	--dr20sa-navy: #16214a;
	--dr20sa-ink: #1c2333;
	--dr20sa-muted: #6b7280;
	--dr20sa-bg: #f4f6fb;
	--dr20sa-card: #ffffff;
	--dr20sa-border: #e6eaf3;
	--dr20sa-success: #1f9d55;
	--dr20sa-danger: #d63638;
	--dr20sa-radius-lg: 22px;
	--dr20sa-radius-md: 16px;
	--dr20sa-radius-sm: 12px;
	direction: rtl;
	max-width: 460px;
	margin: 0 auto;
	font-family: "iransans", Tahoma, "Segoe UI", system-ui, sans-serif;
	color: var(--dr20sa-ink);
}

/* Derive a deep navy shade from the configured brand color when supported. */
@supports ( color: color-mix( in srgb, red, blue ) ) {
	.dr20sa-advisor {
		--dr20sa-navy: color-mix( in srgb, var(--dr20sa-primary) 65%, #020611 45% );
	}
}

.dr20sa-advisor,
.dr20sa-advisor * {
	box-sizing: border-box !important;
}

/*
 * Defensive resets — this widget is embedded inside arbitrary WordPress
 * themes/page builders that often apply global rules to bare tags (img,
 * a, ul/li, button) which otherwise leak in and break the layout
 * (stretched images, underlined "buttons", re-indented lists). These are
 * deliberately narrow — margins/colors that individual components below
 * need to control themselves are left alone so they aren't fought over
 * two rules with the same specificity later in this file.
 */
.dr20sa-advisor ul,
.dr20sa-advisor ol {
	list-style: none !important;
}

.dr20sa-advisor a {
	text-decoration: none;
}

.dr20sa-advisor button {
	font-family: inherit;
	border: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background: #1B3266;
  	border-radius: 10px;
}

.dr20sa-advisor input {
	font-family: inherit;
}

.dr20sa-advisor img {
	max-width: 100%;
	display: block;
	border: none;
	box-shadow: none;
}

/* ---------- Outer card shell ---------- */
.dr20sa-card {
	background: var(--dr20sa-card);
	border-radius: var(--dr20sa-radius-lg);
	overflow: hidden;
	box-shadow: 0 20px 45px rgba(20, 30, 70, 0.14), 0 2px 8px rgba(20, 30, 70, 0.06);
}

/* ---------- Header (navy) ---------- */
.dr20sa-header {
	background: var(--dr20sa-navy);
	padding: 18px 20px 16px;
	color: #fff;
}

.dr20sa-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
	position: relative;
}

.dr20sa-logo {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: 0.3px;
	color: #fff;
	text-align: center;
}

.dr20sa-logo-accent {
	color: #7ea3ff;
}

.dr20sa-step-label {
	font-size: 12px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.85);
	background: rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	padding: 3px 10px;
	min-width: 30px;
	text-align: center;
	flex-shrink: 0;
}

.dr20sa-progress-track {
	height: 7px;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	overflow: hidden;
	direction: ltr;
}

.dr20sa-progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, #7ea3ff, #a9c2ff);
	border-radius: 999px;
	transition: width 0.35s ease;
}

/* ---------- Body ---------- */
.dr20sa-body {
	background: var(--dr20sa-bg);
	padding: 26px 20px 20px;
}

/* ---------- Start screen ---------- */
.dr20sa-start {
	text-align: center;
	padding: 12px 6px 6px;
}

.dr20sa-icon-bubble {
	width: 96px;
	height: 96px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: linear-gradient(160deg, #e7edfb, #d3ddf6);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dr20sa-navy);
	position: relative;
	overflow: hidden;
}

.dr20sa-icon-bubble svg {
	width: 46px;
	height: 46px;
	position: relative;
	z-index: 1;
}

.dr20sa-icon-bubble .dr20sa-icon-emoji {
	font-size: 42px;
	line-height: 1;
	position: relative;
	z-index: 1;
}

.dr20sa-icon-bubble::before,
.dr20sa-icon-bubble::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.55);
}

.dr20sa-icon-bubble::before {
	width: 10px;
	height: 10px;
	top: 16px;
	right: 20px;
}

.dr20sa-icon-bubble::after {
	width: 6px;
	height: 6px;
	top: 30px;
	right: 32px;
}

.dr20sa-start h3 {
	margin: 0 0 8px;
	font-size: 21px;
	font-weight: 800;
	color: var(--dr20sa-navy);
}

.dr20sa-start p {
	color: var(--dr20sa-muted);
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.9;
	padding: 0 6px;
}

.dr20sa-start-features {
	list-style: none;
	margin: 0 0 24px;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: right;
}

.dr20sa-start-features li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--dr20sa-ink);
	background: #fff;
	border: 1px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-sm);
	padding: 10px 14px;
}

.dr20sa-start-features svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--dr20sa-success);
}

/* ---------- Question ---------- */
.dr20sa-question {
	animation: dr20sa-fade-in 0.28s ease;
}

@keyframes dr20sa-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.dr20sa-question-head {
	text-align: center;
	margin-bottom: 20px;
}

.dr20sa-question-title {
	font-size: 19px;
	font-weight: 800;
	margin: 0 0 8px;
	color: var(--dr20sa-navy);
	line-height: 1.5;
}

.dr20sa-question-desc {
	color: var(--dr20sa-muted);
	font-size: 13px;
	margin: 0 auto;
	max-width: 320px;
	line-height: 1.9;
}

.dr20sa-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 6px;
}

.dr20sa-option {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1.5px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-md);
	padding: 13px 16px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	background: #fff;
	user-select: none;
}

.dr20sa-option:hover {
	border-color: #b9c8ec;
}

.dr20sa-option input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.dr20sa-option-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: #eef2fb;
	color: var(--dr20sa-navy);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 18px;
}

.dr20sa-option-icon svg {
	width: 20px;
	height: 20px;
}

.dr20sa-option-index {
	font-size: 14px;
	font-weight: 700;
	color: var(--dr20sa-muted);
}

.dr20sa-option.is-selected .dr20sa-option-index {
	color: #fff;
}

.dr20sa-option-label {
	flex: 1;
	min-width: 0;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--dr20sa-ink);
	line-height: 1.6;
}

.dr20sa-option-radio {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #cfd8ea;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.dr20sa-option.dr20sa-checkbox-style .dr20sa-option-radio {
	border-radius: 7px;
}

.dr20sa-option-radio svg {
	width: 12px;
	height: 12px;
	color: #fff;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.dr20sa-option.is-selected {
	border-color: var(--dr20sa-primary);
	background: #eef3fd;
	box-shadow: 0 0 0 1px var(--dr20sa-primary) inset;
}

.dr20sa-option.is-selected .dr20sa-option-radio {
	border-color: var(--dr20sa-navy);
	background: var(--dr20sa-navy);
}

.dr20sa-option.is-selected .dr20sa-option-radio svg {
	opacity: 1;
	transform: scale(1);
}

.dr20sa-option.is-selected .dr20sa-option-icon {
	background: var(--dr20sa-navy);
	color: #fff;
}

.dr20sa-text-input,
input.dr20sa-text-input {
	width: 100%;
	padding: 13px 16px;
	font-size: 15px;
	border: 1.5px solid var(--dr20sa-border);
	background: #fff;
	border-radius: var(--dr20sa-radius-md);
	direction: ltr;
	text-align: left;
	font-family: inherit;
}

.dr20sa-text-input:focus {
	outline: none;
	border-color: var(--dr20sa-primary);
	box-shadow: 0 0 0 3px rgba(44, 81, 161, 0.12);
}

.dr20sa-text-input.dr20sa-rtl-input {
	direction: rtl;
	text-align: right;
}

.dr20sa-range-wrap {
	background: #fff;
	border: 1.5px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-md);
	padding: 18px 16px 14px;
	margin: 6px 0 14px;
}

.dr20sa-range-value {
	text-align: center;
	font-size: 26px;
	font-weight: 800;
	color: var(--dr20sa-navy);
	margin-bottom: 10px;
}

.dr20sa-range-value span {
	font-size: 13px;
	font-weight: 500;
	color: var(--dr20sa-muted);
	margin-right: 4px;
}

.dr20sa-range-input {
	width: 100%;
	accent-color: var(--dr20sa-primary);
}

.dr20sa-range-scale {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--dr20sa-muted);
	margin-top: 4px;
}

/* ---------- Buttons ---------- */
.dr20sa-nav {
	margin-top: 20px;
	display: flex;
	gap: 10px;
}

.dr20sa-nav .dr20sa-btn {
	width: auto;
	flex: 1;
}

.dr20sa-btn {
	width: 100%;
	background: var(--dr20sa-navy);
	color: #fff !important;
	border: none;
	border-radius: var(--dr20sa-radius-md);
	padding: 15px 22px;
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none !important;
	transition: filter 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
	font-family: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.dr20sa-btn svg {
	transform: scaleX(-1);
	transition: transform 0.15s ease;
}

.dr20sa-btn:hover:not(:disabled),
.dr20sa-btn:visited,
.dr20sa-btn:focus {
	color: #1B3266 !important;
	text-decoration: none !important;
	filter: brightness(1.12);
}

.dr20sa-btn:active:not(:disabled) {
	transform: scale(0.985);
}

.dr20sa-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Secondary (back) button — same shape/size as the primary nav button,
 * lighter fill so it reads as the lower-priority action next to it. */
.dr20sa-btn-secondary {
	background: #eef1f9;
	color: #fff !important;
	flex: 0 0 auto;
	min-width: 110px;
}

.dr20sa-btn-secondary:hover:not(:disabled),
.dr20sa-btn-secondary:visited,
.dr20sa-btn-secondary:focus {
	background: #e2e7f5;
	color: var(--dr20sa-navy) !important;
	filter: none;
}

.dr20sa-btn-secondary svg {
	transform: scaleX(1); /* opposite direction from the primary arrow */
}

.dr20sa-btn-link {
	width: auto;
	background: transparent;
	color: var(--dr20sa-muted) !important;
	padding: 10px;
	font-weight: 600;
	font-size: 13px;
	margin: 10px auto 0;
	display: flex;
}

.dr20sa-btn-link:hover:not(:disabled),
.dr20sa-btn-link:visited,
.dr20sa-btn-link:focus {
	color: var(--dr20sa-primary) !important;
	filter: none;
}

.dr20sa-error {
	color: var(--dr20sa-danger);
	background: #fdecec;
	border: 1px solid #f5c2c3;
	border-radius: var(--dr20sa-radius-sm);
	padding: 10px 14px;
	font-size: 13px;
	margin-top: 14px;
	display: none;
	text-align: center;
}

/* ---------- Lead form ---------- */
.dr20sa-lead-form {
	animation: dr20sa-fade-in 0.28s ease;
}

.dr20sa-lead-form h3 {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 800;
	color: var(--dr20sa-navy);
	text-align: center;
}

.dr20sa-lead-form > p {
	color: var(--dr20sa-muted);
	font-size: 13px;
	text-align: center;
	margin: 0 0 22px;
	line-height: 1.8;
}

.dr20sa-field {
	margin-bottom: 14px;
}

.dr20sa-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 7px;
	color: var(--dr20sa-ink);
}

.dr20sa-input-wrap {
	position: relative;
}

.dr20sa-input-wrap svg {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	color: var(--dr20sa-muted);
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.dr20sa-input-wrap input {
	padding-right: 44px !important;
}

.dr20sa-field input[type="text"],
.dr20sa-field input[type="tel"],
.dr20sa-field input[type="email"] {
	width: 100%;
	padding: 13px 16px;
	font-size: 15px;
	border: 1.5px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-md);
	font-family: inherit;
	direction: rtl;
	text-align: right;
}

.dr20sa-field input:focus {
	outline: none;
	border-color: var(--dr20sa-primary);
	box-shadow: 0 0 0 3px rgba(44, 81, 161, 0.12);
}

.dr20sa-consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 12.5px;
	color: var(--dr20sa-muted);
	line-height: 1.7;
	background: #fff;
	border: 1px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-sm);
	padding: 12px 14px;
}

.dr20sa-consent input {
	margin-top: 3px;
	accent-color: var(--dr20sa-primary);
	flex-shrink: 0;
}

/* ---------- Results ---------- */
.dr20sa-results-head {
	text-align: center;
	margin-bottom: 20px;
}

.dr20sa-results-head h3 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 800;
	color: var(--dr20sa-navy);
}

.dr20sa-results-head p {
	color: var(--dr20sa-muted);
	margin: 0;
	font-size: 13px;
}

.dr20sa-rec {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	background: var(--dr20sa-card);
	border: 1.5px solid var(--dr20sa-border);
	border-radius: var(--dr20sa-radius-md);
	padding: 14px;
	margin-bottom: 14px;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
	position: relative;
	max-width: 100%;
	overflow: hidden;
}

.dr20sa-rec:first-child {
	border-color: var(--dr20sa-primary);
	box-shadow: 0 10px 26px rgba(20, 30, 70, 0.1);
}

.dr20sa-rec:hover {
	box-shadow: 0 10px 26px rgba(20, 30, 70, 0.12);
}

.dr20sa-rec-img,
.dr20sa-rec-img-placeholder {
	width: 92px !important;
	height: 92px !important;
	min-width: 92px;
	border-radius: var(--dr20sa-radius-sm);
	object-fit: cover;
	background: #eef1f8;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c3cadb;
	font-size: 26px;
}

.dr20sa-rec-img-placeholder svg {
	width: 32px;
	height: 32px;
}

.dr20sa-rec-body {
	flex: 1 1 160px;
	min-width: 0;
	max-width: 100%;
}

.dr20sa-rec-rank {
	display: inline-block;
	background: var(--dr20sa-navy);
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 11px;
	margin-bottom: 7px;
}

.dr20sa-rec-title {
	font-size: 15.5px;
	font-weight: 700;
	margin: 0 0 4px;
	color: var(--dr20sa-ink);
	line-height: 1.5;
	overflow-wrap: break-word;
	word-break: break-word;
}

.dr20sa-rec-price {
	font-size: 14.5px;
	font-weight: 700;
	color: var(--dr20sa-primary);
	margin-bottom: 8px;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 0;
}

.dr20sa-rec-price .dr20sa-regular {
	color: var(--dr20sa-muted);
	text-decoration: line-through;
	font-weight: 400;
	font-size: 12.5px;
	margin-right: 8px;
}

.dr20sa-rec-reason {
	font-size: 12.5px;
	color: var(--dr20sa-muted);
	margin: 0 0 8px;
	line-height: 1.7;
	overflow-wrap: break-word;
	word-break: break-word;
}

.dr20sa-rec-points {
	list-style: none;
	padding: 0 !important;
	margin: 0 0 10px;
	max-width: 100%;
}

.dr20sa-rec-points li {
	font-size: 12px;
	color: var(--dr20sa-success);
	margin-bottom: 3px;
	overflow-wrap: break-word;
	word-break: break-word;
}

.dr20sa-rec-points li::before {
	content: "\2713  ";
	font-weight: 700;
}

.dr20sa-rec .dr20sa-btn {
	width: auto;
	max-width: 100%;
	padding: 9px 18px;
	font-size: 12.5px;
	background: var(--dr20sa-primary);
	display: inline-flex;
}

.dr20sa-rec .dr20sa-btn svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.dr20sa-empty-rec {
	text-align: center;
	color: var(--dr20sa-muted);
	padding: 34px 16px;
	background: var(--dr20sa-card);
	border-radius: var(--dr20sa-radius-md);
	border: 1.5px dashed var(--dr20sa-border);
	font-size: 13.5px;
	line-height: 1.9;
}

.dr20sa-restart {
	text-align: center;
	margin-top: 6px;
}

/* ---------- Loader ---------- */
.dr20sa-loader {
	text-align: center;
	padding: 46px 0;
	display: none;
}

.dr20sa-spinner {
	width: 34px;
	height: 34px;
	border: 4px solid #dbe2f0;
	border-top-color: var(--dr20sa-primary);
	border-radius: 50%;
	animation: dr20sa-spin 0.8s linear infinite;
	margin: 0 auto 14px;
}

.dr20sa-loader-text {
	color: var(--dr20sa-muted);
	font-size: 13.5px;
}

@keyframes dr20sa-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Disclaimer ---------- */
.dr20sa-disclaimer {
	font-size: 11.5px;
	color: var(--dr20sa-muted);
	margin-top: 16px;
	line-height: 1.8;
	text-align: center;
	padding: 0 10px;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
	.dr20sa-advisor {
		max-width: 560px;
	}

	.dr20sa-header {
		padding: 22px 28px 18px;
	}

	.dr20sa-body {
		padding: 32px 30px 26px;
	}
}

@media (max-width: 380px) {
	.dr20sa-icon-bubble {
		width: 80px;
		height: 80px;
	}

	.dr20sa-option {
		padding: 11px 13px;
	}

	/* Image + text side-by-side gets cramped below ~380px — stack instead. */
	.dr20sa-rec {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.dr20sa-rec-img,
	.dr20sa-rec-img-placeholder {
		width: 100px !important;
		height: 100px !important;
	}

	.dr20sa-rec-body {
		width: 100%;
		flex-basis: auto;
	}

	.dr20sa-rec-price {
		justify-content: center;
	}

	.dr20sa-rec-points {
		text-align: right;
	}

	.dr20sa-rec .dr20sa-btn {
		width: 100%;
	}
}
