/* Retirement Readiness Quiz — Typeform-style styling.
 * Scoped entirely under .rrq to prevent collisions with themes / Elementor.
 */

.rrq {
	--rrq-primary: #184276;
	--rrq-bg: #ffffff;
	--rrq-text: #000000;
	--rrq-muted: #5c6b80;
	--rrq-border: #e6ecf3;
	--rrq-shadow: 0 20px 60px rgba(24, 66, 118, 0.10);
	--rrq-radius: 18px;
	--rrq-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

	font-family: var(--rrq-font);
	color: var(--rrq-text);
	background: transparent;
	max-width: 840px;
	margin: 0 auto;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	line-height: 1.45;
}

.rrq *,
.rrq *::before,
.rrq *::after {
	box-sizing: border-box;
}

.rrq button {
	font-family: inherit;
	cursor: pointer;
}

.rrq__root {
	background: var(--rrq-bg);
	border-radius: var(--rrq-radius);
	box-shadow: var(--rrq-shadow);
	padding: clamp(28px, 5vw, 56px);
	min-height: 560px;
	position: relative;
	overflow: hidden;
	border: 1px solid var(--rrq-border);
}

/* ---------- Progress bar ---------- */
.rrq__progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: #eef2f7;
	overflow: hidden;
}
.rrq__progress-bar {
	display: block;
	height: 100%;
	width: 0%;
	background: var(--rrq-primary);
	transition: width 350ms cubic-bezier(.2,.8,.2,1);
}

/* ---------- Screens (slide+fade transitions) ---------- */
.rrq__screen {
	animation: rrq-fade-in 350ms cubic-bezier(.2,.8,.2,1) both;
}
.rrq__screen--leaving {
	animation: rrq-fade-out 250ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rrq-fade-in {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes rrq-fade-out {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(-10px); }
}

/* ---------- Typography ---------- */
.rrq h1, .rrq h2, .rrq h3 {
	margin: 0 0 14px;
	color: var(--rrq-text);
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.rrq h1 { font-size: clamp(28px, 4vw, 40px); }
.rrq h2 { font-size: clamp(22px, 3vw, 30px); }
.rrq p { margin: 0 0 14px; color: var(--rrq-text); }
.rrq small, .rrq .rrq__muted { color: var(--rrq-muted); font-size: 14px; }

/* ---------- Start screen ---------- */
.rrq__start {
	text-align: left;
	padding-top: 40px;
}
.rrq__start p {
	font-size: 17px;
	color: var(--rrq-muted);
	max-width: 58ch;
	margin-bottom: 28px;
}
.rrq__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--rrq-primary);
	color: #fff;
	border: 0;
	border-radius: 12px;
	padding: 16px 28px;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: transform 150ms ease, box-shadow 200ms ease, opacity 200ms;
	box-shadow: 0 6px 16px rgba(24, 66, 118, 0.25);
}
.rrq__btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(24, 66, 118, 0.30); }
.rrq__btn:focus-visible { outline: 3px solid rgba(24, 66, 118, 0.35); outline-offset: 2px; }
.rrq__btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.rrq__btn--ghost {
	background: transparent;
	color: var(--rrq-primary);
	box-shadow: none;
	padding: 12px 18px;
	font-weight: 500;
}
.rrq__btn--ghost:hover { background: rgba(24, 66, 118, 0.06); transform: none; box-shadow: none; }

/* Submit button — always vivid blue regardless of primary color setting */
.rrq__btn[data-rrq="submit"] {
	background: #1d6dc7;
	box-shadow: 0 6px 16px rgba(29, 109, 199, 0.28);
}
.rrq__btn[data-rrq="submit"]:hover {
	box-shadow: 0 10px 22px rgba(29, 109, 199, 0.36);
}

