.convaincre-access-request {
	--conv-text: #17211c;
	--conv-muted: #5b655f;
	--conv-border: #d7ded9;
	--conv-surface: #ffffff;
	--conv-soft: #f4f7f5;
	--conv-primary: #5a197b;
	--conv-primary-hover: #43115e;
	--conv-focus: #16784c;
	max-width: 920px;
	margin: 0 auto;
	color: var(--conv-text);
}

.convaincre-access-form {
	display: grid;
	gap: 28px;
}

.convaincre-form-intro,
.convaincre-access-form fieldset {
	margin: 0;
	padding: 28px;
	border: 1px solid var(--conv-border);
	border-radius: 18px;
	background: var(--conv-surface);
	box-shadow: 0 10px 35px rgba(23, 33, 28, 0.055);
}

.convaincre-form-intro {
	padding-block: 20px;
	background: var(--conv-soft);
}

.convaincre-form-intro p,
.convaincre-form-submit p {
	margin: 0;
	color: var(--conv-muted);
}

.convaincre-access-form legend {
	padding: 0 10px;
	font-size: clamp(1.15rem, 2vw, 1.4rem);
	font-weight: 750;
	letter-spacing: -0.02em;
}

.convaincre-form-grid {
	display: grid;
	gap: 20px;
}

.convaincre-form-grid + .convaincre-form-grid,
.convaincre-form-grid + .convaincre-field,
.convaincre-field + .convaincre-form-grid,
.convaincre-field + .convaincre-field,
.convaincre-checkboxes {
	margin-top: 20px;
}

.convaincre-form-grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.convaincre-field {
	min-width: 0;
}

.convaincre-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 680;
	line-height: 1.35;
}

.convaincre-field label span[aria-hidden="true"] {
	color: #b42318;
}

.convaincre-field input,
.convaincre-field select,
.convaincre-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 50px;
	padding: 11px 13px;
	border: 1px solid #aeb9b2;
	border-radius: 10px;
	background: #fff;
	color: var(--conv-text);
	font: inherit;
	line-height: 1.4;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.convaincre-field textarea {
	min-height: 135px;
	resize: vertical;
}

.convaincre-field input:focus,
.convaincre-field select:focus,
.convaincre-field textarea:focus {
	outline: none;
	border-color: var(--conv-focus);
	box-shadow: 0 0 0 3px rgba(22, 120, 76, 0.15);
}

.convaincre-field-help {
	margin: 7px 0 0;
	color: var(--conv-muted);
	font-size: 0.9rem;
}

.convaincre-checkboxes {
	display: grid;
	gap: 13px;
}

.convaincre-checkboxes label {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
	line-height: 1.45;
}

.convaincre-checkboxes input {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--conv-primary);
}

.convaincre-form-submit {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 22px;
	align-items: center;
}

.convaincre-form-submit button {
	min-height: 52px;
	padding: 13px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--conv-primary);
	color: #fff;
	font: inherit;
	font-weight: 750;
	cursor: pointer;
	transition: background 120ms ease, transform 120ms ease;
}

.convaincre-form-submit button:hover {
	background: var(--conv-primary-hover);
	transform: translateY(-1px);
}

.convaincre-form-submit button:focus-visible {
	outline: 3px solid rgba(22, 120, 76, 0.35);
	outline-offset: 3px;
}

.convaincre-form-message {
	margin-bottom: 24px;
	padding: 16px 18px;
	border: 1px solid;
	border-radius: 12px;
}

.convaincre-form-message strong {
	display: block;
	margin-bottom: 3px;
}

.convaincre-form-message--success {
	border-color: #8ed0ad;
	background: #edf9f2;
	color: #145c38;
}

.convaincre-form-message--error {
	border-color: #efaaa3;
	background: #fff1f0;
	color: #8a1c14;
}

.convaincre-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

@media (max-width: 700px) {
	.convaincre-form-grid--2 {
		grid-template-columns: 1fr;
	}

	.convaincre-form-intro,
	.convaincre-access-form fieldset {
		padding: 21px;
		border-radius: 14px;
	}

	.convaincre-form-submit {
		align-items: stretch;
	}

	.convaincre-form-submit button {
		width: 100%;
	}
}


