/**
 * Page « Réclamations » — Asonha (direction « Canopy », palette Bleu & Vert).
 *
 * Portage fidèle du prototype (classes ip-hero / ipr-* / ip-field →
 * cn-reclam-*). Réutilise les variables et utilitaires (.wrap, .kicker, .lede)
 * et les boutons (.btn*) de main.css. Style appliqué au front comme à l'aperçu
 * du bloc dans l'éditeur (SSR).
 *
 * Deux sections :
 *   1. héros en pleine largeur sur image assombrie ;
 *   2. corps en deux colonnes : encart de réassurance (collant) à gauche,
 *      choix du signalement + formulaire Contact Form 7 à droite.
 *
 * Les sélecteurs du formulaire ciblent le balisage produit par Contact Form 7
 * à partir des gabarits du thème (voir inc/reclamations-forms.php) : les
 * classes cn-reclam-* viennent du gabarit, les classes wpcf7-* de l'extension.
 */

/* La « feuille » Canopy enveloppe tout le contenu en `overflow:hidden`, ce qui
 * crée un conteneur de défilement et neutralise `position:sticky` des descendants.
 * Sur la page réclamations uniquement, on la repasse en `overflow:clip` : même
 * clipping (coins arrondis + débordement de l'image du héros) mais SANS conteneur
 * de défilement → l'encart de réassurance collant redevient fonctionnel.
 * Ciblé via :has() pour n'impacter que cette page (voir aussi carriere.css,
 * mission.css et histoire.css). */
.cn-sheet:has(.cn-reclam) { overflow: clip; }

/* NB : on ne recadre pas `.wrap` sur --maxw ici. Le prototype laisse
 * `.wrap { max-width: none }` : la largeur n'est bornée que par ses marges
 * latérales (clamp(20px,4vw,56px)). */

/* Les bascules d'onglet et d'étape passent par l'attribut « hidden » : les
 * règles d'affichage ci-dessous ne doivent jamais le contredire. */
.cn-reclam [hidden] { display: none !important; }

/* ================================ 1. Héros ============================== */

.cn-reclam-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: clamp(70px, 12vw, 140px) 0 clamp(48px, 7vw, 86px);
}

.cn-reclam-hero-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -2;
}

.cn-reclam-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(160deg, rgba(10, 28, 34, .5), rgba(10, 28, 34, .22));
}

/* Sans image choisie, le dégradé seul serait presque transparent : on pose un
 * aplat sombre de repli pour que le texte blanc reste lisible. */
.cn-reclam-hero:not(:has(.cn-reclam-hero-bg)) {
	background: var(--forest);
}

.cn-reclam-hero .wrap { position: relative; }

