/* Tarificateur Coopérative — formulaire de proposition */
.tcpe-wrap { max-width: 900px; margin: 0 auto; font-size: 16px; color: #22272e; }

.tcpe-notice { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 15px; }
.tcpe-notice--succes { background: #e6f4ea; color: #1e6b3a; border: 1px solid #b6ddc2; }
.tcpe-notice--erreur { background: #fce8e6; color: #9a2f28; border: 1px solid #f0b8b2; }

.tcpe-section {
	border: 1px solid #dfe3e8;
	border-radius: 10px;
	padding: 10px 22px 22px;
	margin: 0 0 24px;
	background: #fff;
}
.tcpe-section > legend {
	font-weight: 700;
	font-size: 1.15rem;
	color: #1f3a5f;
	padding: 0 10px;
	letter-spacing: .2px;
}

.tcpe-grid {
	display: grid;
	grid-template-columns: repeat(100, minmax(0, 1fr));
	row-gap: 16px;
	column-gap: 0;
}
.tcpe-row { margin: 0; padding-right:12px; min-width:0; box-sizing:border-box; display: flex; flex-direction: column; grid-column: span var(--tcpe-col, 50); }
.tcpe-row--textarea { grid-column: span var(--tcpe-col, 100); }

/* Les champs gardent leur hauteur naturelle (compacte) et ne s'étirent pas :
   chaque cellule occupe le haut de sa ligne, sans espace perdu. */
.tcpe-grid { align-items: start; }
.tcpe-row { justify-content: flex-start; }
.tcpe-row > label,
.tcpe-row > .tcpe-caption { min-height: 1.05rem; }

/* Hauteur uniforme et compacte pour les contrôles sur une ligne. */
.tcpe-row input:not([type="checkbox"]):not([type="radio"]),
.tcpe-row select { height: 38px; }
.tcpe-row--checkbox .tcpe-check,
.tcpe-row--radio .tcpe-radios { min-height: 38px; }

/* Cases à cocher / boutons radio */
.tcpe-row--checkbox { justify-content: center; }
.tcpe-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #45505c; cursor: pointer; }
.tcpe-check input { width: auto; margin: 0; }
.tcpe-radios { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tcpe-radios label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: #22272e; }
.tcpe-radios input { width: auto; margin: 0; }
.tcpe-caption { font-size: .82rem; font-weight: 600; color: #45505c; margin-bottom: 6px; }

/* Champ « Nom » : Prénom + Nom côte à côte */
.tcpe-name { display: flex; gap: 10px; }
.tcpe-name input { flex: 1 1 50%; }
@media (max-width: 480px) { .tcpe-name { flex-direction: column; } }

.tcpe-row label {
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .02em;
	color: #45505c;
	margin-bottom: 6px;
}
.tcpe-req { color: #c0392b; }

.tcpe-row input,
.tcpe-row select,
.tcpe-row textarea {
	width: 100%;
	padding: 7px 11px;
	font-size: 1rem;
	line-height: 1.3;
	font-family: inherit;
	color: #22272e;
	border: 1px solid #cfd6dd;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tcpe-row textarea { min-height: 74px; resize: vertical; }
.tcpe-row select { cursor: pointer; }
.tcpe-row input:focus,
.tcpe-row select:focus,
.tcpe-row textarea:focus {
	outline: none;
	border-color: #1f3a5f;
	box-shadow: 0 0 0 3px rgba(31, 58, 95, .12);
}

/* Liste d'autocomplétion d'adresse (Google Places New) */
.tcpe-ac-list {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 9999;
	background: #fff;
	border: 1px solid #cfd6dd;
	border-top: none;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
	max-height: 260px;
	overflow-y: auto;
}
.tcpe-ac-item {
	padding: 10px 13px;
	cursor: pointer;
	font-size: .95rem;
	color: #22272e;
	border-bottom: 1px solid #f0f2f5;
}
.tcpe-ac-item:last-child { border-bottom: none; }
.tcpe-ac-item:hover,
.tcpe-ac-item.is-active { background: #eef4fb; }

/* Résultat d'admissibilité sous un champ Adresse */
.tcpe-adm-result { margin-top: 6px; font-size: .9rem; font-weight: 600; }
.tcpe-adm-result.is-ok { color: #1e6b3a; }
.tcpe-adm-result.is-no { color: #9a2f28; }

.tcpe-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tcpe-note { font-size: .85rem; color: #77808a; margin: 4px 0 16px; }

.tcpe-actions { margin-top: 8px; }
.tcpe-btn {
	display: inline-block;
	background: #e8871e;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 14px 34px;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: .03em;
	cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.tcpe-btn:hover { background: #cf7715; transform: translateY(-1px); }
.tcpe-btn[style]:hover { filter: brightness(.92); }
/* 2.2.126 — position du bouton Soumettre (réglage du formulaire). */
.tcpe-actions--center { text-align: center; }
.tcpe-actions--right { text-align: right; }
.tcpe-actions--full .tcpe-btn { display: block; width: 100%; }

/* Emplacements répétables */
.tcpe-emp-heading {
	font-size: 1.25rem;
	color: #1f3a5f;
	margin: 6px 0 14px;
	padding-bottom: 6px;
	border-bottom: 2px solid #1f3a5f;
}
.tcpe-emplacement {
	position: relative;
	border: 2px solid #d7dee6;
	border-left: 5px solid #e8871e;
	border-radius: 12px;
	padding: 6px 18px 18px;
	margin: 0 0 22px;
	background: #f7f9fb;
}
.tcpe-emp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 10px 4px 6px;
}
.tcpe-emp-head h3 {
	margin: 0;
	font-size: 1.1rem;
	color: #1f3a5f;
}
.tcpe-emp-remove {
	background: transparent;
	border: 1px solid #d7a29c;
	color: #a23a30;
	border-radius: 6px;
	padding: 6px 12px;
	font-size: .82rem;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.tcpe-emp-remove:hover { background: #a23a30; color: #fff; border-color: #a23a30; }

.tcpe-add-wrap { margin: 0 0 26px; }
.tcpe-btn--add {
	background: transparent;
	color: #1f3a5f;
	border: 2px dashed #1f3a5f;
	padding: 12px 26px;
}
.tcpe-btn--add:hover { background: #1f3a5f; color: #fff; transform: none; }

@media (max-width: 640px) {
	.tcpe-row, .tcpe-row--textarea { grid-column: 1 / -1; }
}

/* 2.2.103 — palette par formulaire et largeur publique réelle */
.tcpe-wrap .tcpe-section { border-color: var(--tcpe-border, #dfe3e8); }
.tcpe-wrap .tcpe-section > legend { color: var(--tcpe-section, #1f3a5f); }
.tcpe-wrap .tcpe-row label,
.tcpe-wrap .tcpe-caption,
.tcpe-wrap .tcpe-check,
.tcpe-wrap .tcpe-radios label { color: var(--tcpe-label, #45505c); }
.tcpe-wrap .tcpe-row input,
.tcpe-wrap .tcpe-row select,
.tcpe-wrap .tcpe-row textarea { color: var(--tcpe-value, #22272e); border-color: var(--tcpe-border, #cfd6dd); }
@media (max-width: 782px) { .tcpe-wrap { width:100% !important; max-width:100% !important; } .tcpe-form-heading { width:100% !important; max-width:100% !important; } }

.tcpe-row input:not([type=checkbox]):not([type=radio]),.tcpe-row select,.tcpe-row textarea{max-width:100%;min-width:0;box-sizing:border-box;}

/* 2.2.120 : centrage viewport indépendant du conteneur du thème + calendrier date. */
.tcpe-viewport-shell{width:100vw;max-width:100vw;position:relative;left:50%;margin-left:-50vw;box-sizing:border-box;}
.tcpe-viewport-shell>.tcpe-wrap,.tcpe-viewport-shell>.tcpe-form-heading{margin-left:auto!important;margin-right:auto!important;}
.tcpe-date-wrap{display:flex;align-items:stretch;width:100%;position:relative;}
.tcpe-date-wrap>input[data-tcpe-date]{flex:1 1 auto;min-width:0;border-radius:4px 0 0 4px!important;}
.tcpe-date-picker-btn{flex:0 0 42px;border:1px solid var(--tcpe-border,#cfd6dd);border-left:0;background:#fff;cursor:pointer;border-radius:0 4px 4px 0;font-size:18px;line-height:1;padding:0;}
.tcpe-date-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;right:0;bottom:0;}

/* 2.2.124 — Le réglage Titre visible contrôle aussi le titre résiduel de la première section. */
.tcpe-wrap.tcpe-hide-form-title .tcpe-form > .tcpe-section:first-of-type > legend{display:none!important;}

/* 2.2.135 — Boutons radio encadrés comme les autres champs. */
.tcpe-wrap .tcpe-row--radio .tcpe-radios {
  box-sizing: border-box; width: 100%; min-height: 38px;
  border: 1px solid #cbd5e1; border-radius: 6px; background: #fff;
  padding: 7px 11px; display: flex; align-items: center;
}
.tcpe-wrap .tcpe-row--radio .tcpe-radios:focus-within {
  border-color: #4c65e8; box-shadow: 0 0 0 2px rgba(76,101,232,.13);
}

/* 2.2.142 : « Ajouter … ? » compact, dans la case du champ (les champs restent côte à côte). */
.tcpe-form .tcpe-chain-more{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin-top:6px;font-size:12.5px;line-height:1.3}
.tcpe-form .tcpe-chain-more__q{font-weight:600;opacity:.85}
.tcpe-form .tcpe-chain-more label{display:inline-flex;align-items:center;gap:4px;margin:0;font-weight:400;cursor:pointer}
.tcpe-form .tcpe-chain-more input[type="radio"]{margin:0;width:auto;height:auto}

/* 2.2.150 : « Ajouter un autre ? » en popup; liens discrets. */
.tcpe-form .tcpe-chain-link{background:none;border:0;padding:0;margin:6px 12px 0 0;font-size:12.5px;color:#1d4f91;text-decoration:underline;cursor:pointer;box-shadow:none}
.tcpe-form .tcpe-chain-link:hover{color:#0b2743}
.tcpe-form .tcpe-chain-remove{color:#8a2424}
.tcpe-modal{position:fixed;inset:0;z-index:100000;display:none;align-items:center;justify-content:center;background:rgba(6,24,44,.45);padding:16px}
.tcpe-modal__box{background:#fff;border-radius:10px;box-shadow:0 18px 50px rgba(0,0,0,.3);padding:22px 24px;max-width:420px;width:100%;font-family:inherit}
.tcpe-modal__q{margin:0 0 18px;font-size:17px;font-weight:600;color:#0b2743;line-height:1.4}
.tcpe-modal__actions{display:flex;gap:10px;justify-content:flex-end}
.tcpe-modal__actions button{min-width:90px;padding:9px 16px;border-radius:6px;font-size:15px;font-weight:600;cursor:pointer;border:1px solid #0b2743}
.tcpe-modal__yes{background:#0b2743;color:#fff}
.tcpe-modal__no{background:#fff;color:#0b2743}

/* 2.2.154 : résultat calculé (lecture seule). */
.tcpe-form input.tcpe-calc{background:#f3f6f9;font-weight:600;cursor:default}

/* 2.2.159 — largeur responsive des formulaires (Étroit / Normal / Large / Pleine / px / %).
   Marge de 16 px de chaque côté de l'écran, pas de défilement horizontal causé par 100vw,
   et dans une fenêtre popup le formulaire suit la largeur de la fenêtre. */
.tcpe-viewport-shell{padding-left:16px;padding-right:16px;}
body:has(.tcpe-viewport-shell){overflow-x:clip;}
.as-modal .tcpe-viewport-shell{width:auto;max-width:100%;left:auto;margin-left:0;padding-left:0;padding-right:0;}
.tcpe-wrap,.tcpe-form-heading{box-sizing:border-box;}
@media (max-width: 480px) { .tcpe-viewport-shell{padding-left:10px;padding-right:10px;} }

/* 2.2.160 — textes au-dessus / sous le formulaire et boutons supplémentaires avec lien. */
.tcpe-text { margin: 0 0 22px; line-height: 1.6; overflow-wrap: anywhere; color: var(--tcpe-text-color, inherit); }
.tcpe-text a { color: inherit; text-decoration: underline; }
.tcpe-text--after { margin: 22px 0 0; }
.tcpe-text > :first-child { margin-top: 0; }
.tcpe-text > :last-child { margin-bottom: 0; }
.tcpe-text img { max-width: 100%; height: auto; }
.tcpe-xbtns { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 0 0 18px; }
.tcpe-xbtns--apres_soumettre, .tcpe-xbtns--bas { margin: 18px 0 0; }
.tcpe-xbtns.tcpe-actions--center { justify-content: center; }
.tcpe-xbtns.tcpe-actions--right { justify-content: flex-end; }
.tcpe-xbtns.tcpe-actions--full > .tcpe-xbtn { flex: 1 1 100%; text-align: center; }
.tcpe-actions--with-xbtns { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.tcpe-actions--with-xbtns.tcpe-actions--center { justify-content: center; }
.tcpe-actions--with-xbtns.tcpe-actions--right { justify-content: flex-end; }
.tcpe-actions--with-xbtns.tcpe-actions--full > * { flex: 1 1 100%; text-align: center; }
a.tcpe-xbtn { text-decoration: none; box-sizing: border-box; }
a.tcpe-xbtn--principal, a.tcpe-xbtn--principal:visited { color: #fff; }
.tcpe-xbtn--secondaire { display: inline-block; padding: 12px 30px; border: 2px solid #e8871e; border-radius: 6px; color: #e8871e; background: transparent; font-size: 1rem; font-weight: 600; letter-spacing: .03em; transition: background .15s ease, color .15s ease; }
.tcpe-xbtn--secondaire:hover, .tcpe-xbtn--secondaire:focus { background: #e8871e; color: #fff; }
.tcpe-xbtn--lien { color: #e8871e; font-weight: 600; text-decoration: underline !important; padding: 6px 2px; }
@media (max-width: 600px) {
	.tcpe-xbtns > .tcpe-xbtn--principal, .tcpe-xbtns > .tcpe-xbtn--secondaire,
	.tcpe-actions--with-xbtns > .tcpe-btn, .tcpe-actions--with-xbtns > .tcpe-xbtn--secondaire { flex: 1 1 100%; text-align: center; }
}

/* 2.2.161 — confirmation après l'envoi (texte et/ou lien), à la place du formulaire. */
.tcpe-confirmation { padding: 22px 24px; font-size: 16px; line-height: 1.55; }
.tcpe-confirmation p { margin: 0; }
.tcpe-confirmation p + p { margin-top: 16px; }
.tcpe-confirmation .tcpe-btn { text-decoration: none; color: #fff; }

/* 2.2.165 — formulaire en popup sur sa page (même présentation que « Vérifiez l'admissibilité »). */
html.tcpe-popup-lock, html.tcpe-popup-lock body { overflow: hidden !important; }
.tcpe-popup { display: none; position: fixed; inset: 0; z-index: 999990; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.tcpe-popup.is-open { display: flex; }
.tcpe-popup__overlay { position: absolute; inset: 0; background: rgba(4, 20, 36, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tcpe-popup__box { position: relative; z-index: 1; box-sizing: border-box; margin: auto; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid #d9e2ec; border-radius: 16px; box-shadow: 0 24px 80px rgba(4, 20, 36, .34); color: #33475b; font-size: 14px; line-height: 1.55; outline: none; }
.tcpe-popup__close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #0b2f50; font-size: 30px; line-height: 1; cursor: pointer; z-index: 2; }
.tcpe-popup__close:hover, .tcpe-popup__close:focus { color: #f5a623; }
.tcpe-popup__heading { display: flex; gap: 16px; align-items: flex-start; margin: 0 28px; padding: 26px 40px 18px 0; border-bottom: 1px solid #e3e8ee; }
.tcpe-popup__mark { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: #fdf0de; color: #e8871e; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.tcpe-popup__title { margin: 6px 0 10px; color: #0b2f50; font-size: 24px; font-weight: 700; line-height: 1.25; }
.tcpe-popup__subtitle { margin: 0; color: #40566b; font-size: 14px; }
.tcpe-popup__body { padding: 18px 28px 24px; }
/* Dans le popup, le formulaire suit la largeur de la fenêtre et garde un fond blanc. */
.tcpe-popup .tcpe-wrap { width: 100% !important; max-width: none !important; margin: 0 !important; --tcpe-text-color: #33475b; }
.tcpe-popup .tcpe-wrap .tcpe-row input:not([type=checkbox]):not([type=radio]), .tcpe-popup .tcpe-wrap .tcpe-row select, .tcpe-popup .tcpe-wrap .tcpe-row textarea { background: #f4f7fb; border: 1px solid #d3dde8; border-radius: 6px; }
.tcpe-popup .tcpe-wrap .tcpe-row label { font-weight: 700; color: #0b2f50; }
.tcpe-popup .tcpe-btn { text-transform: uppercase; letter-spacing: .04em; font-size: 14px; padding: 13px 22px; background: #f5a623; color: #0b2f50; border-radius: 4px; }
.tcpe-popup .tcpe-btn:hover { background: #e8951a; }
.tcpe-popup__privacy { display: flex; gap: 8px; align-items: center; padding: 12px 28px; background: #f3f6fa; border-top: 1px solid #e3e8ee; font-size: 12px; color: #40566b; border-radius: 0 0 16px 16px; }
.tcpe-popup__privacy a { color: #0b4f8a; text-decoration: underline; }
.tcpe-popup-reopen-wrap { margin: 24px 0; text-align: center; }
.tcpe-popup .tcpe-ac-list { z-index: 5; }
@media (max-width: 600px) {
	.tcpe-popup { padding: 0; align-items: stretch; }
	.tcpe-popup__box { max-width: 100% !important; width: 100% !important; max-height: 100vh; min-height: 100%; border-radius: 0; }
	.tcpe-popup__heading { margin: 0 16px; padding: 20px 40px 14px 0; gap: 12px; }
	.tcpe-popup__mark { width: 38px; height: 38px; font-size: 20px; }
	.tcpe-popup__title { font-size: 20px; }
	.tcpe-popup__body { padding: 14px 16px 20px; }
	.tcpe-popup__privacy { padding: 12px 16px; border-radius: 0; }
}
/* Dans le popup : pas de cadre autour des champs (la fenêtre sert de cadre); les titres de section restent. */
.tcpe-popup .tcpe-wrap .tcpe-section { border: 0; padding: 0; margin: 0 0 18px; background: transparent; box-shadow: none; }
.tcpe-popup .tcpe-wrap .tcpe-section > legend { padding: 0 0 6px; margin: 0 0 10px; width: 100%; border-bottom: 1px solid #e3e8ee; font-size: 15px; font-weight: 700; color: #0b2f50; }
.tcpe-popup-reopen[hidden] { display: none !important; }
/* 2.2.166 — dans le popup (fond blanc), les textes en couleur automatique sont foncés :
   la couleur automatique lue sur une page à fond foncé donnait du blanc sur blanc. */
.tcpe-popup .tcpe-text:not([style]) { color: #33475b; }
.tcpe-popup .tcpe-text a { color: #0b4f8a; }
/* 2.2.167 — texte enrichi sous le titre du popup. */
.tcpe-popup__subtitle p { margin: 0 0 6px; }
.tcpe-popup__subtitle > :last-child { margin-bottom: 0; }
