/* Calculateur du coût administratif. Mêmes valeurs que la landing
   (CHANTIER) : le formulaire sur papier, le résultat sur graphite, comme
   la file du soir. */

.calc-hero { padding: 48px 0 44px; }
.calc-hero h1 { max-width: 16ch; }

/* ---------- mise en page ---------- */
.calc-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 48px; align-items: start; padding-top: 48px; padding-bottom: 88px;
}
@media (max-width: 960px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; padding-bottom: 96px; }
}

/* ---------- formulaire ---------- */
.calc-form { display: grid; gap: 40px; min-width: 0; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step legend {
  display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 0 0 12px; margin-bottom: 18px;
  font-family: var(--display); font-weight: 700; font-size: 1.9rem; line-height: 1; border-bottom: 2px solid var(--encre);
}
.step-n { font-size: 1.1em; color: var(--ocre); min-width: .8em; }
.step-lede { color: var(--encre-2); margin-bottom: 18px; max-width: 42em; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field[hidden] { display: none; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .98rem; line-height: 1.3; }
.hint { font-size: .86rem; color: var(--encre-2); line-height: 1.4; }
@media (max-width: 560px) { .fields { grid-template-columns: minmax(0, 1fr); } }

.unit { display: flex; align-items: stretch; min-width: 0; }
.unit input, .field select {
  font: inherit; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--encre);
  background: var(--blanc); border: 1.5px solid var(--papier-3); border-radius: var(--r);
  min-height: 48px; padding: 0 12px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.unit input { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; -moz-appearance: textfield; appearance: textfield; }
.unit input::-webkit-outer-spin-button, .unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit span {
  display: inline-flex; align-items: center; padding: 0 12px; white-space: nowrap;
  background: var(--papier-2); border: 1.5px solid var(--papier-3); border-left: 0;
  border-radius: 0 var(--r) var(--r) 0; color: var(--encre-2); font-size: .92rem; font-weight: 500;
}
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--encre) 50%), linear-gradient(135deg, var(--encre) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat;
}
.unit input:focus, .field select:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px rgba(244,180,26,.45); }
.unit:focus-within span { border-color: var(--encre); }
.unit input[readonly] { background: var(--papier); color: var(--encre-2); }

/* hypothèses */
.assume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-bottom: 24px; }
.assume { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--papier-3); }
.assume label { display: grid; line-height: 1.3; }
.assume label strong { font-size: .98rem; }
.assume label span { font-size: .85rem; color: var(--encre-2); }
.assume .unit input { min-height: 40px; font-size: 1rem; text-align: right; }
@media (max-width: 700px) { .assume-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- résultat ---------- */
.calc-result { position: sticky; top: calc(var(--header-h) + 20px); min-width: 0; scroll-margin-top: calc(var(--header-h) + 12px); }
@media (max-width: 960px) { .calc-result { position: static; } }
.res-card {
  background: var(--graphite); color: var(--on-dark); border-top: 4px solid var(--jaune); border-radius: var(--r); padding: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 40px 80px -40px rgba(16,18,21,.6);
}
.res-kicker { color: var(--on-dark-2); font-weight: 600; }
.res-total { font-family: var(--display); font-weight: 700; font-size: clamp(2.8rem, 6vw, 3.6rem); line-height: 1; color: var(--jaune); margin-top: 6px; letter-spacing: -0.01em; }
.res-total small { font-size: .4em; color: var(--on-dark-2); font-weight: 600; letter-spacing: 0; }
.res-sub { margin-top: 8px; color: var(--on-dark); }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--graphite-3); border: 1px solid var(--graphite-3); margin: 18px 0 10px; }
.res-grid div { background: var(--graphite-2); padding: 12px 14px; }
.res-grid dt { font-size: .85rem; color: var(--on-dark-2); }
.res-grid dd { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.05; }
.res-foot { font-size: .84rem; color: var(--on-dark-2); line-height: 1.45; }
.res-h { margin-top: 22px; font-weight: 600; font-size: .95rem; }
.res-h em { font-style: normal; color: var(--on-dark-2); font-weight: 500; }

.res-bars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 9px; }
.res-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: .88rem; }
.rb-label { color: var(--on-dark); }
.rb-val { color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.res-bars i { grid-column: 1 / -1; display: block; height: 6px; background: var(--graphite-3); position: relative; }
.res-bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--jaune); transition: width var(--t-ui) var(--ease); }

.res-dker { margin-top: 20px; padding-top: 2px; border-top: 1px solid var(--graphite-3); }
.res-gain { font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1.1; margin: 6px 0 6px; color: var(--vert-clair); }

.res-alerts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.res-alert { font-size: .88rem; line-height: 1.4; padding: 9px 12px; border-left: 3px solid var(--jaune); background: var(--graphite-2); }
.res-alert--danger { border-left-color: var(--rouge-clair); }

.res-actions { display: grid; gap: 10px; margin-top: 22px; }
.res-actions .btn { width: 100%; white-space: normal; text-align: center; min-height: 48px; }
.res-actions .btn-line { color: var(--on-dark); }
.btn-quiet {
  font: inherit; font-size: .9rem; background: none; border: 0; color: var(--on-dark-2); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; justify-self: center;
}
.btn-quiet:hover { color: var(--on-dark); }
.res-privacy { margin-top: 6px; text-align: center; }

/* barre du bas sur téléphone : le résultat reste visible pendant la saisie */
.res-dock { display: none; }
@media (max-width: 960px) {
  .res-dock {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--graphite); color: var(--on-dark); text-decoration: none; border-top: 3px solid var(--jaune);
  }
  .res-dock span { color: var(--on-dark-2); font-size: .92rem; }
  .res-dock strong { font-family: var(--display); font-size: 1.6rem; line-height: 1; color: var(--jaune); }
}

.site-footer { padding-top: 8px; }

/* ---------- impression : le diagnostic, sans la navigation ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .res-dock, .skip-link, .res-actions, .res-privacy { display: none !important; }
  .calc-hero { background: #fff; color: var(--encre); padding: 0 0 10px; }
  .calc-hero .lede { display: none; }
  .calc-hero .hero-kicker { color: var(--ocre); }
  .calc-hero h1 { font-size: 26pt; }
  .calc-layout { display: block; padding: 0; }
  .calc-result { position: static; margin-bottom: 18px; break-inside: avoid; }
  .res-card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .calc-form { gap: 16px; }
  .step { break-inside: avoid; }
  .step legend { font-size: 15pt; margin-bottom: 8px; }
  .unit span, .unit input, .field select { min-height: 0; padding-top: 4px; padding-bottom: 4px; }
}