/* CTA anchor — force white text so themes can't override link colour */
.rrq a.rrq__btn { color: #fff; text-decoration: none; }
.rrq a.rrq__btn:hover { color: #fff; }

/* ---------- Question screen ---------- */
.rrq__question {
	padding-top: 28px;
}
.rrq__qmeta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	font-size: 13px;
	color: var(--rrq-muted);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.rrq__pill {
	display: inline-block;
	padding: 4px 10px;
	background: rgba(24, 66, 118, 0.08);
	color: var(--rrq-primary);
	border-radius: 999px;
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.04em;
}
.rrq__qtext {
	font-size: clamp(22px, 3.2vw, 32px);
	font-weight: 700;
	line-height: 1.25;
	margin: 6px 0 28px;
	color: var(--rrq-text);
}

.rrq__choices {
	display: grid;
	gap: 12px;
	margin-bottom: 28px;
}
.rrq__choice {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 56px;
	padding: 14px 18px;
	border-radius: 12px;
	border: 2px solid var(--rrq-border);
	background: #fff;
	text-align: left;
	font-size: 16px;
	font-weight: 500;
	color: var(--rrq-text);
	transition: border-color 150ms, background-color 150ms, transform 150ms;
}
.rrq__choice-label {
	transition: font-size 150ms ease;
}
.rrq__choice:hover {
	border-color: var(--rrq-primary);
	background: rgba(24, 66, 118, 0.04);
	color: var(--rrq-text);
}
.rrq__choice:hover .rrq__choice-label {
	font-size: 1.1em;
}
.rrq__choice:focus-visible { outline: 3px solid rgba(24, 66, 118, 0.35); outline-offset: 2px; }
.rrq__choice[aria-pressed="true"] {
	border-color: var(--rrq-primary);
	background: rgba(24, 66, 118, 0.08);
	color: var(--rrq-text);
}
.rrq__choice[aria-pressed="true"] .rrq__choice-label {
	font-size: 1.1em;
}
.rrq__choice-key {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	border: 1.5px solid var(--rrq-border);
	font-weight: 700;
	font-size: 14px;
	color: var(--rrq-primary);
	background: #fff;
	flex-shrink: 0;
}
.rrq__choice[aria-pressed="true"] .rrq__choice-key {
	background: var(--rrq-primary);
	color: #fff;
	border-color: var(--rrq-primary);
}

.rrq__qnav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.rrq__qnav-spacer { flex: 1; }
.rrq__hint {
	color: var(--rrq-muted);
	font-size: 13px;
}

/* ---------- Intake form ---------- */
.rrq__intake { padding-top: 24px; }
.rrq__grid {
	display: grid;
	gap: 14px;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 18px;
}
.rrq__grid .rrq__field--full { grid-column: 1 / -1; }
.rrq__field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--rrq-text);
	margin-bottom: 6px;
	letter-spacing: 0.01em;
}
.rrq__field input,
.rrq__field select {
	width: 100%;
	height: 52px;
	padding: 0 14px;
	border-radius: 12px;
	border: 2px solid var(--rrq-border);
	background: #fff;
	font-size: 16px;
	font-family: inherit;
	color: var(--rrq-text);
	transition: border-color 150ms, box-shadow 200ms;
}
.rrq__field select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--rrq-primary) 50%), linear-gradient(135deg, var(--rrq-primary) 50%, transparent 50%);
	background-position: right 18px center, right 13px center;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 36px;
}
.rrq__field input:focus,
.rrq__field select:focus {
	outline: none;
	border-color: var(--rrq-primary);
	box-shadow: 0 0 0 4px rgba(24, 66, 118, 0.15);
}
.rrq__field--error input,
.rrq__field--error select {
	border-color: #d64545;
}
.rrq__error-msg {
	display: block;
	margin-top: 6px;
	color: #d64545;
	font-size: 12px;
	font-weight: 500;
}
.rrq__consent {
	font-size: 12px;
	color: var(--rrq-muted);
	margin: 14px 0 20px;
	line-height: 1.55;
}
.rrq__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* ---------- Results ---------- */
.rrq__results { padding-top: 24px; }
.rrq__results h2 { margin-bottom: 16px; }
.rrq__message p { font-size: 17px; line-height: 1.55; }
.rrq__scores {
	margin: 28px 0 24px;
	padding: 24px;
	background: #f5f8fc;
	border-radius: 14px;
	border: 1px solid var(--rrq-border);
}
.rrq__scores h3 {
	margin: 0 0 14px;
	font-size: 14px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--rrq-muted);
}
.rrq__score {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	gap: 4px 14px;
	margin-bottom: 14px;
}
.rrq__score:last-child { margin-bottom: 0; }
.rrq__score-label { font-size: 14px; font-weight: 600; color: var(--rrq-text); }
.rrq__score-value { font-size: 14px; font-weight: 700; color: var(--rrq-primary); font-variant-numeric: tabular-nums; }
.rrq__score-bar {
	grid-column: 1 / -1;
	height: 8px;
	background: #e6ecf3;
	border-radius: 999px;
	overflow: hidden;
}
.rrq__score-bar span {
	display: block;
	height: 100%;
	background: var(--rrq-primary);
	border-radius: 999px;
	width: 0;
	transition: width 900ms cubic-bezier(.2,.8,.2,1);
}
.rrq__cta-wrap { text-align: left; margin-top: 18px; }

