@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;600;700;800&display=swap");

.frsp-survey-runtime {
	--frsp-color-primary: #005a9c;
	--frsp-color-primary-hover: #00467a;
	--frsp-color-secondary: #00a6a6;
	--frsp-color-success: #2e7d32;
	--frsp-color-success-soft: #edf7ee;
	--frsp-color-warning: #f9a825;
	--frsp-color-warning-soft: #fff8e1;
	--frsp-color-danger: #d32f2f;
	--frsp-color-danger-soft: #fdecea;
	--frsp-color-bg: #f8f9fa;
	--frsp-color-card: #ffffff;
	--frsp-color-border: #dee2e6;
	--frsp-color-field-border: #ced4da;
	--frsp-color-text: #212529;
	--frsp-color-text-muted: #6c757d;
	--frsp-shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.06);
	--frsp-shadow-focus: 0 0 0 3px rgba(0, 90, 156, 0.16);
	--frsp-radius-card: 10px;
	--frsp-radius-control: 8px;

	max-width: 1040px;
	margin: 0 auto 40px;
	padding: 24px;
	color: var(--frsp-color-text);
	background: var(--frsp-color-bg);
	border: 1px solid var(--frsp-color-border);
	border-radius: var(--frsp-radius-card);
	box-shadow: var(--frsp-shadow-soft);
	font-family: "Inter", "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
}

[dir="rtl"] .frsp-survey-runtime,
.rtl .frsp-survey-runtime,
html[lang^="ar"] .frsp-survey-runtime,
body[lang^="ar"] .frsp-survey-runtime {
	font-family: "Cairo", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.frsp-survey-runtime *,
.frsp-survey-runtime *::before,
.frsp-survey-runtime *::after {
	box-sizing: border-box;
}

.frsp-survey-runtime__header {
	position: relative;
	margin: -24px -24px 24px;
	padding: 24px;
	background: linear-gradient(135deg, var(--frsp-color-primary) 0%, var(--frsp-color-primary-hover) 100%);
	border-radius: var(--frsp-radius-card) var(--frsp-radius-card) 0 0;
	color: #ffffff;
	overflow: hidden;
}

.frsp-survey-runtime__header::after {
	content: "";
	position: absolute;
	inset: auto -120px -120px auto;
	width: 260px;
	height: 260px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 50%;
}

.frsp-brandbar {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 18px;
}

.frsp-brandmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: var(--frsp-color-primary);
	background: #ffffff;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.frsp-brandbar__label {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.01em;
}

.frsp-brandbar__context {
	padding: 4px 10px;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 600;
}

