/*
 * --sondage-label-color/--sondage-text-color/--sondage-bg-color are only set inline (per survey,
 * per context - see form.php) when their "Surcharger le style du theme" toggle is on. When it's
 * off, the var is absent and the "unset" fallback makes the rule a no-op so the theme's own CSS
 * decides - that's the whole point of the toggle, so don't add a hardcoded fallback color here.
 */
.sondage-form {
	max-width: 600px;
	margin: 0 auto;
	color: var(--sondage-text-color, unset) !important;
}

/* Only the inline form paints its own background; inside a popup the modal wrapper handles it
   (color or image) so the form stays transparent over it - see .sondage-modal-content below. */
.sondage-form-inline {
	background-color: var(--sondage-bg-color, unset) !important;
}

.sondage-form p,
.sondage-form h3,
.sondage-form .sondage-footer-message {
	color: var(--sondage-text-color, unset) !important;
}

.sondage-field {
	margin-bottom: 16px;
}

.sondage-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	color: var(--sondage-label-color, unset) !important;
}

.sondage-field input[type="text"],
.sondage-field input[type="email"],
.sondage-field select {
	width: 100%;
	padding: 6px 8px;
}

.sondage-consent label {
	font-weight: normal;
	display: flex;
	align-items: flex-start;
	gap: 6px;
}

.sondage-submit {
	padding: 10px 20px;
	cursor: pointer;
}

.sondage-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.sondage-form-messages.sondage-success {
	color: #1a7e3b;
}

.sondage-form-messages.sondage-error {
	color: #b32d2e;
}

.sondage-footer-message {
	font-size: 0.9em;
	color: #555;
}

.sondage-field-invalid {
	border: 1px solid #b32d2e !important;
	background-color: #fdf0f0;
}

.sondage-status-confirmed p:first-child {
	color: #1a7e3b;
}

.sondage-status-expired p:first-child,
.sondage-status-invalid p:first-child {
	color: #b32d2e;
}

.sondage-bar-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sondage-bar-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.sondage-bar-label {
	width: 160px;
	flex-shrink: 0;
}

.sondage-bar-track {
	flex-grow: 1;
	background: #eee;
	border-radius: 4px;
	height: 14px;
	overflow: hidden;
}

.sondage-bar-fill {
	display: block;
	height: 100%;
	background: #2271b1;
}

.sondage-bar-value {
	width: 60px;
	text-align: right;
}

.sondage-pie-chart {
	max-width: 360px;
	margin: 0 auto;
}

.sondage-popup-trigger {
	padding: 10px 18px;
	cursor: pointer;
}

.sondage-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.sondage-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.sondage-modal-content {
	position: relative;
	background-color: var(--sondage-popup-bg-color, unset) !important;
	background-image: var(--sondage-popup-bg-image, none) !important;
	background-size: cover;
	background-position: center;
	max-width: 640px;
	margin: 5vh auto;
	padding: 30px;
	border-radius: 6px;
	max-height: 90vh;
	overflow-y: auto;
}

.sondage-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
}
