/* ══════════════════════════════════════════════════════════════════
   CF7 TCL Styles — adapted from FormCraft form.css
   Targets: demarches.tcl.fr — Contact Form 7

   FormCraft → CF7 class mapping:
     .fc-form                     → .wpcf7
     .form-element-html input     → .wpcf7 .wpcf7-form-control.wpcf7-text/email/tel/date
     .submit-cover .submit-button → .wpcf7 .wpcf7-form-control.wpcf7-submit
     .checkbox-cover              → .wpcf7 .wpcf7-form-control.wpcf7-checkbox
     .checkbox-cover > div label  → .wpcf7 .wpcf7-list-item label
     .error                       → .wpcf7-not-valid-tip / .cf7v-error
     .final-success               → .cf7v-success

   Specificity strategy: all rules use .wpcf7 as parent prefix to get
   (0,2,0) vs CF7's own stylesheet (0,1,0) — avoids needing !important.
   Alternative: dequeue CF7's CSS in PHP (see CF7_load_validators.php).
   ══════════════════════════════════════════════════════════════════ */

/* ── Form container ───────────────────────────────────────────────── */
/* Source: .fc-form — background:#fff, box-shadow, border-radius:3px  */
.wpcf7 {
	background: #fff;
	box-shadow:
		0 0 0 0.5px rgba(0, 20, 40, 0.1),
		0 2px 8px 0 rgba(50, 55, 90, 0.2);
	border-radius: 3px;
	box-sizing: border-box;
	max-width: 100%;
	position: relative;
	font-family: Roboto, sans-serif;
}

/* Source: .form-page-content — padding: 1.5em */
.wpcf7 .wpcf7-form {
	padding: 1.5em;
	margin: 0 auto;
	text-align: left;
}
.hidden-fields-container fieldset {
	border: none !important;
}

/* ── Field wrappers — CF7 wraps each field in <p> ─────────────────── */
.wpcf7 .wpcf7-form > p,
.wpcf7 .wpcf7-form div > p {
	margin: 0 0 1.2em;
	position: relative;
}

/* ── Form control wrap (<span> → block so inputs fill width) ─────── */
.wpcf7 .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

/* ── Text / email / tel / date / number / select / textarea ─────────
   Source: .fc-form .form-element .form-element-html input[type="text"] etc.
     padding: 0.72em 0.9em 0.65em  |  border: 1px solid #d6d8d9
     background: #fafafa  |  border-radius: 2px
   ─────────────────────────────────────────────────────────────────── */
.wpcf7 .wpcf7-form-control.wpcf7-text,
.wpcf7 .wpcf7-form-control.wpcf7-email,
.wpcf7 .wpcf7-form-control.wpcf7-tel,
.wpcf7 .wpcf7-form-control.wpcf7-date,
.wpcf7 .wpcf7-form-control.wpcf7-number,
.wpcf7 .wpcf7-form-control.wpcf7-select,
.wpcf7 .wpcf7-form-control.wpcf7-textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	padding: 0.72em 0.9em 0.65em;
	border-radius: 2px;
	border: 1px solid #d6d8d9;
	background-color: #fafafa;
	line-height: 1.4em;
	font-family: Roboto, sans-serif;
	font-size: inherit;
	height: auto;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	background-image: none !important;
}

.wpcf7 .wpcf7-form-control.wpcf7-text:focus,
.wpcf7 .wpcf7-form-control.wpcf7-email:focus,
.wpcf7 .wpcf7-form-control.wpcf7-tel:focus,
.wpcf7 .wpcf7-form-control.wpcf7-date:focus,
.wpcf7 .wpcf7-form-control.wpcf7-number:focus,
.wpcf7 .wpcf7-form-control.wpcf7-select:focus,
.wpcf7 .wpcf7-form-control.wpcf7-textarea:focus {
	outline: none;
	border-color: #aaa;
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(0, 20, 40, 0.06);
}