.cn-reclam-hero .kicker { color: #fff; }
.cn-reclam-hero .kicker::before { background: var(--lime); }

.cn-reclam-hero h1 {
	color: #fff;
	font-size: clamp(2.4rem, 5.2vw, 4rem);
	margin-top: 16px;
	max-width: 16ch;
}

.cn-reclam-hero .lede {
	color: rgba(255, 255, 255, .86);
	margin-top: 18px;
	max-width: 60ch;
}

/* ============================ 2. Deux colonnes ========================== */

/* Dans le prototype cette section repose sur le fond beige de la page. Ici le
 * contenu vit dans la « feuille » Canopy, blanche (.cn-sheet) : on teinte donc
 * explicitement, comme le fait déjà `.cn-legal-band` sur les pages légales. */
.cn-reclam-sec {
	padding: clamp(40px, 6vw, 76px) 0 clamp(56px, 8vw, 100px);
	background: var(--bg);
}

.cn-reclam-grid {
	display: grid;
	grid-template-columns: .72fr 1.28fr;
	gap: clamp(28px, 4vw, 56px);
	align-items: start;
}

/* ------------------------ Encart latéral (collant) ---------------------- */

/* Collé sous le haut de la fenêtre pendant que la colonne de droite (choix +
 * formulaire, bien plus haute) défile. La grille est en `align-items:start`,
 * donc l'encart garde sa hauteur naturelle et « voyage » dans la zone.
 * PRÉREQUIS : `.cn-sheet` doit être en `overflow:clip` (pas `hidden`), sinon il
 * crée un conteneur de défilement qui neutralise ce collage (voir haut de fichier). */
.cn-reclam-aside {
	position: sticky;
	top: 92px;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.cn-reclam-note {
	background: var(--forest);
	color: #eef3e9;
	border-radius: 22px;
	padding: clamp(24px, 3vw, 32px);
}

.cn-reclam-note-ic {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	border-radius: 15px;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .22);
	color: #fff;
}
.cn-reclam-note-ic svg { width: 28px; height: 28px; }

.cn-reclam-note b {
	display: block;
	color: #fff;
	font-family: var(--font-display);
	font-size: 1.2rem;
	letter-spacing: -.01em;
	margin-top: 16px;
}

.cn-reclam-note p {
	font-size: .94rem;
	line-height: 1.6;
	color: rgba(238, 243, 233, .82);
	margin-top: 10px;
}

.cn-reclam-reassure {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cn-reclam-reassure li {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 16px 18px;
}

.cn-reclam-rz-ic {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: color-mix(in srgb, var(--lime) 10%, transparent);
	color: var(--lime);
}
.cn-reclam-rz-ic svg { width: 20px; height: 20px; }

.cn-reclam-reassure b {
	display: block;
	font-size: .98rem;
	color: var(--ink);
}

.cn-reclam-reassure div span {
	display: block;
	font-size: .88rem;
	line-height: 1.5;
	color: var(--muted);
	margin-top: 3px;
}

/* ------------------------ Choix du type de signalement ------------------ */

.cn-reclam-pick { margin-bottom: 22px; }

.cn-reclam-pick-t {
	display: block;
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--lime);
	margin-bottom: 14px;
}

.cn-reclam-pick-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.cn-reclam-choice {
	display: block;
	text-align: left;
	cursor: pointer;
	font-family: var(--font-body);
	background: var(--surface);
	border: 1.5px solid var(--line);
	border-radius: 18px;
	padding: 22px 20px;
	transition: border-color .2s, transform .2s, box-shadow .2s;
}
.cn-reclam-choice:hover {
	transform: translateY(-2px);
	border-color: var(--lime);
}
.cn-reclam-choice.is-on {
	border-color: var(--lime);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 14%, transparent);
}
.cn-reclam-choice:focus-visible {
	outline: 2px solid var(--lime);
	outline-offset: 3px;
}

.cn-reclam-choice-ic {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: color-mix(in srgb, var(--lime) 10%, transparent);
	color: var(--lime);
}
.cn-reclam-choice-ic svg { width: 24px; height: 24px; }
.cn-reclam-choice.is-on .cn-reclam-choice-ic { background: var(--lime); color: #fff; }

.cn-reclam-choice b {
	display: block;
	font-size: 1.06rem;
	letter-spacing: -.01em;
	color: var(--ink);
	margin-top: 14px;
}

.cn-reclam-choice-d {
	display: block;
	font-size: .9rem;
	line-height: 1.5;
	color: var(--muted);
	margin-top: 6px;
}

/* ===================== 3. Carte de formulaire (panneau) ================= */

.cn-reclam-panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 24px;
	padding: clamp(26px, 3vw, 36px);
	box-shadow: 0 24px 60px -38px rgba(10, 24, 16, .5);
}
/* Deux panneaux ouverts (script indisponible) : on les sépare visuellement. */
.cn-reclam-panel + .cn-reclam-panel { margin-top: 22px; }

.cn-reclam-panel:focus-visible { outline: none; }

