/*
 * AGA Member Surveys — member-facing survey.
 * Navy and gold by default (Surveys → Settings changes them). Scoped under .fhsv-survey.
 */

.fhsv-survey {
	--fh-bg: #0B1F3A;
	--fh-card: #12294A;
	--fh-card-2: #193457;
	--fh-border: #2A4A73;
	--fh-accent: #F2B705;
	--fh-light: #FFD24D;
	--fh-on-accent: #0B1F3A;
	--fh-cream: #F4F6FA;
	--fh-text: #E3E8F0;
	--fh-text-muted: #A9B6C8;
	--fh-red: #F08080;

	background: var(--fh-bg);
	color: var(--fh-text);
	font-family: 'Barlow', system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.55;
	border: 1px solid var(--fh-border);
	border-top: 4px solid var(--fh-accent);
	border-radius: 4px;
	max-width: 760px;
	margin: 0 auto;
	box-sizing: border-box;
}
.fhsv-survey *, .fhsv-survey *::before, .fhsv-survey *::after { box-sizing: border-box; }
.fhsv-survey-inner { padding: 44px 48px 40px; }

.fhsv-survey-eyebrow {
	display: block;
	font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
	font-size: 12px;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--fh-accent);
	margin-bottom: 8px;
}
.fhsv-survey .fhsv-survey-title {
	font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
	font-size: clamp(30px, 5vw, 40px);
	font-weight: 600;
	line-height: 1.15;
	color: var(--fh-cream);
	margin: 0 0 12px;
	outline: none;
}
.fhsv-survey-intro { font-size: 18px; margin: 0 0 8px; color: var(--fh-text); }
.fhsv-survey-meta { color: var(--fh-light); font-weight: 600; margin: 0 0 28px; }
.fhsv-survey-fine { font-size: 14px; color: var(--fh-text-muted); margin: 16px 0 0; }

/* Preview banner (staff only) */
.fhsv-preview {
	background: rgba(214, 161, 43, 0.15);
	border: 1px solid rgba(214, 161, 43, 0.45);
	color: #F2D27A;
	padding: 10px 14px;
	border-radius: 3px;
	font-size: 15px;
	margin-bottom: 22px;
}

/* Who's voting */
.fhsv-who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.fhsv-sfield { display: block; }
.fhsv-sfield span {
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fh-text-muted);
	margin-bottom: 6px;
}
.fhsv-sfield em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.fhsv-survey input[type="text"],
.fhsv-survey input[type="email"] {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	font: inherit;
	font-size: 17px;
	color: var(--fh-cream);
	background: var(--fh-card);
	border: 1px solid var(--fh-border);
	border-radius: 3px;
	margin: 0;
}
.fhsv-survey input:focus { outline: 2px solid var(--fh-light); outline-offset: 1px; border-color: var(--fh-light); }
.fhsv-survey input[aria-invalid="true"] { border-color: var(--fh-red); }
.fhsv-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.fhsv-serror {
	color: var(--fh-red);
	background: rgba(201, 69, 59, 0.12);
	border-left: 3px solid var(--fh-red);
	padding: 10px 14px;
	margin: 6px 0 18px;
	font-size: 16px;
}
.fhsv-serror[hidden] { display: none; }

/* Buttons */
.fhsv-sbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 26px;
	font-family: 'Barlow', system-ui, sans-serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 3px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.fhsv-sbtn:focus-visible { outline: 3px solid var(--fh-light); outline-offset: 2px; }
.fhsv-sbtn-accent { background: var(--fh-accent); color: var(--fh-on-accent); }
.fhsv-sbtn-accent:hover:not(:disabled) { background: var(--fh-light); transform: translateY(-1px); }
.fhsv-sbtn-ghost { background: transparent; color: var(--fh-text); border-color: var(--fh-border); }
.fhsv-sbtn-ghost:hover { border-color: var(--fh-light); color: var(--fh-cream); }
.fhsv-sbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.fhsv-sbtn-lg { min-width: 220px; }

/* Progress */
.fhsv-progress { height: 6px; background: var(--fh-card-2); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.fhsv-progress-bar { height: 100%; background: var(--fh-accent); border-radius: 3px; transition: width 0.35s ease; }
.fhsv-qcount {
	font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
	font-size: 12px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--fh-accent);
	margin: 0 0 14px;
}

/* Question */
.fhsv-qset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.fhsv-qset legend { padding: 0; margin-bottom: 20px; width: 100%; }
.fhsv-qtext {
	display: block;
	font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
	font-size: clamp(26px, 4.4vw, 34px);
	font-weight: 600;
	line-height: 1.2;
	color: var(--fh-cream);
	outline: none;
}
.fhsv-qhelp { display: block; margin-top: 8px; font-size: 16px; color: var(--fh-text-muted); }