/* ── Read-only (campagne field locked by snippet JS) ──────────────── */
/* Source: .form-element input.is-read-only — opacity: 0.75 */
.wpcf7 .wpcf7-form-control[readonly] {
	opacity: 0.75;
	cursor: not-allowed;
	background-color: #f5f5f5;
	color: #888;
}

/* ── Placeholders ─────────────────────────────────────────────────── */
.wpcf7 .wpcf7-form input::placeholder,
.wpcf7 .wpcf7-form textarea::placeholder {
	color: #b0aeaa;
	opacity: 1;
	font-style: italic;
}

.wpcf7 .wpcf7-form input::-moz-placeholder,
.wpcf7 .wpcf7-form textarea::-moz-placeholder {
	color: #b0aeaa;
	opacity: 1;
}

/* ── File input ───────────────────────────────────────────────────── */
/* Source: .fileupload-cover.field-cover .button-file — border-radius:2px */
.wpcf7 .wpcf7-form-control.wpcf7-file.upload-input {
	display: block;
	width: 100%;
	padding: 0.55em 0.9em;
	border: 1px solid #d6d8d9;
	border-radius: 2px;
	background-color: #f0f0f0red;
	font-family: Roboto, sans-serif;
	font-size: inherit;
	cursor: pointer;
	box-sizing: border-box;
}

.wpcf7 .wpcf7-form-control.wpcf7-file.upload-input:hover {
	border-color: #aaa;
	background-color: #f0f0f0;
}

/* ── Radio & checkbox groups ──────────────────────────────────────── */
/* Source: .checkbox-cover > div — padding-top:5px, padding-bottom:4px */
.wpcf7 .wpcf7-form-control.wpcf7-radio,
.wpcf7 .wpcf7-form-control.wpcf7-checkbox,
.wpcf7 .wpcf7-form-control.wpcf7-acceptance {
	display: block;
	padding-top: 4px;
	padding-bottom: 4px;
}

.wpcf7 .wpcf7-list-item {
	display: inline-block;
	margin-right: 1.2em;
	margin-bottom: 4px;
}

/* Source: .checkbox-cover > div label — padding:0.3em 10px 0.3em 0, font-size:0.95em */
.wpcf7 .wpcf7-list-item label {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.3em 0;
	cursor: pointer;
	font-size: 0.95em;
}

/* Source: .checkbox-cover > div label input — margin-right:0.35em, vertical-align:middle */
.wpcf7 .wpcf7-list-item input[type="radio"],
.wpcf7 .wpcf7-list-item input[type="checkbox"] {
	position: relative;
	opacity: 1;
	margin: 0;
	vertical-align: middle;
	display: inline-block !important;
	flex-shrink: 0;
}

.wpcf7 .wpcf7-list-item-label {
	vertical-align: middle;
}

/* ── Acceptance (RGPD) — full-width single item ───────────────────── */
.wpcf7 .wpcf7-form-control.wpcf7-acceptance .wpcf7-list-item {
	display: block;
	margin-right: 0;
}

.wpcf7 .wpcf7-form-control.wpcf7-acceptance .wpcf7-list-item label {
	align-items: flex-start;
	font-size: 0.9em;
	color: #555;
	line-height: 1.5;
}

/* Source: .checkbox-cover > div label a — color: #48e */
.wpcf7 .wpcf7-form-control.wpcf7-acceptance a {
	color: #48e;
}

.wpcf7 .wpcf7-form-control.wpcf7-acceptance a:hover {
	text-decoration: underline;
}

/* ── Submit button ────────────────────────────────────────────────── */
/* Source: .submit-cover .submit-button
     padding:9px 18px  |  border-radius:2px  |  font-weight:600
     border:0  |  cursor:pointer  |  transition:padding 0.25s          */
.wpcf7 .wpcf7-form-control.wpcf7-submit {
	border: 0;
	border-radius: 2px;
	padding: 9px 18px;
	font-size: 1em;
	font-family: Roboto, sans-serif;
	font-weight: 600;
	line-height: 1.5em;
	cursor: pointer;
	white-space: nowrap;
	background-color: #d22c58;
	color: #fff;
	box-shadow: none;
	display: inline-block;
	transition:
		background 0.2s,
		box-shadow 0.25s;
	-webkit-transition:
		background 0.2s,
		box-shadow 0.25s;
}