.cn-reclam-formhint {
	font-size: .9rem;
	color: var(--muted);
	background: var(--bg);
	border: 1px dashed var(--line);
	border-radius: 12px;
	padding: 16px 18px;
}

/* ------------------------------ Fil d'étapes ---------------------------- */

.cn-reclam-steps {
	display: flex;
	gap: 22px;
	flex-wrap: wrap;
}

.cn-reclam-step-mark {
	display: flex;
	align-items: center;
	gap: 10px;
	opacity: .45;
}
.cn-reclam-step-mark.is-on,
.cn-reclam-step-mark.is-done { opacity: 1; }

.cn-reclam-step-n {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: .86rem;
	background: var(--bg);
	border: 1px solid var(--line);
	color: var(--muted);
}
.cn-reclam-step-mark.is-on .cn-reclam-step-n {
	background: var(--lime);
	border-color: transparent;
	color: #fff;
}
.cn-reclam-step-mark.is-done .cn-reclam-step-n {
	background: var(--forest);
	border-color: transparent;
	color: #fff;
}

.cn-reclam-step-l {
	font-size: .94rem;
	font-weight: 600;
	color: var(--ink);
}

.cn-reclam-bar {
	height: 5px;
	border-radius: 99px;
	background: var(--bg);
	border: 1px solid var(--line);
	overflow: hidden;
	margin-top: 16px;
}
.cn-reclam-bar i {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--forest), var(--lime));
	transition: width .35s cubic-bezier(.2, .8, .2, 1);
}

/* Le fil d'étapes est injecté par le script : sans lui, la première étape ne
 * doit pas coller au haut de la carte. */
.cn-reclam-step { margin-top: 26px; }

/* ------------------------- Encadré « guide » (alerte) ------------------- */

.cn-reclam-guide {
	display: flex;
	flex-wrap: wrap;
	gap: 11px;
	align-items: flex-start;
	font-size: .9rem;
	line-height: 1.55;
	color: var(--ink-soft);
	background: color-mix(in srgb, var(--lime) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--lime) 34%, transparent);
	border-radius: 14px;
	padding: 14px 16px;
	margin-top: 26px;
}
/* Replacé sous la barre de progression par le script : la marge est alors
 * portée par l'étape qui suit. */
.cn-reclam-guide + .cn-reclam-step { margin-top: 20px; }

.cn-reclam-guide-txt {
	flex: 1;
	min-width: min(100%, 260px);
}

.cn-reclam-guide-dl {
	color: var(--forest);
	font-size: .86rem;
	padding: 10px 16px;
}
.cn-reclam-guide-dl:hover {
	background: color-mix(in srgb, var(--forest) 10%, transparent);
}
.cn-reclam-guide-dl svg { width: 16px; height: 16px; }

/* ============================== 4. Champs =============================== */

.cn-reclam-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 16px;
	align-items: start;
}
.cn-reclam-fields + .cn-reclam-fields { margin-top: 20px; }
.cn-reclam-field--full { grid-column: 1 / -1; }

.cn-reclam-field label {
	display: block;
	font-size: .84rem;
	font-weight: 600;
	color: var(--ink-soft);
	margin-bottom: 8px;
}
.cn-reclam-field label .req { color: var(--lime); }

/* Contact Form 7 enveloppe chaque contrôle : on force le wrap en bloc. */
.cn-reclam-field .wpcf7-form-control-wrap { display: block; }

.cn-reclam-field input,
.cn-reclam-field textarea,
.cn-reclam-field select {
	width: 100%;
	font-family: var(--font-body);
	font-size: .98rem;
	color: var(--ink);
	background: var(--bg);
	border: 1.5px solid var(--line);
	border-radius: 12px;
	padding: 13px 15px;
	transition: border-color .15s, box-shadow .15s;
}
.cn-reclam-field input::placeholder,
.cn-reclam-field textarea::placeholder { color: var(--muted); opacity: .7; }