/* ---------- Spinner / submitting ---------- */
.rrq__spinner-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--rrq-muted);
	padding: 40px 0;
}
.rrq__spinner {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid rgba(24, 66, 118, 0.18);
	border-top-color: var(--rrq-primary);
	animation: rrq-spin 800ms linear infinite;
}
@keyframes rrq-spin { to { transform: rotate(360deg); } }

/* ---------- Textarea (tax calculator comments step) ---------- */
.rrq__field textarea {
	width: 100%;
	padding: 12px 14px;
	border-radius: 12px;
	border: 2px solid var(--rrq-border);
	background: #fff;
	font-size: 16px;
	font-family: inherit;
	color: var(--rrq-text);
	resize: vertical;
	min-height: 100px;
	transition: border-color 150ms, box-shadow 200ms;
}
.rrq__field textarea:focus {
	outline: none;
	border-color: var(--rrq-primary);
	box-shadow: 0 0 0 4px rgba(24, 66, 118, 0.15);
}

/* ---------- Submit button modifier ---------- */
.rrq__btn--submit {
	background: #1d6dc7;
	box-shadow: 0 6px 16px rgba(29, 109, 199, 0.28);
}
.rrq__btn--submit:hover {
	box-shadow: 0 10px 22px rgba(29, 109, 199, 0.36);
}

/* ═══════════════════════════════════════════════════════════════
   LEGACY & ESTATE PLANNING QUIZ
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Score display ---------- */
.rrq-legacy__score-display {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 24px;
}
.rrq-legacy__score-circle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	background: var(--rrq-primary);
	color: #fff;
	flex-shrink: 0;
	box-shadow: 0 8px 24px rgba(24, 66, 118, 0.28);
}
.rrq-legacy__score-num {
	font-size: 36px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
}
.rrq-legacy__score-max {
	font-size: 13px;
	font-weight: 500;
	opacity: 0.75;
	margin-top: 2px;
}
.rrq-legacy__tier-label {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(24, 66, 118, 0.10);
	color: var(--rrq-primary);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

/* ---------- Checklist ---------- */
.rrq-legacy__checklist {
	list-style: none;
	margin: 0;
	padding: 0;
}
.rrq-legacy__checklist li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rrq-border);
	font-size: 15px;
	line-height: 1.5;
	color: var(--rrq-text);
}
.rrq-legacy__checklist li:last-child { border-bottom: none; }
.rrq-legacy__checklist li::before {
	content: '✓';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--rrq-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   RETIREMENT TAX CALCULATOR
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Single / Household toggle ---------- */
.rrq-tax__toggle {
	display: inline-flex;
	border-radius: 12px;
	border: 2px solid var(--rrq-border);
	overflow: hidden;
	background: #f5f8fc;
	margin-bottom: 8px;
}
.rrq-tax__toggle-btn {
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	background: transparent;
	color: var(--rrq-muted);
	border: none;
	cursor: pointer;
	transition: background 150ms, color 150ms;
}
.rrq-tax__toggle-btn:hover { color: var(--rrq-primary); }
.rrq-tax__toggle-btn--active {
	background: var(--rrq-primary);
	color: #fff;
}
.rrq-tax__toggle-btn--active:hover { color: #fff; }

/* ---------- Sliders ---------- */
.rrq-tax__slider-wrap {
	margin-top: 18px;
	margin-bottom: 28px;
}
.rrq-tax__slider-value {
	font-size: clamp(36px, 6vw, 52px);
	font-weight: 800;
	color: var(--rrq-primary);
	letter-spacing: -0.02em;
	margin-bottom: 12px;
	line-height: 1;
}
.rrq-tax__slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: linear-gradient(to right, var(--rrq-primary) var(--rrq-slider-pct, 50%), #e6ecf3 var(--rrq-slider-pct, 50%));
	outline: none;
	cursor: pointer;
	margin-bottom: 10px;
}
.rrq-tax__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--rrq-primary);
	box-shadow: 0 2px 8px rgba(24, 66, 118, 0.30);
	border: 3px solid #fff;
	cursor: grab;
	transition: transform 150ms;
}
.rrq-tax__slider::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.rrq-tax__slider::-moz-range-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--rrq-primary);
	box-shadow: 0 2px 8px rgba(24, 66, 118, 0.30);
	border: 3px solid #fff;
	cursor: grab;
}
.rrq-tax__slider-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--rrq-muted);
	font-weight: 500;
}

