.aps-survey {
	--aps-accent: #1a3c7a;
	--aps-accent-soft: #e8edf7;
	--aps-error: #c5221f;
	--aps-border: #dadce0;
	--aps-text: #202124;
	--aps-muted: #5f6368;
	max-width: 760px;
	margin: 0 auto;
	color: var(--aps-text);
	font-size: 16px;
	line-height: 1.5;
}

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

.aps-card {
	background: #fff;
	border: 1px solid var(--aps-border);
	border-radius: 8px;
	padding: 22px 24px;
	margin: 0 0 12px;
}

.aps-header {
	border-top: 10px solid var(--aps-accent);
}

.aps-header h2 {
	margin: 0 0 12px;
	font-size: 1.8em;
	line-height: 1.25;
}

.aps-header h3 {
	margin: 0 0 8px;
	font-size: 1.15em;
}

.aps-header blockquote {
	margin: 12px 0;
	padding: 4px 0 4px 14px;
	border-left: 3px solid var(--aps-accent);
	font-style: italic;
}

.aps-header blockquote cite {
	display: block;
	font-style: normal;
	color: var(--aps-muted);
	font-size: 0.9em;
}

.aps-required-note {
	margin: 12px 0 0;
	color: var(--aps-error);
	font-size: 0.9em;
}

.aps-star {
	color: var(--aps-error);
}

fieldset.aps-question {
	min-width: 0;
}

/* Float the legend so it sits inside the card instead of on its border. */
fieldset.aps-question > legend.aps-label {
	float: left;
}

fieldset.aps-question > legend.aps-label + * {
	clear: both;
}

.aps-label {
	display: block;
	font-weight: 600;
	margin-bottom: 10px;
	padding: 0;
	width: 100%;
}

.aps-desc {
	margin: -4px 0 10px;
	color: var(--aps-muted);
	font-size: 0.92em;
}

.aps-question input[type="text"],
.aps-question textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 8px 2px;
	border: 0;
	border-bottom: 1px solid var(--aps-border);
	border-radius: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	box-shadow: none;
}

.aps-question textarea {
	border: 1px solid var(--aps-border);
	border-radius: 4px;
	padding: 8px 10px;
	resize: vertical;
}

.aps-question input[type="text"]:focus,
.aps-question textarea:focus {
	outline: none;
	border-color: var(--aps-accent);
	box-shadow: 0 1px 0 0 var(--aps-accent);
}

.aps-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 6px 0;
	cursor: pointer;
	font-weight: normal;
}

.aps-option input[type="radio"],
.aps-option input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
	accent-color: var(--aps-accent);
	cursor: pointer;
}

.aps-option.aps-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.aps-other {
	align-items: center;
	flex-wrap: wrap;
}

.aps-other label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	margin: 0;
}

.aps-question .aps-other .aps-other-text {
	flex: 1 1 200px;
	width: auto;
	padding: 4px 2px;
}

.aps-error {
	display: none;
	margin: 10px 0 0;
	color: var(--aps-error);
	font-size: 0.9em;
}

.aps-has-error {
	border-color: var(--aps-error);
}

.aps-has-error .aps-error {
	display: block;
}

.aps-form-error {
	border-color: var(--aps-error);
	color: var(--aps-error);
}

.aps-thanks {
	border-left: 6px solid #1e8e3e;
}

.aps-closing p {
	margin: 0 0 8px;
}

.aps-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 18px 0 30px;
}

.aps-survey .aps-submit {
	background: var(--aps-accent);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 10px 28px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.aps-survey .aps-submit:hover,
.aps-survey .aps-submit:focus {
	filter: brightness(1.15);
}

.aps-survey .aps-clear {
	background: none;
	border: 0;
	color: var(--aps-accent);
	font: inherit;
	cursor: pointer;
	padding: 10px 4px;
}

.aps-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 600px) {
	.aps-card {
		padding: 18px 16px;
	}

	.aps-header h2 {
		font-size: 1.45em;
	}
}

/* ---------- Language helper ---------- */

/* Assyrian (Syriac script) only; Latin, Arabic etc. keep the theme's fonts.
   Adiabene draws its letters small, hence size-adjust. */
@font-face {
	font-family: 'APS East Syriac Adiabene';
	src: url('fonts/east-syriac-adiabene.ttf') format('truetype');
	unicode-range: U+0700-074F, U+0303-0304, U+0307-0308, U+0323-0324, U+0330-0331;
	size-adjust: 130%;
	font-display: swap;
}

.aps-lang-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 0 0 12px;
	padding: 12px 16px;
	background: var(--aps-accent-soft);
	border: 1px solid var(--aps-border);
	border-radius: 8px;
}

.aps-lang-bar label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: var(--aps-accent);
	margin: 0;
}

.aps-survey .aps-lang-select {
	flex: 1 1 220px;
	max-width: 320px;
	padding: 6px 8px;
	border: 1px solid var(--aps-border);
	border-radius: 4px;
	background: #fff;
	color: var(--aps-text);
	font: inherit;
	/* Adiabene only covers Syriac letters (unicode-range), the rest falls through. */
	font-family: 'APS East Syriac Adiabene', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.aps-tr {
	display: block;
	margin-top: 2px;
	color: var(--aps-muted);
	font-size: 0.9em;
	font-weight: normal;
	font-style: normal;
	line-height: 1.45;
	unicode-bidi: isolate;
}

.aps-tr[dir="rtl"] {
	text-align: right;
}

.aps-tr:lang(aii) {
	font-family: 'APS East Syriac Adiabene', 'Noto Sans Syriac Eastern', 'Noto Sans Syriac', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 1.1em;
}

.aps-tr:lang(ar),
.aps-tr:lang(fa) {
	font-size: 0.98em;
}

.aps-header h2 .aps-tr,
.aps-header h3 .aps-tr {
	font-size: 0.6em;
	margin-top: 4px;
}

.aps-label .aps-tr {
	font-size: 0.88em;
}

.aps-opt {
	display: block;
	min-width: 0;
}

.aps-survey button .aps-tr {
	color: inherit;
	opacity: 0.85;
	font-size: 0.8em;
}

.aps-error .aps-tr,
.aps-form-error .aps-tr {
	color: inherit;
	opacity: 0.85;
}

.aps-done-notice {
	border-left: 6px solid var(--aps-accent);
}

.aps-survey .aps-show-form {
	background: none;
	border: 1px solid var(--aps-accent);
	border-radius: 4px;
	color: var(--aps-accent);
	font: inherit;
	padding: 8px 16px;
	cursor: pointer;
}

.aps-survey [hidden] {
	display: none !important;
}

/* ---------- Country list ---------- */

.aps-survey .aps-question select {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--aps-border);
	border-radius: 4px;
	background: #fff;
	color: var(--aps-text);
	font: inherit;
}

.aps-survey .aps-question select:focus {
	outline: 2px solid var(--aps-accent);
	outline-offset: 1px;
	border-color: var(--aps-accent);
}

/* ---------- Mail link: always blue, whatever the theme says ---------- */

.aps-survey a.aps-mail,
.aps-survey a.aps-mail:visited {
	color: #0b57d0 !important;
	text-decoration: underline !important;
}

.aps-survey a.aps-mail:hover,
.aps-survey a.aps-mail:focus {
	color: #0842a0 !important;
}
