/* ============================================================================
   AIMPRO CLIM — DESIGN SYSTEM
   ----------------------------------------------------------------------------
   Direction : "thermal comfort". Le sujet c'est la température maîtrisée —
   on traduit ça par un dégradé froid→chaud utilisé avec parcimonie comme
   signature, sur une base claire et précise (pas le dark-mode générique).
   Palette :
     --ink        #14202b  bleu nuit (texte, structure)
     --paper      #f7f5f0  blanc cassé chaud (fond)
     --frost      #e8eef2  bleu glacé (surfaces)
     --cool       #2f7 db  bleu froid (accent primaire)
     --warm       #e8743b  orange chaud (accent thermique)
     --line       #d8d8ce
   Type : Fraunces (display, caractère) + Inter (corps/ui).
============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink:    #14202b;
  --ink-2:  #41525f;
  --paper:  #f7f5f0;
  --frost:  #e8eef2;
  --frost-2:#dde7ed;
  --cool:   #2f7adb;
  --cool-d: #1f5fb0;
  --warm:   #e8743b;
  --line:   #dcdcd2;
  --ok:     #2f9e7a;
  --err:    #d2553f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,32,43,.04), 0 8px 28px rgba(20,32,43,.07);
  --maxw: 960px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 64px; }

/* ─── Hero / header ─────────────────────────────────────────────────────── */
.hero { margin-bottom: 36px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cool-d); margin-bottom: 14px;
}
.hero .eyebrow .dot {
  width: 22px; height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--cool), var(--warm));
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.hero p { margin: 0; font-size: 1.05rem; color: var(--ink-2); max-width: 56ch; }

/* ─── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card + .card { margin-top: 20px; }

/* ─── Form fields ───────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-size: .85rem; font-weight: 600; color: var(--ink); }
label .hint { font-weight: 400; color: var(--ink-2); }

input, select, textarea {
  width: 100%; padding: 12px 14px;
  font-size: .96rem; font-family: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cool); background: #fff;
  box-shadow: 0 0 0 3px rgba(47,122,219,.14);
}
select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2341525f' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; font-size: 1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; border-radius: var(--radius-sm);
  color: #fff; background: var(--ink);
  transition: transform .12s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; }
.btn.cool { background: linear-gradient(120deg, var(--cool), var(--cool-d)); }
.btn.warm { background: linear-gradient(120deg, var(--warm), #cf5a26); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--frost); filter: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }

/* ─── Result cards ──────────────────────────────────────────────────────── */
.result { margin-top: 22px; display: none; }
.result.show { display: block; animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.brands { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .brands { grid-template-columns: 1fr; } }

.brand {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; overflow: hidden;
}
.brand:before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--cool), var(--warm));
}
.brand.best { border-color: var(--cool); box-shadow: 0 0 0 1px var(--cool); }
.brand .badge {
  position: absolute; top: 14px; right: 14px; font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cool-d);
  background: var(--frost); padding: 3px 9px; border-radius: 20px; display: none;
}
.brand.best .badge { display: inline-block; }
.brand .bname { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.brand .bmodel { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; margin: 6px 0 16px; min-height: 2.6em; }
.brand .brange { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.brand .brange .cur { color: var(--ink-2); font-weight: 500; }
.brand .bnote { margin-top: 4px; font-size: .82rem; color: var(--ink-2); }
.brand .bincl { margin: 16px 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--ink-2); }
.brand .bincl li { padding-left: 20px; position: relative; margin-bottom: 4px; }
.brand .bincl li:before { content: "✓"; position: absolute; left: 0; color: var(--cool); font-weight: 700; }

.disclaimer {
  margin-top: 18px; font-size: .8rem; color: var(--ink-2);
  background: rgba(232,116,59,.07); border-left: 3px solid var(--warm);
  padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Messages ──────────────────────────────────────────────────────────── */
.msg { margin-top: 14px; font-size: .92rem; padding: 12px 14px; border-radius: var(--radius-sm); display: none; }
.msg.ok  { display: block; background: rgba(47,158,122,.1); color: #1f6e54; border: 1px solid rgba(47,158,122,.3); }
.msg.err { display: block; background: rgba(210,85,63,.1); color: #a13a28; border: 1px solid rgba(210,85,63,.3); }

/* ─── Section heading ───────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 500;
  margin: 0 0 4px;
}
.section-sub { margin: 0 0 18px; font-size: .9rem; color: var(--ink-2); }

/* ─── Loading ───────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--frost-2); border-top-color: var(--cool);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ─── Type choice (mono / multi) ────────────────────────────────────────── */
.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .type-choice { grid-template-columns: 1fr; } }
.type-card {
  text-align: left; cursor: pointer; font-family: inherit;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.type-card:hover { border-color: var(--cool); }
.type-card.selected { border-color: var(--cool); background: #fff; box-shadow: 0 0 0 3px rgba(47,122,219,.12); }
.type-card .type-name { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.type-card.selected .type-name:after { content: "✓"; color: var(--cool); font-weight: 700; }
.type-card .type-desc { font-size: .85rem; color: var(--ink-2); line-height: 1.45; }

/* ─── Pièces list ───────────────────────────────────────────────────────── */
.piece-row {
  display: grid; grid-template-columns: 1fr 1fr 44px; gap: 12px; align-items: end;
  padding: 14px; margin-bottom: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
@media (max-width: 540px) { .piece-row { grid-template-columns: 1fr 1fr; } .piece-row .piece-del { grid-column: 2; justify-self: end; } }
.piece-row .mini-label { font-size: .76rem; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.piece-del {
  height: 46px; width: 44px; border: 1px solid var(--line); background: #fff;
  color: var(--err); border-radius: var(--radius-sm); cursor: pointer; font-size: 1.1rem;
  transition: background .15s;
}
.piece-del:hover { background: rgba(210,85,63,.08); }
.piece-num { font-size: .8rem; color: var(--cool-d); font-weight: 700; margin-bottom: 8px; }

/* ─── Sur demande ───────────────────────────────────────────────────────── */
.brand.demande { text-align: center; }
.brand.demande .brange { font-size: 1.15rem; color: var(--warm); }