.convaincre-field select:disabled {
	cursor: wait;
	background: #f1f3f2;
	color: #727b76;
}

.convaincre-territory-manual[hidden] {
	display: none !important;
}

.convaincre-territory-manual:not([hidden]) {
	margin-top: 10px;
}

.convaincre-optional {
	color: var(--conv-muted);
	font-size: 0.88em;
	font-weight: 500;
}

.convaincre-field input[type="file"] {
	padding: 9px 11px;
}

.convaincre-field-label {
	display: block;
	margin-bottom: 10px;
	font-weight: 680;
	line-height: 1.35;
}

.convaincre-field-label > span[aria-hidden="true"] {
	color: #b42318;
}

.convaincre-choice-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.convaincre-choice-grid label {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
	min-height: 76px;
	margin: 0;
	padding: 15px;
	border: 1px solid var(--conv-border);
	border-radius: 12px;
	background: var(--conv-soft);
	font-weight: 650;
	line-height: 1.35;
	cursor: pointer;
}

.convaincre-choice-grid label:has(input:checked) {
	border-color: var(--conv-focus);
	box-shadow: 0 0 0 2px rgba(22, 120, 76, 0.12);
	background: #edf9f2;
}

.convaincre-choice-grid input {
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--conv-primary);
}

.convaincre-access-form fieldset[hidden] {
	display: none !important;
}

@media (max-width: 700px) {
	.convaincre-choice-grid {
		grid-template-columns: 1fr;
	}

	.convaincre-choice-grid label {
		min-height: 0;
	}
}

/* Recherche avec autocomplétion des communes, cantons et circonscriptions. */
.convaincre-autocomplete {
	position: relative;
}

.convaincre-autocomplete-options {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	max-height: 310px;
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--conv-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 38px rgba(23, 33, 28, 0.16);
}

.convaincre-autocomplete-options[hidden] {
	display: none !important;
}

.convaincre-autocomplete-option {
	display: block;
	width: 100%;
	padding: 11px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--conv-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.convaincre-autocomplete-option:hover,
.convaincre-autocomplete-option:focus,
.convaincre-autocomplete-option.is-active {
	outline: none;
	background: var(--conv-soft);
}

.convaincre-autocomplete-empty {
	padding: 12px;
	color: var(--conv-muted);
	font-size: 0.92rem;
}

#conv-territory-search::-webkit-search-cancel-button {
	cursor: pointer;
}

/* Cartes de situation configurables et explications contextuelles. */
.convaincre-choice-card {
	position: relative;
	min-height: 76px;
	border: 1px solid var(--conv-border);
	border-radius: 12px;
	background: var(--conv-soft);
	transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.convaincre-choice-grid .convaincre-choice-card > label {
	min-height: 0;
	padding: 15px 50px 15px 15px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	box-shadow: none;
}

.convaincre-choice-grid .convaincre-choice-card:has(input:checked) {
	border-color: var(--conv-focus);
	box-shadow: 0 0 0 2px rgba(22, 120, 76, 0.12);
	background: #edf9f2;
}

.convaincre-choice-grid .convaincre-choice-card > label:has(input:checked) {
	border-color: transparent;
	box-shadow: none;
	background: transparent;
}

.convaincre-choice-card--frozen {
	background: #f1f2f1;
	color: #68716c;
}

.convaincre-choice-card--frozen > label,
.convaincre-choice-card--frozen input {
	cursor: not-allowed;
}

.convaincre-choice-card--frozen input {
	opacity: 0.55;
}

.convaincre-choice-status {
	display: block;
	margin: -6px 15px 13px 45px;
	color: #7a4c00;
	font-size: 0.82rem;
	font-weight: 700;
}

.convaincre-choice-info {
	position: absolute;
	top: 13px;
	right: 13px;
	display: inline-grid;
	place-items: center;
	width: 25px;
	height: 25px;
	border: 1px solid #9ca8a1;
	border-radius: 999px;
	background: #fff;
	color: #445149;
	font-size: 0.86rem;
	font-weight: 800;
	font-style: normal;
	cursor: help;
}

.convaincre-choice-info:focus {
	outline: 3px solid rgba(22, 120, 76, 0.22);
	outline-offset: 2px;
}

.convaincre-choice-tooltip {
	display: none;
	position: absolute;
	z-index: 1200;
	top: calc(100% + 9px);
	right: -5px;
	width: min(330px, calc(100vw - 48px));
	padding: 12px 14px;
	border: 1px solid #bcc6c0;
	border-radius: 10px;
	background: #17211c;
	color: #fff;
	box-shadow: 0 14px 36px rgba(23, 33, 28, 0.22);
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
}

.convaincre-choice-info:hover .convaincre-choice-tooltip,
.convaincre-choice-info:focus .convaincre-choice-tooltip,
.convaincre-choice-card--frozen:hover .convaincre-choice-tooltip {
	display: block;
}

@media (max-width: 700px) {
	.convaincre-choice-card {
		min-height: 0;
	}

	.convaincre-choice-grid .convaincre-choice-card > label {
		padding-right: 48px;
	}
}

/* Sélecteur normalisé des organisations. */
.convaincre-autocomplete-option--proposal {
	margin-top: 6px;
	border-top: 1px solid var(--conv-border);
	border-radius: 0 0 8px 8px;
	font-weight: 700;
}

#conv-organization-proposal-field {
	margin-top: 14px;
	padding: 14px;
	border: 1px dashed var(--conv-border);
	border-radius: 12px;
	background: var(--conv-soft);
}


