/* Cholet Énergie – Simulateur climatisation */
.csc {
	--csc-primary: #058cde;
	--csc-ink: #10293f;
	--csc-muted: #5b6f82;
	--csc-line: #d9e4ec;
	--csc-bg: #f4f8fb;
	--csc-soft: #e8f4fc;
	--csc-sun: #f4a52a;
	--csc-sun-soft: #fff4dc;
	--csc-danger: #c62f2f;
	color: var(--csc-ink);
	font-family: inherit;
	line-height: 1.5;
	max-width: 860px;
	margin: 0 auto;
}
@supports (color: color-mix(in srgb, red 10%, white)) {
	.csc { --csc-soft: color-mix(in srgb, var(--csc-primary) 9%, #ffffff); }
}
.csc *, .csc *::before, .csc *::after { box-sizing: border-box; }
/* Remise à zéro légère (sans priorité, pour ne pas écraser nos propres styles) */
.csc :where(button, input, select, textarea) {
	font: inherit; color: inherit; letter-spacing: normal; text-transform: none; margin: 0;
}
.csc :where(button) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.csc :where(h3, h4, p) { margin: 0; padding: 0; }
.csc :focus-visible { outline: 3px solid var(--csc-primary); outline-offset: 2px; }

/* En-tête */
.csc-head { text-align: center; margin-bottom: 28px; padding: 0 12px; }
.csc .csc-head__title { font-size: clamp(26px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--csc-ink); margin: 0 0 10px; padding: 0; }
.csc-head__intro { color: var(--csc-muted); max-width: 56ch; margin: 0 auto !important; font-size: 17px; }

/* Conteneur */
.csc-app {
	background: #ffffff;
	border: 1px solid var(--csc-line);
	border-radius: 24px;
	padding: clamp(18px, 4vw, 44px);
	box-shadow: 0 30px 60px -40px rgba(16, 41, 63, .45);
}

/* Barre du haut + progression (le petit toit reprend le logo) */
.csc-top { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.csc-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 6px 4px 0; color: var(--csc-muted); font-size: 15px; }
.csc-back:hover { color: var(--csc-primary); }
.csc-back .csc-ico { width: 18px; height: 18px; }
.csc-count { color: var(--csc-muted); font-size: 14px; text-align: right; }
.csc-count b { display: block; color: var(--csc-primary); font-size: 16px; font-weight: 800; }
.csc-progress { display: flex; gap: 6px; margin: 16px 0 36px; }
.csc-seg { flex: 1; height: 8px; border-radius: 99px; background: var(--csc-bg); position: relative; overflow: hidden; }
.csc-seg::after { content: ""; position: absolute; inset: 0; background: var(--csc-primary); border-radius: inherit; transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.3, .7, .2, 1); }
.csc-seg.is-done::after { transform: scaleX(1); }
.csc-seg.is-now::after { transform: scaleX(.5); animation: csc-pulse 1.4s ease-in-out infinite; }
@keyframes csc-pulse { 50% { opacity: .55; } }

/* Étapes */
.csc-step { max-width: 640px; margin: 0 auto; animation: csc-in .5s cubic-bezier(.34, 1.45, .64, 1); }
.csc-step--back { animation-name: csc-in-back; }
@keyframes csc-in { from { opacity: 0; transform: translateX(60px) rotate(1.5deg) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes csc-in-back { from { opacity: 0; transform: translateX(-60px) rotate(-1.5deg) scale(.96); } to { opacity: 1; transform: none; } }
.csc-step .csc-card, .csc-step .csc-tile, .csc-step .csc-dpe, .csc-step .csc-room { animation: csc-rise .45s cubic-bezier(.34, 1.45, .64, 1) backwards; }
.csc-step > :nth-child(3) .csc-card:nth-child(2), .csc-tile:nth-child(2), .csc-dpe:nth-child(2), .csc-room:nth-of-type(2) { animation-delay: .06s; }
.csc-step > :nth-child(3) .csc-card:nth-child(3), .csc-tile:nth-child(3), .csc-dpe:nth-child(3), .csc-room:nth-of-type(3) { animation-delay: .12s; }
.csc-tile:nth-child(4), .csc-dpe:nth-child(4) { animation-delay: .18s; } .csc-tile:nth-child(5), .csc-dpe:nth-child(5) { animation-delay: .24s; } .csc-tile:nth-child(6), .csc-dpe:nth-child(6) { animation-delay: .3s; } .csc-dpe:nth-child(7) { animation-delay: .36s; }
@keyframes csc-rise { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.csc-card.is-on .csc-card__ico, .csc-tile.is-on, .csc-chip.is-on { animation: csc-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.csc .csc-step__title { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 22px; color: var(--csc-ink); outline: none; }
.csc .csc-step__sub { color: var(--csc-muted); margin: -14px 0 22px; }
.csc .csc-label { font-weight: 700; margin: 26px 0 10px; }
.csc-ico { width: 24px; height: 24px; display: block; }

/* Cartes de choix */
.csc-cards { display: grid; gap: 14px; }
.csc-cards--2 { grid-template-columns: 1fr 1fr; }
.csc-card {
	display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left;
	background: #ffffff; border: 1.5px solid var(--csc-line); border-radius: 18px; padding: 20px;
	transition: border-color .15s, background-color .15s, transform .12s;
}
.csc-card--row { flex-direction: row; align-items: center; padding: 16px 18px; }
.csc-card:hover { border-color: var(--csc-primary); }
.csc-card:active { transform: scale(.98); }
.csc-card.is-on { border-color: var(--csc-primary); background: var(--csc-soft); }
.csc-card__ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--csc-bg); color: var(--csc-primary); transition: background-color .15s, color .15s; }
.csc-card.is-on .csc-card__ico { background: var(--csc-primary); color: #ffffff; }
.csc-card__txt { display: flex; flex-direction: column; gap: 3px; }
.csc-card__txt strong { font-size: 17px; font-weight: 700; }
.csc-card__txt span { color: var(--csc-muted); font-size: 15px; }

/* Puces */
.csc-chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.csc-chip {
	background: #ffffff; border: 1.5px solid var(--csc-line); border-radius: 12px; padding: 13px 10px;
	font-weight: 600; color: var(--csc-ink); transition: border-color .15s, background-color .15s;
}
.csc-chip:hover { border-color: var(--csc-primary); }
.csc-chip.is-on { border-color: var(--csc-primary); background: var(--csc-soft); color: var(--csc-primary); }

/* Nombre de pièces */
.csc-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.csc-tile {
	aspect-ratio: 1; background: #ffffff; border: 1.5px solid var(--csc-line); border-radius: 18px;
	font-size: 28px; font-weight: 800; color: var(--csc-ink); transition: border-color .15s, background-color .15s, transform .12s;
}
.csc-tile:hover { border-color: var(--csc-primary); }
.csc-tile:active { transform: scale(.95); }
.csc-tile.is-on { border-color: var(--csc-primary); background: var(--csc-primary); color: #ffffff; }

/* Pièces */
.csc-room { border: 1.5px solid var(--csc-line); border-radius: 18px; padding: 16px 18px 18px; margin: 0 0 14px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; min-width: 0; }
.csc-room legend { font-weight: 800; color: var(--csc-primary); padding: 0 6px; margin-left: -6px; display: flex; gap: 10px; align-items: center; }
.csc-room__vol { font-weight: 600; font-size: 13px; color: var(--csc-ink); background: var(--csc-soft); border-radius: 99px; padding: 2px 10px; }
.csc-room__vol:empty { display: none; }
.csc-in { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csc-in > span:first-child { font-size: 14px; color: var(--csc-muted); }
.csc-in--wide { grid-column: 1 / -1; margin-top: 18px; }
.csc-in input, .csc-in select, .csc-in textarea {
	width: 100%; min-height: 50px; background: #ffffff; border: 1.5px solid var(--csc-line); border-radius: 12px;
	padding: 10px 14px; font-size: 16px; color: var(--csc-ink); box-shadow: none;
}
.csc-in textarea { min-height: 90px; resize: vertical; }
.csc-in input:focus, .csc-in select:focus, .csc-in textarea:focus { border-color: var(--csc-primary); outline: none; }
.csc-in__unit { position: relative; display: block; }
.csc-in__unit input { padding-right: 44px; }
.csc-in__unit em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--csc-muted); pointer-events: none; }

/* DPE */
.csc-dpes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.csc-dpe { height: 58px; border: 0; border-radius: 12px; color: #ffffff; font-size: 22px; font-weight: 800; transition: transform .12s, box-shadow .15s; }
.csc-dpe:hover { transform: translateY(-2px); }
.csc-dpe.is-on { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--csc-ink); }
.csc-dpe--A { background: #00a651; } .csc-dpe--B { background: #50b848; } .csc-dpe--C { background: #a6c93c; }
.csc-dpe--D { background: #f2d600; color: var(--csc-ink); } .csc-dpe--E { background: #fbb33a; color: var(--csc-ink); }
.csc-dpe--F { background: #f07a26; } .csc-dpe--G { background: #e2322b; }
.csc-ghost { width: 100%; margin-top: 14px; background: #ffffff; border: 1.5px solid var(--csc-line); border-radius: 12px; padding: 15px; font-weight: 700; }
.csc-ghost:hover, .csc-ghost.is-on { border-color: var(--csc-primary); color: var(--csc-primary); background: var(--csc-soft); }

/* Interrupteur combles */
.csc-switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; border: 1.5px solid var(--csc-line); border-radius: 16px; padding: 16px 18px; cursor: pointer; }
.csc-switch span { display: flex; flex-direction: column; }
.csc-switch small { color: var(--csc-muted); font-size: 14px; }
.csc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.csc-switch i { flex: none; width: 54px; height: 32px; border-radius: 99px; background: var(--csc-line); position: relative; transition: background-color .2s; }
.csc-switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; transition: transform .2s; box-shadow: 0 1px 3px rgba(16, 41, 63, .3); }
.csc-switch input:checked + i { background: var(--csc-primary); }
.csc-switch input:checked + i::after { transform: translateX(22px); }
.csc-switch input:focus-visible + i { outline: 3px solid var(--csc-primary); outline-offset: 2px; }

/* Boutons */
.csc-btn {
	display: block; width: 100%; margin-top: 28px; min-height: 56px; border: 0; border-radius: 14px;
	background: var(--csc-primary); color: #ffffff; font-size: 17px; font-weight: 800; padding: 14px 20px;
	transition: filter .15s, transform .12s;
}
.csc-btn:hover { filter: brightness(1.08); }
.csc-btn:active { transform: scale(.99); }
.csc-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.csc-link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--csc-muted); text-decoration: underline; text-underline-offset: 3px; }
.csc-link:hover { color: var(--csc-primary); }

/* Calcul en cours */
.csc-wait { text-align: center; padding: 50px 0; color: var(--csc-muted); font-weight: 600; }
.csc-wait__roof { display: block; width: 56px; margin: 0 auto 12px; color: var(--csc-primary); animation: csc-bounce .7s ease-in-out infinite alternate; }
.csc-wait__roof svg { width: 56px; height: 40px; stroke-width: 2.4; }
@keyframes csc-bounce { to { transform: translateY(-8px); } }

/* Résultat */
.csc-step--resultat { max-width: 100%; }
.csc-total { background: var(--csc-ink); color: #ffffff; border-radius: 20px; padding: clamp(22px, 4vw, 34px); }
.csc-total__label { font-weight: 600; opacity: .8; }
.csc-total__from { font-size: .45em; font-weight: 600; opacity: .7; letter-spacing: 0; }
.csc-total__amount { font-size: clamp(32px, 6vw, 52px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 8px !important; font-variant-numeric: tabular-nums; }
.csc-total__amount small { font-size: .38em; font-weight: 700; margin-left: 8px; opacity: .75; letter-spacing: 0; }
.csc-total__sol { opacity: .85; }
.csc-tva { display: flex; align-items: center; gap: 18px; margin-top: 20px; background: #ffffff; color: var(--csc-ink); border-radius: 16px; padding: 14px 18px; border-left: 6px solid var(--csc-sun); }
.csc-tva p { font-weight: 600; margin: 0; }
.csc-tva__rates { flex: none; display: flex; align-items: center; gap: 6px; }
.csc-tva__rates s { color: var(--csc-muted); font-size: 18px; font-weight: 700; text-decoration-thickness: 2px; text-decoration-color: var(--csc-danger); }
.csc-tva__rates svg { width: 20px; height: 20px; color: var(--csc-sun); }
.csc-tva__rates b { background: var(--csc-sun); color: var(--csc-ink); font-size: 24px; font-weight: 800; border-radius: 10px; padding: 2px 10px; animation: csc-pop .6s .4s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@media (max-width: 640px) { .csc-tva { flex-direction: column; align-items: flex-start; gap: 8px; } }

.csc-result__grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.csc-box { border: 1.5px solid var(--csc-line); border-radius: 18px; padding: 18px 20px; min-width: 0; }
.csc-box h4 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.csc-scroll { overflow-x: auto; }
.csc-rooms { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; border: 0; }
.csc-rooms th { text-align: left; font-weight: 600; color: var(--csc-muted); font-size: 13px; padding: 0 8px 8px 0; border: 0; background: none; }
.csc-rooms td { padding: 10px 8px 10px 0; border: 0; border-top: 1px solid var(--csc-line); vertical-align: top; background: none; white-space: nowrap; }
.csc-rooms td small { display: block; color: var(--csc-muted); font-size: 13px; }
.csc-ext { margin-top: 12px !important; color: var(--csc-muted); font-size: 14px; }
.csc-lines { list-style: none; margin: 0; padding: 0; }
.csc-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; margin: 0; }
.csc-lines li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.csc-lines__sub { border-top: 1px solid var(--csc-line); font-weight: 700; }
.csc-lines__total { border-top: 2px solid var(--csc-ink); margin-top: 6px !important; padding-top: 10px !important; font-size: 18px !important; font-weight: 800; }
.csc-how { margin-top: 16px; border-radius: 14px; background: var(--csc-bg); padding: 14px 18px; }
.csc-how summary { cursor: pointer; font-weight: 700; }
.csc-how ul { margin: 10px 0 0 18px; padding: 0; color: var(--csc-muted); font-size: 15px; }
.csc-mention { color: var(--csc-muted); font-size: 13px; margin-top: 18px !important; text-align: center; }
.csc-study p { margin-bottom: 8px; }

/* Formulaire */
.csc-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.csc-form .csc-in { margin-top: 14px; }
.csc-form .csc-in--wide { margin-top: 14px; }
.csc-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: 14px; color: var(--csc-muted); cursor: pointer; }
.csc-check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--csc-primary); }
.csc-check a { color: var(--csc-primary); }
.csc-err { display: block; color: var(--csc-danger); font-style: normal; font-size: 14px; min-height: 0; }
.csc-err:empty { display: none; }
.csc-err--global { margin-top: 14px !important; font-weight: 600; }
.csc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Envoyé */
.csc-done { text-align: center; padding: 20px 0 10px; }
.csc-fly { position: relative; height: 96px; margin-bottom: 14px; }
.csc-fly__plane { position: absolute; left: 50%; top: 30px; width: 44px; height: 44px; margin-left: -22px; color: var(--csc-primary); animation: csc-plane 1.3s cubic-bezier(.5, 0, .7, .4) forwards; }
.csc-fly__plane svg { width: 44px; height: 44px; }
@keyframes csc-plane { 0% { transform: translate(-120px, 30px) rotate(-10deg) scale(.7); opacity: 0; } 25% { opacity: 1; } 60% { transform: translate(0, 0) rotate(0) scale(1); } 100% { transform: translate(260px, -90px) rotate(-20deg) scale(.5); opacity: 0; } }
.csc-done__ico { position: absolute; left: 50%; top: 10px; margin-left: -38px; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--csc-primary); color: #ffffff; animation: csc-pop .5s 1.1s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.csc-done p { margin-top: 8px !important; }
.csc-spam { background: var(--csc-sun-soft); color: #5d3a00; border-radius: 12px; padding: 10px 14px; max-width: 52ch !important; }
.csc-done__note { font-size: 14px; }
.csc-done__ico svg { width: 38px; height: 38px; stroke-width: 2.6; }
.csc-done p { color: var(--csc-muted); max-width: 46ch; margin: 0 auto; }
@keyframes csc-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Mobile */
@media (max-width: 640px) {
	.csc-cards--2 { grid-template-columns: 1fr; }
	.csc-card { flex-direction: row; align-items: center; }
	.csc-tiles { grid-template-columns: repeat(3, 1fr); }
	.csc-dpes { grid-template-columns: repeat(4, 1fr); }
	.csc-room { grid-template-columns: 1fr 1fr; }
	.csc-room .csc-in:first-of-type { grid-column: 1 / -1; }
	.csc-chips { grid-auto-flow: row; grid-template-columns: 1fr; }
	.csc-chips .csc-chip { text-align: left; padding-left: 16px; }
	.csc-result__grid, .csc-form__grid { grid-template-columns: 1fr; }
	.csc-rooms td, .csc-rooms th { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
	.csc *, .csc *::before, .csc *::after { animation: none !important; transition: none !important; }
}