.frsp-survey-runtime__header h2 {
	position: relative;
	z-index: 1;
	margin: 0;
	color: #ffffff;
	font-size: clamp(1.45rem, 2vw, 2rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0;
}

.frsp-survey-runtime__header p {
	position: relative;
	z-index: 1;
	max-width: 820px;
	margin: 10px 0 0;
	color: rgba(255, 255, 255, 0.92);
	font-size: 1rem;
}

.frsp-survey-meta {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.frsp-survey-meta li {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 6px 12px;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 600;
}

.frsp-errors,
.frsp-notice {
	margin: 0 0 20px;
	padding: 14px 16px;
	border: 1px solid transparent;
	border-radius: var(--frsp-radius-control);
	font-size: 0.98rem;
}

.frsp-errors {
	color: #8b1e1e;
	background: var(--frsp-color-danger-soft);
	border-color: var(--frsp-color-danger);
}

.frsp-notice {
	color: #1f5f25;
	background: var(--frsp-color-success-soft);
	border-color: var(--frsp-color-success);
}

.frsp-errors p,
.frsp-notice p {
	margin: 0 0 8px;
	font-weight: 700;
}

.frsp-errors ul {
	margin: 0;
	padding-inline-start: 18px;
}

.frsp-survey-section {
	margin: 0 0 20px;
	background: var(--frsp-color-card);
	border: 1px solid var(--frsp-color-border);
	border-radius: var(--frsp-radius-card);
	box-shadow: var(--frsp-shadow-soft);
	overflow: hidden;
}

.frsp-section__header {
	display: grid;
	gap: 6px;
	padding: 20px 24px;
	background: #ffffff;
	border-bottom: 1px solid var(--frsp-color-border);
}

.frsp-section__eyebrow {
	color: var(--frsp-color-secondary);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.frsp-section__header h3 {
	margin: 0;
	color: var(--frsp-color-text);
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.35;
}

.frsp-section__body {
	padding: 6px 24px 8px;
	background: var(--frsp-color-card);
}

.frsp-question {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 22px 0;
	border: 0;
	border-bottom: 1px solid var(--frsp-color-border);
}

.frsp-question:last-child {
	border-bottom: 0;
}

.frsp-question legend {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	color: var(--frsp-color-text);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.6;
}

.frsp-question__required {
	margin-inline-start: 6px;
	color: var(--frsp-color-danger);
	font-size: 1rem;
	font-weight: 800;
}

.frsp-question__control {
	display: grid;
	gap: 12px;
}

.frsp-input,
.frsp-textarea,
.frsp-file {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	color: var(--frsp-color-text);
	background: #ffffff;
	border: 1px solid var(--frsp-color-field-border);
	border-radius: var(--frsp-radius-control);
	box-shadow: none;
	font: inherit;
}

.frsp-textarea {
	min-height: 132px;
	resize: vertical;
}

.frsp-input:focus,
.frsp-textarea:focus,
.frsp-file:focus {
	border-color: var(--frsp-color-primary);
	box-shadow: var(--frsp-shadow-focus);
	outline: 0;
}

.frsp-option {
	position: relative;
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 12px;
	align-items: start;
	padding: 13px 14px;
	background: #ffffff;
	border: 1px solid var(--frsp-color-border);
	border-radius: var(--frsp-radius-control);
	cursor: pointer;
	transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.frsp-option:hover {
	border-color: var(--frsp-color-primary);
	background: #fbfdff;
}

.frsp-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.frsp-option__indicator {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	background: #ffffff;
	border: 2px solid var(--frsp-color-primary);
	border-radius: 50%;
}

.frsp-option input[type="checkbox"] + .frsp-option__indicator {
	border-radius: 5px;
}

.frsp-option input:checked + .frsp-option__indicator {
	background: var(--frsp-color-primary);
	box-shadow: inset 0 0 0 4px #ffffff;
}

.frsp-option input[type="checkbox"]:checked + .frsp-option__indicator {
	background:
		linear-gradient(135deg, transparent 0 42%, #ffffff 42% 58%, transparent 58%),
		linear-gradient(45deg, transparent 0 45%, #ffffff 45% 60%, transparent 60%),
		var(--frsp-color-primary);
	box-shadow: none;
}

.frsp-option input:focus-visible + .frsp-option__indicator {
	box-shadow: var(--frsp-shadow-focus);
}

.frsp-option:has(input:checked) {
	border-color: var(--frsp-color-primary);
	background: #f2f8fd;
}

.frsp-option__label {
	color: var(--frsp-color-text);
	font-size: 0.98rem;
	line-height: 1.5;
}

.frsp-file-help {
	margin: 0;
	color: var(--frsp-color-text-muted);
	font-size: 0.92rem;
}

.frsp-survey-runtime__actions {
	position: sticky;
	bottom: 0;
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: flex-end;
	margin: 22px -24px -24px;
	padding: 18px 24px;
	background: rgba(255, 255, 255, 0.98);
	border-top: 1px solid var(--frsp-color-border);
	border-radius: 0 0 var(--frsp-radius-card) var(--frsp-radius-card);
	backdrop-filter: blur(10px);
}

.frsp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: var(--frsp-radius-control);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.frsp-button:hover {
	transform: translateY(-1px);
}

.frsp-button:focus-visible {
	outline: 0;
	box-shadow: var(--frsp-shadow-focus);
}

.frsp-button--primary {
	color: #ffffff;
	background: var(--frsp-color-primary);
	border-color: var(--frsp-color-primary);
}

.frsp-button--primary:hover,
.frsp-button--primary:focus {
	background: var(--frsp-color-primary-hover);
	border-color: var(--frsp-color-primary-hover);
}

.frsp-button--secondary {
	color: var(--frsp-color-primary);
	background: #ffffff;
	border-color: var(--frsp-color-primary);
}

.frsp-button--secondary:hover,
.frsp-button--secondary:focus {
	color: var(--frsp-color-primary-hover);
	background: #f7fbff;
	border-color: var(--frsp-color-primary-hover);
}

.frsp-autosave-status {
	flex: 1 1 220px;
	min-height: 1.4rem;
	color: var(--frsp-color-text-muted);
	font-size: 0.92rem;
}

[dir="rtl"] .frsp-brandbar,
.rtl .frsp-brandbar,
html[lang^="ar"] .frsp-brandbar,
body[lang^="ar"] .frsp-brandbar {
	flex-direction: row-reverse;
	justify-content: flex-end;
}

[dir="rtl"] .frsp-survey-runtime__actions,
.rtl .frsp-survey-runtime__actions,
html[lang^="ar"] .frsp-survey-runtime__actions,
body[lang^="ar"] .frsp-survey-runtime__actions {
	justify-content: flex-start;
}

[hidden] {
	display: none !important;
}

@media (max-width: 768px) {
	.frsp-survey-runtime {
		padding: 16px;
		border-radius: 0;
	}

	.frsp-survey-runtime__header {
		margin: -16px -16px 18px;
		padding: 18px 16px 20px;
		border-radius: 0;
	}

	.frsp-section__header,
	.frsp-section__body {
		padding-inline: 16px;
	}

	.frsp-question {
		padding: 18px 0;
	}

	.frsp-survey-runtime__actions {
		position: static;
		display: grid;
		margin: 18px -16px -16px;
		padding: 16px;
		border-radius: 0;
	}

	.frsp-button {
		width: 100%;
	}

	.frsp-autosave-status {
		order: 3;
	}
}