.cn-reclam-field input:focus,
.cn-reclam-field textarea:focus,
.cn-reclam-field select:focus {
	outline: none;
	border-color: var(--lime);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 16%, transparent);
}

/* Contact Form 7 rend le textarea avec un attribut « rows » (10 par défaut),
 * qui lui donne une hauteur intrinsèque bien supérieure à la maquette ;
 * « min-height » seul ne la ramenait pas. */
.cn-reclam-field textarea {
	height: 130px;
	min-height: 130px;
	resize: vertical;
}

.cn-reclam-hint {
	font-size: .8rem;
	font-style: italic;
	color: var(--muted);
	line-height: 1.45;
	margin-top: 7px;
}

/* ---- Téléphone : indicatif + numéro dans une seule pilule ---- */

.cn-reclam-phone {
	display: flex;
	align-items: stretch;
	background: var(--bg);
	border: 1.5px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s;
}
.cn-reclam-phone:focus-within {
	border-color: var(--lime);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 16%, transparent);
}
.cn-reclam-phone .wpcf7-form-control-wrap:first-child { flex: none; }
.cn-reclam-phone .wpcf7-form-control-wrap:last-child { flex: 1; }
.cn-reclam-phone select,
.cn-reclam-phone input {
	border: none;
	border-radius: 0;
	background: transparent;
}
.cn-reclam-phone select {
	width: auto;
	min-width: 96px;
	font-weight: 600;
	border-right: 1.5px solid var(--line);
	padding-right: 30px;
}
.cn-reclam-phone select:focus,
.cn-reclam-phone input:focus { outline: none; box-shadow: none; }

/* ---- Date de l'incident : début + fin facultative ---- */

.cn-reclam-period {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
}
.cn-reclam-field .cn-reclam-period-l {
	font-size: .78rem;
	font-weight: 500;
	color: var(--muted);
	margin-bottom: 6px;
}

/* Champs date à la hauteur des champs texte : Chrome ajoute 2 px de marge
 * interne ; Safari iOS centre la valeur et écrase le champ tant qu'il est vide. */
.cn-reclam-field input[type="date"]::-webkit-datetime-edit,
.cn-reclam-field input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.cn-reclam-field input[type="date"]::-webkit-date-and-time-value {
	min-height: 1.2em;
	text-align: left;
}

/* ---- Pièces jointes : trois emplacements alignés ---- */

.cn-reclam-files {
	display: grid;
	gap: 10px;
}
.cn-reclam-files input[type="file"] {
	padding: 10px 12px;
	font-size: .9rem;
	cursor: pointer;
}
.cn-reclam-files input[type="file"]::file-selector-button {
	font-family: var(--font-body);
	font-size: .84rem;
	font-weight: 600;
	color: var(--ink-soft);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 7px 12px;
	margin-right: 12px;
	cursor: pointer;
}

/* ==================== 5. Mode « Contact » / « Anonyme » ================= */

.cn-reclam-mode { margin-bottom: 22px; }

/* Le prototype n'affiche pas d'intitulé au-dessus des deux pilules : le groupe
 * de boutons radio en a pourtant besoin pour être annoncé correctement. On le
 * conserve donc dans le balisage, masqué visuellement. Pour le rendre visible,
 * remplacer ce bloc par :
 *   display:block; font-size:.84rem; font-weight:600; color:var(--ink-soft); margin-bottom:10px; */