.fhsv-opts-list { display: grid; gap: 10px; }
.fhsv-opts-list.is-tf { grid-template-columns: 1fr 1fr; }
.fhsv-opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 56px;
	padding: 12px 16px;
	background: var(--fh-card);
	border: 1px solid var(--fh-border);
	border-radius: 4px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	font-size: 18px;
	color: var(--fh-text);
}
.fhsv-opt:hover { border-color: var(--fh-light); }
.fhsv-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fhsv-opt-mark {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border: 2px solid var(--fh-text-muted);
	border-radius: 50%;
	display: grid;
	place-items: center;
}
.fhsv-opt input[type="checkbox"] + .fhsv-opt-mark { border-radius: 4px; }
.fhsv-opt.is-on, .fhsv-opt:has(input:checked) { border-color: var(--fh-accent); background: var(--fh-card-2); }
.fhsv-opt input:checked + .fhsv-opt-mark { border-color: var(--fh-accent); background: var(--fh-accent); }
.fhsv-opt input:checked + .fhsv-opt-mark::after {
	content: '';
	width: 6px;
	height: 11px;
	border: solid var(--fh-on-accent);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg) translate(-1px, -1px);
}
.fhsv-opt input:focus-visible + .fhsv-opt-mark { outline: 3px solid var(--fh-light); outline-offset: 3px; }
.fhsv-opt:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.fhsv-opt.is-tf { justify-content: center; font-weight: 700; font-size: 19px; min-height: 64px; }
.fhsv-pickcount { margin: 12px 0 0; color: var(--fh-light); font-weight: 600; font-size: 15px; }

.fhsv-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* Done */
.fhsv-survey-done { text-align: center; padding: 8px 0; }
.fhsv-done-icon {
	width: 64px; height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--fh-accent);
	color: var(--fh-on-accent);
	font-size: 32px;
	font-weight: 700;
	display: grid;
	place-items: center;
}

/* Results after voting */
.fhsv-sresults { margin-top: 32px; border-top: 1px solid var(--fh-border); padding-top: 24px; }
.fhsv-sresults h3 {
	font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fh-accent);
	margin: 0 0 18px;
	font-weight: 600;
}
.fhsv-sres-q { margin-bottom: 22px; }
.fhsv-sres-text { font-weight: 600; color: var(--fh-cream); margin: 0 0 8px; }
.fhsv-sres-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 15px; padding: 3px 0; }
.fhsv-sres-label em { color: var(--fh-light); font-style: normal; font-weight: 600; }
.fhsv-sres-track { height: 10px; background: var(--fh-card-2); border-radius: 0 3px 3px 0; overflow: hidden; }
.fhsv-sres-track span { display: block; height: 100%; background: var(--fh-accent); border-radius: 0 3px 3px 0; opacity: 0.7; }
.fhsv-sres-row.is-mine .fhsv-sres-track span { opacity: 1; }
.fhsv-sres-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--fh-text-muted); }

.fhsv-public-msg { padding: 12px 16px; border: 1px dashed #999; }

@media (max-width: 640px) {
	.fhsv-survey-inner { padding: 28px 20px 26px; }
	.fhsv-nav .fhsv-sbtn { flex: 1; padding-left: 12px; padding-right: 12px; }
	.fhsv-sbtn-lg { width: 100%; }
	.fhsv-opt { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
	.fhsv-progress-bar, .fhsv-sbtn, .fhsv-opt { transition: none; }
}

/* ─── Theme-proof text colors ──────────────────────────────
 * Many themes (and Elementor) color every label, span and paragraph on the page,
 * which can turn the survey text dark on the dark background. These rules keep
 * the survey readable whatever the theme does.
 */
.fhsv-survey,
.fhsv-survey p,
.fhsv-survey label,
.fhsv-survey legend,
.fhsv-survey fieldset { color: var(--fh-text) !important; }
.fhsv-survey .fhsv-opt,
.fhsv-survey .fhsv-opt-text,
.fhsv-survey .fhsv-opt span:not(.fhsv-opt-mark),
.fhsv-survey .fhsv-sres-label,
.fhsv-survey .fhsv-sres-text { color: #FFFFFF !important; }
.fhsv-survey .fhsv-survey-title,
.fhsv-survey h2,
.fhsv-survey h3:not(.fhsv-sresults h3),
.fhsv-survey .fhsv-qtext { color: #FFFFFF !important; }
.fhsv-survey .fhsv-survey-intro { color: var(--fh-text) !important; }
.fhsv-survey .fhsv-qhelp,
.fhsv-survey .fhsv-survey-fine,
.fhsv-survey .fhsv-sres-val,
.fhsv-survey .fhsv-sfield span { color: var(--fh-text-muted) !important; }
.fhsv-survey .fhsv-survey-eyebrow,
.fhsv-survey .fhsv-qcount,
.fhsv-survey .fhsv-sresults h3 { color: var(--fh-accent) !important; }
.fhsv-survey .fhsv-survey-meta,
.fhsv-survey .fhsv-pickcount,
.fhsv-survey .fhsv-sres-label em { color: var(--fh-light) !important; }
.fhsv-survey .fhsv-serror { color: var(--fh-red) !important; }
.fhsv-survey .fhsv-preview, .fhsv-survey .fhsv-preview strong { color: #F2D27A !important; }
.fhsv-survey input[type="text"],
.fhsv-survey input[type="email"] { color: #FFFFFF !important; background: var(--fh-card) !important; -webkit-text-fill-color: #FFFFFF; }
.fhsv-survey .fhsv-sbtn-accent { color: var(--fh-on-accent) !important; }
.fhsv-survey .fhsv-sbtn-ghost { color: var(--fh-text) !important; }
.fhsv-survey .fhsv-done-icon { color: var(--fh-on-accent) !important; }