/* Source: .submit-button:hover — box-shadow:0 0 100px rgba(50,50,50,0.08) inset */
.wpcf7 .wpcf7-form-control.wpcf7-submit:hover {
	background-color: #a8002e;
	box-shadow: 0 0 100px rgba(50, 50, 50, 0.08) inset;
}

/* Source: .submit-cover.disabled .submit-button — opacity:0.75 */
.wpcf7 .wpcf7-form-control.wpcf7-submit:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}

/* ── Form response output ─────────────────────────────────────────── */
.wpcf7 .wpcf7-response-output {
	display: none;
	margin: 1em 0 0;
	padding: 0.75em 1em;
	border-radius: 3px;
	font-size: 0.9em;
	line-height: 1.5;
}

.wpcf7 .wpcf7-form.invalid .wpcf7-response-output,
.wpcf7 .wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7 .wpcf7-form.failed .wpcf7-response-output {
	display: block;
	border: 1px solid #d22c58;
	background: #fff5f7;
	color: #a8002e;
}

.wpcf7 .wpcf7-form.sent .wpcf7-response-output {
	display: block;
	border: 1px solid #1d9e75;
	background: #f0faf6;
	color: #155c42;
}

/* ── Validation error states ──────────────────────────────────────── */
/* Source: .form-element.error-field input — border-color: red        */
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > input,
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > textarea,
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > select {
	border: 2px solid #d22c58 !important;
	background-color: #fff5f7 !important;
	outline: none !important;
}

.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > input:focus,
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > textarea:focus {
	box-shadow: 0 0 0 3px rgba(210, 44, 88, 0.15) !important;
}

.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > input[type="file"] {
	border: 2px solid #d22c58 !important;
	border-radius: 4px;
	padding: 4px 6px;
	background: #fff5f7 !important;
}

.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > .wpcf7-acceptance,
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > .wpcf7-checkbox,
.wpcf7 .wpcf7-form-control-wrap.wpcf7-not-valid > .wpcf7-radio {
	display: block;
	border: 2px solid #d22c58 !important;
	border-radius: 4px;
	padding: 4px 8px;
	background-color: #fff5f7 !important;
}

/* Source: .form-element .error — color:red, font-size:0.85em */
.wpcf7-not-valid-tip,
.cf7v-error {
	color: #d22c58 !important;
	font-size: 12px !important;
	margin-top: 4px;
	display: block;
}

.cf7v-error-banner {
	background: #fff5f7;
	border: 2px solid #d22c58;
	border-radius: 6px;
	color: #a8002e;
	font-size: 14px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

/* ── Success screen ───────────────────────────────────────────────── */
/* Source: .fc-form .final-success — text-align:center, padding:40px 30px */
.cf7v-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 72px 48px;
	text-align: center;
	background: #fff;
	border-radius: 12px;
	border: 2px solid #d22c58;
	margin: 20px 0;
	animation: cf7v-in 0.4s ease;
}

@keyframes cf7v-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Source: .final-success-check — border:2px solid #1daa1d, border-radius:100% */
.cf7v-success__icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 3px solid #d22c58;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	color: #d22c58;
	margin-bottom: 24px;
}

.cf7v-success__title {
	font-size: 28px;
	font-weight: 700;
	color: #d22c58;
	margin: 0 0 16px;
}

.cf7v-success__message {
	font-size: 18px;
	color: #333;
	margin: 0 0 28px;
	max-width: 520px;
	line-height: 1.7;
}

.cf7v-success__btn {
	display: inline-block;
	padding: 12px 28px;
	background: #d22c58;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
}

.cf7v-success__btn:hover {
	background: #a8002e;
}