/* =========================================================
   CONVAINCRE — MODE SOMBRE
   Piloté par html[data-cv-theme="dark"]
   ========================================================= */

html[data-cv-theme="dark"] .convaincre-access-request {
  --conv-text: #f8f4fa;
  --conv-muted: #bcb1c1;
  --conv-border: #403449;
  --conv-surface: #211a27;
  --conv-soft: #28202f;
  --conv-primary: #7650a0;
  --conv-primary-hover: #8d63b7;
  --conv-focus: #5f7cf5;
  color-scheme: dark;
  color: var(--conv-text);
}

html[data-cv-theme="dark"] .convaincre-form-intro,
html[data-cv-theme="dark"] .convaincre-access-form fieldset {
  border-color: #403449;
  background: #211a27;
  color: #f8f4fa;
  box-shadow: 0 16px 42px rgba(5, 3, 7, .16);
}

html[data-cv-theme="dark"] .convaincre-form-intro {
  background:
    linear-gradient(
      135deg,
      rgba(118, 80, 160, .13),
      rgba(95, 124, 245, .06)
    );
}

html[data-cv-theme="dark"] .convaincre-form-intro p,
html[data-cv-theme="dark"] .convaincre-form-submit p,
html[data-cv-theme="dark"] .convaincre-field-help,
html[data-cv-theme="dark"] .convaincre-optional {
  color: #bcb1c1;
}

html[data-cv-theme="dark"] .convaincre-access-form legend,
html[data-cv-theme="dark"] .convaincre-field label,
html[data-cv-theme="dark"] .convaincre-field-label,
html[data-cv-theme="dark"] .convaincre-checkboxes label {
  color: #f8f4fa;
}

html[data-cv-theme="dark"] .convaincre-field input,
html[data-cv-theme="dark"] .convaincre-field select,
html[data-cv-theme="dark"] .convaincre-field textarea {
  border-color: #493b54;
  background: #18131d;
  color: #f8f4fa;
}

html[data-cv-theme="dark"] .convaincre-field input::placeholder,
html[data-cv-theme="dark"] .convaincre-field textarea::placeholder {
  color: #817687;
  opacity: 1;
}

html[data-cv-theme="dark"] .convaincre-field input:hover,
html[data-cv-theme="dark"] .convaincre-field select:hover,
html[data-cv-theme="dark"] .convaincre-field textarea:hover {
  border-color: #64506f;
}

html[data-cv-theme="dark"] .convaincre-field input:focus,
html[data-cv-theme="dark"] .convaincre-field select:focus,
html[data-cv-theme="dark"] .convaincre-field textarea:focus {
  border-color: #5f7cf5;
  box-shadow: 0 0 0 3px rgba(95, 124, 245, .16);
}

html[data-cv-theme="dark"] .convaincre-field select option {
  background: #211a27;
  color: #f8f4fa;
}

