/* Calculateur KILMA FUTURA — bordereau / devis technique.
   Palette : ardoise froide + un seul accent chaud (rouge chauffage), réservé au total/actions.
   Codes-références en monospace (vrais numéros de pièces). */

.cf-app {
	--cf-ink: #1b2430;
	--cf-ink-soft: #55627a;
	--cf-line: #dfe4ec;
	--cf-panel: #ffffff;
	--cf-bg: #f4f6f9;
	--cf-accent: #d1332e;
	--cf-accent-ink: #ffffff;
	--cf-chip-on: #1b2430;
	--cf-radius: 12px;
	--cf-mono: "SFMono-Regular", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

	box-sizing: border-box;
	max-width: 1120px;
	margin: 0 auto;
	color: var(--cf-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
}
.cf-app *, .cf-app *::before, .cf-app *::after { box-sizing: border-box; }

/* En-tête */
.cf-head { margin-bottom: 22px; }
.cf-eyebrow {
	display: inline-block;
	font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
	color: var(--cf-accent); font-weight: 700; margin-bottom: 6px;
}
.cf-title { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--cf-ink); }
.cf-sub { margin: 0; color: var(--cf-ink-soft); font-size: 14px; }

/* Grille */
.cf-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cf-grid { grid-template-columns: 1fr; } }

/* Panneaux */
.cf-form, .cf-result {
	background: var(--cf-panel);
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	padding: 20px;
}

/* Champs */
.cf-field { margin-bottom: 18px; }
.cf-field:last-child { margin-bottom: 0; }
.cf-field > label, .cf-legend {
	/*display: block;*/ font-size: 12px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--cf-ink-soft); margin-bottom: 8px;
}
.cf-hint {
	display: block; font-weight: 500; text-transform: none; letter-spacing: 0;
	font-size: 11px; color: var(--cf-ink-soft); opacity: .8; margin-top: 2px;
}

.cf-app input[type="text"], .cf-app input[type="number"] {
	width: 100%; padding: 11px 12px; border: 1px solid var(--cf-line); border-radius: 9px;
	font-size: 15px; color: var(--cf-ink); background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.cf-app input[type="text"]:focus, .cf-app input[type="number"]:focus {
	outline: none; border-color: var(--cf-accent); box-shadow: 0 0 0 3px rgba(209, 51, 46, .12);
}

.cf-input-unit { position: relative; }
.cf-input-unit input { padding-right: 42px; }
.cf-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--cf-ink-soft); pointer-events: none; }

/* Chips */
.cf-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-chip {
	appearance: none; cursor: pointer; border: 1px solid var(--cf-line); background: #fff;
	color: var(--cf-ink); padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1;
	transition: background .15s, border-color .15s, color .15s;
}
.cf-chip:hover { border-color: var(--cf-ink-soft); }
.cf-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(27, 36, 48, .18); }
.cf-chip[aria-pressed="true"] { background: var(--cf-chip-on); border-color: var(--cf-chip-on); color: #fff; }

/* Interrupteur ATEC */
.cf-switch-field { padding-top: 16px; border-top: 1px dashed var(--cf-line); }
.cf-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cf-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cf-slider { flex: 0 0 auto; width: 46px; height: 26px; background: #cbd2de; border-radius: 999px; position: relative; transition: background .18s; }
.cf-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #ff0000; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cf-switch input:checked + .cf-slider { background: var(--cf-accent); }
.cf-switch input:checked + .cf-slider::after { transform: translateX(20px); }
.cf-switch input:focus-visible + .cf-slider { box-shadow: 0 0 0 3px rgba(209,51,46,.25); }
.cf-switch-label { font-size: 14px; font-weight: 600; }
.cf-switch-label em { margin-top: 10px; display: block; font-style: normal; font-weight: 500; color: var(--cf-ink-soft); }

/* Résultat */
.cf-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cf-result-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.cf-badge { font-size: 12px; font-weight: 700; background: var(--cf-bg); color: var(--cf-ink-soft); padding: 4px 10px; border-radius: 999px; }
.cf-empty { background: var(--cf-bg); border: 1px dashed var(--cf-line); border-radius: 10px; padding: 20px; font-size: 14px; color: var(--cf-ink-soft); }

.cf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cf-table th {
	text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
	color: var(--cf-ink-soft); padding: 6px 8px; border-bottom: 2px solid var(--cf-line);
}
.cf-table td { padding: 9px 8px; border-bottom: 1px solid var(--cf-line); vertical-align: top; }
.cf-table tbody tr:last-child td { border-bottom: none; }
.cf-c-code { font-family: var(--cf-mono); font-size: 12.5px; white-space: nowrap; font-weight: 600; }
.cf-c-desc { color: var(--cf-ink); }
.cf-c-qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cf-c-unit { color: var(--cf-ink-soft); white-space: nowrap; }
.cf-c-pu, .cf-c-tot { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-c-tot { font-weight: 700; }
.cf-table thead th.cf-c-pu, .cf-table thead th.cf-c-tot { text-align: right; }

/* Colonnes prix masquées quand le devis n'affiche pas les prix */
.cf-app:not(.cf-has-prices) .cf-price-col { display: none; }

/* Pied de totaux */
.cf-tfoot td { border-top: 2px solid var(--cf-line); border-bottom: none; padding: 8px; text-align: right; font-size: 14px; }
.cf-tfoot .cf-row-ttc td { font-weight: 800; font-size: 16px; color: var(--cf-accent); }
.cf-tfoot .cf-row-ht td, .cf-tfoot .cf-row-tva td { color: var(--cf-ink-soft); }
.cf-tfoot .cf-row-ttc td { color: var(--cf-accent); }
.cf-tfoot .cf-total-ht, .cf-tfoot .cf-total-tva { color: var(--cf-ink); font-weight: 700; }

/* Actions */
.cf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cf-line); }
.cf-btn {
	appearance: none; cursor: pointer; border: 1px solid var(--cf-line); background: #fff; color: var(--cf-ink);
	padding: 10px 16px; border-radius: 9px; font-size: 14px; font-weight: 600;
	transition: background .15s, border-color .15s, color .15s;
}
.cf-btn:hover { border-color: var(--cf-ink-soft); }
.cf-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(27,36,48,.18); }
.cf-btn-primary { background: var(--cf-accent); border-color: var(--cf-accent); color: var(--cf-accent-ink); }
.cf-btn-primary:hover { background: #b82a26; border-color: #b82a26; }
.cf-btn-ghost { background: transparent; color: var(--cf-ink-soft); }

@media (prefers-reduced-motion: reduce) { .cf-app * { transition: none !important; } }