/* ── Conditional message block (carte TCL warning) ────────────────── */
#message-carte-tcl {
	background: #fff5f7;
	border: 1px solid #d22c58;
	border-radius: 3px;
	padding: 0.75em 1em;
	color: #a8002e;
	font-size: 0.95em;
	margin: 0.5em 0 1em;
}
.message-conditional {
	background: #fff5f7;
	border: 1px solid #d22c58;
	border-radius: 3px;
	padding: 0.75em 1em;
	color: #a8002e;
	font-size: 0.95em;
	margin: 0.5em 0 1em;
}

/* ── Tarif message block ──────────────────────────────────────────── */
.message-tarif {
	border: 2px solid red;
	padding: 8px;
	margin: 0.5em 0 1em;
}

/* ── Partenaire / carte info message (blue informational banner) ─────
   Usage pattern: same as .indicateur-justif-requis (see below) but for
   informational messages (blue palette) that are shown/hidden by JS.
   1. HTML: class="message-partenaire" style="display:none"
   2. JS:   el.style.display = '' to show, 'none' to hide
   Visual styles belong here; only display toggling goes in JS/HTML.
   ─────────────────────────────────────────────────────────────────── */
.message-partenaire {
	display: inline-block;
	border: 2px solid #2196F3;
	border-radius: 3px;
	padding: 8px 12px;
	color: #1565C0;
	background: #e8f4fd;
	margin: 4px 0 8px;
	font-size: 0.95em;
}

/* ── Client-side submit-block error output ───────────────────────────
   Applies when our custom JS calls e.preventDefault() before CF7 runs
   (e.g. no justif file uploaded). CF7 never adds .invalid to the form,
   so the normal .wpcf7-form.invalid rule does not fire. We set
   style.display='block' via JS to override the base display:none rule,
   and this class provides the error colour/border.
   ─────────────────────────────────────────────────────────────────── */
.wpcf7 .wpcf7-response-output.wpcf7-validation-errors {
	border: 1px solid #d22c58;
	background: #fff5f7;
	color: #a8002e;
}

/* ── Indicateur justificatif obligatoire ──────────────────────────────
   Usage pattern for conditional required-file indicators:
   1. In the form HTML, add the element with this class + style="display:none"
      inside the conditional parent bloc (which starts hidden via display:none).
      The element is hidden by the parent on page load; no extra JS needed.
      Example:
        <div class="indicateur-justif-requis" id="indicateur_justif_xxx"
             style="display:none">Au moins un justificatif obligatoire.</div>
   2. In the snippet JS, only manage display — never overwrite style attr:
        el.style.display = hasFile(FILE_NAMES) ? 'none' : '';
      - When parent bloc becomes visible (via CF7V conditional), the indicator
        shows automatically (display:'') unless a file is already uploaded.
      - Setting style.display='' removes only the display property; all other
        inline styles and CSS class rules are preserved.
   3. Do NOT check which abonnement is selected in updateJustifIndicator —
      that logic belongs to the parent bloc's visibility (CONDITIONAL_CONFIG).
   ─────────────────────────────────────────────────────────────────── */
.indicateur-justif-requis {
	border: 2px solid #d22c58;
	border-radius: 3px;
	padding: 8px 12px;
	color: #a8002e;
	background: #fff5f7;
	margin-bottom: 8px;
	font-size: 0.95em;
}

/* ── Sub-label (helper text in parentheses) ───────────────────────── */
.sub-label {
	font-size: 0.7em;
	color: #777;
}

/* ── Honeypot — always hidden ─────────────────────────────────────── */
.wpcf7 .wpcf7-form-control-wrap[class*="honeypot"] {
	display: none !important;
	visibility: hidden !important;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.wpcf7 .wpcf7-form {
		padding: 1em;
	}

	.cf7v-success {
		padding: 40px 20px;
	}

	.wpcf7 .wpcf7-list-item {
		display: block;
		margin-right: 0;
	}

	.wpcf7 .wpcf7-form-control.wpcf7-submit {
		display: block;
		width: 100%;
		box-sizing: border-box;
		white-space: normal;
		text-align: center;
	}
	
}