html[data-cv-theme="dark"] .convaincre-field input:disabled,
html[data-cv-theme="dark"] .convaincre-field select:disabled,
html[data-cv-theme="dark"] .convaincre-field textarea:disabled {
  background: #1c171f;
  color: #817987;
}

html[data-cv-theme="dark"] .convaincre-choice-grid label,
html[data-cv-theme="dark"] .convaincre-choice-card {
  border-color: #403449;
  background: #28202f;
  color: #f8f4fa;
}

html[data-cv-theme="dark"] .convaincre-choice-grid label > span,
html[data-cv-theme="dark"] .convaincre-choice-card label > span {
  color: #f8f4fa;
}

html[data-cv-theme="dark"] .convaincre-choice-card:hover {
  border-color: #5b4768;
  background: #2d2435;
}

html[data-cv-theme="dark"] .convaincre-choice-grid label:has(input:checked),
html[data-cv-theme="dark"] .convaincre-choice-grid .convaincre-choice-card:has(input:checked) {
  border-color: #7650a0;
  background: #352840;
  box-shadow: 0 0 0 2px rgba(118, 80, 160, .18);
}

html[data-cv-theme="dark"] .convaincre-choice-grid .convaincre-choice-card > label,
html[data-cv-theme="dark"] .convaincre-choice-grid .convaincre-choice-card > label:has(input:checked) {
  background: transparent;
  box-shadow: none;
}

html[data-cv-theme="dark"] .convaincre-choice-card--frozen {
  border-color: #332b38;
  background: #1c181e;
  color: #928994;
}

html[data-cv-theme="dark"] .convaincre-choice-card--frozen label > span {
  color: #928994;
}

html[data-cv-theme="dark"] .convaincre-choice-status {
  color: #e0b95f;
}

html[data-cv-theme="dark"] .convaincre-choice-info {
  border-color: #554360;
  background: #18131d;
  color: #b995d2;
}

html[data-cv-theme="dark"] .convaincre-choice-tooltip {
  border-color: #493b54;
  background: #151019;
  color: #e0d6e4;
  box-shadow: 0 16px 40px rgba(5, 3, 7, .4);
}

html[data-cv-theme="dark"] .convaincre-autocomplete-options {
  border-color: #493b54;
  background: #1d1723;
  box-shadow: 0 18px 42px rgba(5, 3, 7, .36);
}

html[data-cv-theme="dark"] .convaincre-autocomplete-option {
  color: #e4dbe7;
}

html[data-cv-theme="dark"] .convaincre-autocomplete-option:hover,
html[data-cv-theme="dark"] .convaincre-autocomplete-option:focus,
html[data-cv-theme="dark"] .convaincre-autocomplete-option.is-active {
  background: #33273d;
  color: #fff;
}

html[data-cv-theme="dark"] .convaincre-autocomplete-empty {
  color: #a99eae;
}

html[data-cv-theme="dark"] #conv-organization-proposal-field {
  border-color: #51405d;
  background: #241d2b;
}

html[data-cv-theme="dark"] .convaincre-field input[type="file"] {
  background: #18131d;
  color: #bcb1c1;
}

html[data-cv-theme="dark"] .convaincre-field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid #4c3c58;
  border-radius: 8px;
  background: #30263a;
  color: #f8f4fa;
  font: inherit;
  cursor: pointer;
}

html[data-cv-theme="dark"] .convaincre-field input[type="file"]::file-selector-button:hover {
  background: #392d45;
}

html[data-cv-theme="dark"] .convaincre-form-message--success {
  border-color: rgba(102, 194, 146, .28);
  background: #15251e;
  color: #91d9b1;
}

html[data-cv-theme="dark"] .convaincre-form-message--error {
  border-color: rgba(239, 106, 114, .30);
  background: #2d171d;
  color: #ff9da4;
}

html[data-cv-theme="dark"] .convaincre-form-message strong {
  color: inherit;
}

html[data-cv-theme="dark"] .convaincre-form-submit button {
  background: linear-gradient(135deg, #7650a0, #604083);
  color: #fff;
  box-shadow: 0 12px 28px rgba(63, 38, 81, .36);
}

html[data-cv-theme="dark"] .convaincre-form-submit button:hover {
  background: linear-gradient(135deg, #865db1, #6f4a95);
}
