/* Structural layout only — no color, spacing scale, or decoration here.
   That's intentionally left to the site's own theme CSS to define. */
.afgf-choices-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.afgf-choices-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.afgf-choices {
	display: flex;
	gap: 10px;
}

.afgf-choices--vertical {
	flex-direction: column;
}

.afgf-choices--horizontal {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px 20px;
}

.afgf-choice {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

/* Visually hide the native input but keep it in the accessibility tree and
   focusable, so keyboard/screen-reader behavior stays native. */
.afgf-choice-input {
	position: absolute;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	opacity: 0;
	cursor: pointer;
}

.afgf-choice-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding-left: 26px;
	cursor: pointer;
	line-height: 1.4;
}

/* Custom box drawn with ::before, positioned over the hidden native input */
.afgf-choice-label::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1px;
	width: 18px;
	height: 18px;
	background-color: #fff;
	border: 1px solid #ccc;
	box-sizing: border-box;
}

.afgf-choices--radio .afgf-choice-label::before {
	border-radius: 50%;
}

.afgf-choices--checkbox .afgf-choice-label::before {
	border-radius: 3px;
}

/* Checked state */
.afgf-choice-input:checked + .afgf-choice-label::before {
	background-color: #0073aa;
	border-color: #0073aa;
}

.afgf-choices--radio .afgf-choice-input:checked + .afgf-choice-label::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 7px;
	width: 6px;
	height: 6px;
	background-color: #fff;
	border-radius: 50%;
}

.afgf-choices--checkbox .afgf-choice-input:checked + .afgf-choice-label::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 3px;
	width: 5px;
	height: 9px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.afgf-choice-input:focus-visible + .afgf-choice-label::before {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Tooltip icon + click-to-toggle reveal (the .is-open class is toggled by
   site-scripts.js on .afgf-choice-tooltip__icon click/Enter/Space, and
   cleared on any click outside .afgf-choice-tooltip) — no SVG, so color,
   size, and shape are all plain CSS properties on .afgf-choice-tooltip__icon.
   Deliberately NOT :focus-within — a click's mousedown default action
   focuses the nearest focusable ancestor (.afgf-choice-tooltip itself,
   tabindex="0") before the click handler ever runs, so :focus-within stays
   true after the icon is clicked even once .is-open is toggled back off,
   making the bubble look stuck open on a second click. Keyboard access is
   handled by the same JS toggling .is-open on Enter/Space instead. */
.afgf-choice-tooltip {
	position: relative;
	display: inline-flex;
}

.afgf-choice-tooltip__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	font-size: 10px;
	font-style: normal;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background-color: #808191;
	border-radius: 50%;
	cursor: pointer;
}

/* The glyph itself lives here, not in the markup, so it can be overridden
   by targeting .afgf-choice-tooltip__icon::before and changing `content`. */
.afgf-choice-tooltip__icon::before {
	content: "i";
}

.afgf-choice-tooltip__bubble {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	z-index: 10;
	width: max-content;
	max-width: 220px;
	padding: 6px 10px;
	font-size: 12px;
	line-height: 1.4;
	color: #fff;
	background-color: #1f2937;
	border-radius: 4px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.afgf-choice-tooltip.is-open .afgf-choice-tooltip__bubble,
.afgf-choice-tooltip:hover .afgf-choice-tooltip__bubble {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Form editor only: lists each choice's label above the Tooltips textarea,
   numbered to match the line it corresponds to. */
.afgf-tooltips-choice-labels {
	margin-bottom: 4px;
	font-size: 11px;
	color: #808191;
}