.cn-reclam-mode-l {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Boutons radio de Contact Form 7 présentés en pilules. */
.cn-reclam-mode .wpcf7-radio {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.cn-reclam-mode .wpcf7-list-item { margin: 0; }
.cn-reclam-mode .wpcf7-list-item label {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	margin: 0;
}
/* Le contrôle natif est retiré du flux sans être masqué pour les technologies
 * d'assistance (motif « screen-reader-text ») : le clic passe par le <label>,
 * et le focus clavier reste visible via la pilule ci-dessous. */
.cn-reclam-mode input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.cn-reclam-mode .wpcf7-list-item-label {
	display: inline-block;
	font-size: .92rem;
	font-weight: 600;
	color: var(--ink-soft);
	background: var(--bg);
	border: 1.5px solid var(--line);
	border-radius: 999px;
	padding: 11px 22px;
	transition: .2s;
}
.cn-reclam-mode .wpcf7-list-item label:hover .wpcf7-list-item-label {
	border-color: var(--lime);
}
.cn-reclam-mode input[type="radio"]:checked + .wpcf7-list-item-label {
	background: var(--lime);
	border-color: var(--lime);
	color: var(--on-accent);
}
.cn-reclam-mode input[type="radio"]:focus-visible + .wpcf7-list-item-label {
	outline: 2px solid var(--lime);
	outline-offset: 3px;
}
.cn-reclam-mode .cn-reclam-hint { margin-top: 10px; }

/* ======================= 6. Consentement & actions ===================== */

.cn-reclam-consent {
	font-size: .86rem;
	color: var(--muted);
	line-height: 1.5;
	margin: 24px 0 20px;
}
.cn-reclam-consent .wpcf7-list-item { margin: 0; }
.cn-reclam-consent label {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	font-weight: 400;
	margin: 0;
}
.cn-reclam-consent input[type="checkbox"] {
	margin-top: 3px;
	flex: none;
	width: 16px;
	height: 16px;
	accent-color: var(--lime);
}
.cn-reclam-consent a { color: var(--lime); font-weight: 600; }

.cn-reclam-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
	align-items: center;
}

/* Le bouton d'envoi de Contact Form 7 porte déjà .btn .btn-accent (classes
 * posées dans le gabarit) : seule la police du contrôle natif est à corriger.
 *
 * La flèche du prototype ne peut pas être un <svg> enfant — [submit] produit un
 * <input>, qui n'accepte ni enfant ni ::after. On la dessine donc en image de
 * fond, avec le même décalage au survol que `.btn .arrow`. */
.cn-reclam-actions .wpcf7-submit {
	font-family: var(--font-body);
	padding-right: 48px;
	background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"%3E%3Cpath d="M2 8h11M9 4l4 4-4 4" stroke="%23fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E');
	background-repeat: no-repeat;
	background-position: right 22px center;
	transition: transform .25s cubic-bezier(.2, .8, .2, 1), filter .2s, background-position .25s;
}
.cn-reclam-actions .wpcf7-submit:hover { background-position: right 19px center; }
/* Contact Form 7 désactive l'envoi tant que le consentement n'est pas coché. */
.cn-reclam-actions .wpcf7-submit:disabled { opacity: .55; cursor: not-allowed; }
.cn-reclam-actions .wpcf7-submit:disabled:hover { transform: none; }

/* Indicateur d'envoi de Contact Form 7. */
.cn-reclam-actions .wpcf7-spinner { margin: 0; }

/* ========================= 7. Retours Contact Form 7 =================== */

.cn-reclam-panel .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: .9rem;
}
.cn-reclam-panel .wpcf7-not-valid-tip {
	color: #c0392b;
	font-size: .8rem;
	margin-top: 6px;
}
.cn-reclam-panel .wpcf7-form-control.wpcf7-not-valid { border-color: #c0392b; }

/* ============================= 8. Responsive =========================== */

@media (max-width: 980px) {
	.cn-reclam-grid { grid-template-columns: 1fr; gap: 24px; }
	.cn-reclam-aside { position: static; }
}

@media (max-width: 720px) {
	.cn-reclam-fields { grid-template-columns: 1fr; }
	.cn-reclam-period { grid-template-columns: 1fr; }
	.cn-reclam-pick-grid { grid-template-columns: 1fr; }
	.cn-reclam-steps { gap: 14px; }
	.cn-reclam-actions .btn,
	.cn-reclam-actions .wpcf7-submit { width: 100%; justify-content: center; }
}