/* ---------- Result cards ---------- */
.rrq-tax__card {
	background: #f5f8fc;
	border-radius: 14px;
	border: 1px solid var(--rrq-border);
	padding: 20px 22px;
	margin-bottom: 16px;
}
.rrq-tax__card:last-child { margin-bottom: 0; }
.rrq-tax__card-title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--rrq-muted);
	margin: 0 0 12px;
}
.rrq-tax__years {
	font-size: 13px;
	color: var(--rrq-muted);
	margin: 0 0 14px;
}

/* ---------- Stacked bar visualization ---------- */
.rrq-tax__viz {
	margin-bottom: 16px;
}
.rrq-tax__bar-track {
	display: flex;
	height: 42px;
	border-radius: 8px;
	overflow: hidden;
	background: #e6ecf3;
	margin-bottom: 8px;
}
.rrq-tax__bar-fill {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	width: 0%;
	transition: width 900ms cubic-bezier(.2,.8,.2,1);
	overflow: hidden;
}
.rrq-tax__bar-fill--at  { background: #1d8c5a; }
.rrq-tax__bar-fill--tax { background: #c94a4a; }
.rrq-tax__bar-label {
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
	padding: 0 8px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rrq-tax__bar-legend {
	display: flex;
	gap: 16px;
	font-size: 13px;
	color: var(--rrq-text);
	flex-wrap: wrap;
}
.rrq-tax__legend-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	vertical-align: middle;
	margin-right: 5px;
}
.rrq-tax__legend-dot--at  { background: #1d8c5a; }
.rrq-tax__legend-dot--tax { background: #c94a4a; }

/* ---------- Stat rows ---------- */
.rrq-tax__stats {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}
.rrq-tax__stat {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 14px;
	padding: 6px 0;
	border-bottom: 1px solid var(--rrq-border);
}
.rrq-tax__stat:last-child { border-bottom: none; }
.rrq-tax__stat-label { color: var(--rrq-muted); font-weight: 500; }
.rrq-tax__stat-value {
	font-weight: 700;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	color: var(--rrq-primary);
	white-space: nowrap;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.rrq__root { padding: 26px 20px; min-height: 520px; border-radius: 14px; }
	.rrq__grid { grid-template-columns: 1fr; }
	.rrq__qtext { font-size: 22px; }
	.rrq__btn { width: 100%; padding: 16px 20px; }
	.rrq__qnav { flex-direction: column-reverse; align-items: stretch; }
	.rrq__qnav .rrq__btn--ghost { width: 100%; }
	.rrq-legacy__score-display { flex-direction: column; text-align: center; }
	.rrq-tax__toggle { width: 100%; }
	.rrq-tax__toggle-btn { flex: 1; }
	.rrq-tax__stat { flex-direction: column; gap: 2px; }
	.rrq-tax__stat-value { font-size: 16px; }
}
