/* ═══════════════════════════════════════════
   TECHNIBOIS — Pilotage par les coûts
   CSS commun — Thème Industriel Éditorial
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&display=swap');

/* ── VARIABLES ── */
:root {
  --black:     #0E0E0E;
  --dark:      #1A1A18;
  --panel:     #232320;
  --surface:   #F4F3EF;
  --card:      #FFFFFF;
  --green:     #6B9E72;
  --green-l:   #8BBF93;
  --green-d:   #4A7A52;
  --gold:      #C9A44E;
  --gold-l:    #E8C97A;
  --red:       #C0392B;
  --text:      #1A1A18;
  --muted:     #6B6B68;
  --border:    #E0DFD8;
  --border-d:  #2E2E2A;

  --ff-display: 'DM Serif Display', Georgia, serif;
  --ff-ui:      'Syne', system-ui, sans-serif;
  --ff-mono:    'DM Mono', 'Courier New', monospace;

  --radius:    2px;
  --shadow:    0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--ff-ui);
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--dark);
  padding: 0 32px;
  position: sticky; top: 0; z-index: 300;
  border-bottom: 1px solid var(--border-d);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  letter-spacing: -0.5px;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
}
.brand-text {
  font-family: var(--ff-ui);
  font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: 0.02em;
}
.brand-text em {
  font-family: var(--ff-display);
  font-style: italic;
  color: var(--green-l);
  font-size: 17px;
}
.topbar-subtitle {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.btn-home {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--ff-ui);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.btn-home:hover { color: #fff; border-color: rgba(255,255,255,0.35); }

/* ── PROGRESS BAR ── */
.progress-strip {
  background: var(--panel);
  padding: 8px 32px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border-d);
}
.progress-track {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--green);
  border-radius: 1px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}
.progress-pts {
  font-family: var(--ff-mono);
  font-size: 11px; font-weight: 500;
  color: var(--green-l); white-space: nowrap;
  min-width: 70px; text-align: right;
}

/* ── LAYOUT ── */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 40px 24px 100px; }

/* ── SECTION TITLES ── */
.page-title {
  font-family: var(--ff-display);
  font-size: 36px; font-weight: 400;
  line-height: 1.1; color: var(--text);
  margin-bottom: 6px;
}
.page-title em { color: var(--green-d); }
.page-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--green); margin-bottom: 12px;
  display: block;
}

/* ── ID CARD ── */
.id-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.id-card-title {
  font-family: var(--ff-display);
  font-size: 20px; color: var(--text);
  margin-bottom: 24px;
}
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:560px){ .fields-grid { grid-template-columns: 1fr; } }
.field-wrap { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.field-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--ff-ui);
  font-size: 14px; color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field-input:focus { border-color: var(--green); background: #fff; }
.field-input[readonly] { background: #f0efe9; color: var(--muted); cursor: default; }
.field-input.full { grid-column: 1 / -1; }

/* ── ÉTAPE HEADER ── */
.step-header {
  background: var(--dark);
  padding: 18px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; gap: 16px;
}
.step-badge {
  background: var(--green);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.step-title {
  font-family: var(--ff-ui);
  font-size: 16px; font-weight: 700;
  color: #fff; line-height: 1.3;
}

/* ── ÉTAPE BODY ── */
.step-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

/* ── INFO BOXES ── */
.ctx-box {
  border-left: 3px solid var(--green);
  background: #f0f5f1;
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; color: #2a3d2c;
  margin-bottom: 22px; line-height: 1.7;
}
.ctx-box strong { color: var(--green-d); }
.hl-box {
  border-left: 3px solid var(--gold);
  background: #fdf8ee;
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; color: #4a3a10;
  margin-bottom: 22px; line-height: 1.7;
}
.hl-box strong { color: #8a6010; }
.info-tip {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f9f9f6; border: 1px dashed #c8c7c0;
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 16px;
}
.info-tip::before { content: '💡'; flex-shrink: 0; font-size: 14px; }

/* ── TABLES ── */
.ex-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; margin-bottom: 6px;
}
.ex-table th {
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  font-family: var(--ff-ui);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 11px 14px; text-align: left;
}
.ex-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ex-table tr:last-child td { border-bottom: none; }
.ex-table tr:nth-child(even) td { background: #fafaf7; }
.ex-table .charge-name { font-weight: 600; color: var(--text); }
.ex-table .charge-amt {
  font-family: var(--ff-mono);
  font-weight: 600; color: var(--green-d);
}

/* ── SELECT ── */
select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 32px 9px 12px;
  font-family: var(--ff-ui);
  font-size: 13px; color: var(--text);
  outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B9E72' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.2s;
}
select:focus { border-color: var(--green); }

/* ── NUM INPUT ── */
.num-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-family: var(--ff-mono);
  font-size: 14px; color: var(--text);
  outline: none; width: 120px;
  transition: border-color 0.2s, background 0.2s;
}
.num-input:focus { border-color: var(--green); background: #fff; }
.num-input[readonly] { background: #f0efe9; color: var(--green-d); font-weight: 600; }
.input-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.input-row-label {
  font-size: 13px; font-weight: 600;
  color: var(--text); min-width: 160px;
  line-height: 1.4;
}
.input-unit { font-size: 12px; color: var(--muted); font-family: var(--ff-mono); }

/* ── FEEDBACK INLINE ── */
.fb-ok {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: #2d6e33; background: #e2f0e4;
  padding: 3px 9px; border-radius: 2px;
}
.fb-ko {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: #c0392b; background: #fde8e6;
  padding: 3px 9px; border-radius: 2px;
}

/* ── FEEDBACK BLOCK ── */
.fb-block {
  background: #f0f5f1;
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  margin-top: 20px;
  font-size: 14px; color: #2a3d2c;
  line-height: 1.75;
  display: none;
}
.fb-block.show { display: block; animation: fadeSlideIn 0.3s ease; }
.fb-block h4 {
  font-weight: 700; color: var(--green-d);
  margin-bottom: 10px; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.fb-score {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #c5dbc8;
  font-weight: 700; color: var(--green-d);
  font-family: var(--ff-mono); font-size: 15px;
}
.fb-block ul { padding-left: 18px; margin-top: 8px; }
.fb-block li { margin-bottom: 4px; }

/* ── CHOICES (radio/checkbox) ── */
.choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.choice {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 14px; line-height: 1.5;
  user-select: none;
}
.choice:hover { border-color: var(--green-l); background: #f5faf6; }
.choice.selected { border-color: var(--green); background: #f0f5f1; }
.choice.correct  { border-color: #2d6e33; background: #e2f0e4; }
.choice.wrong    { border-color: var(--red); background: #fde8e6; }
.choice input { display: none; }
.choice-dot {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid #ccc; border-radius: 50%;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.choice-check { border-radius: 3px !important; }
.choice.selected .choice-dot,
.choice.correct .choice-dot  { border-color: var(--green); background: var(--green); }
.choice.wrong .choice-dot    { border-color: var(--red); background: var(--red); }
.choice-dot-inner {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: 0; transition: opacity 0.15s;
}
.choice.selected .choice-dot-inner,
.choice.correct  .choice-dot-inner { opacity: 1; }

/* ── BUTTONS ── */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ff-ui);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 22px; border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--green); color: var(--text); }
.btn-ghost { background: transparent; color: #bbb; border: 1.5px solid #e8e7e0; font-size: 10px; padding: 10px 16px; }
.btn-ghost:hover { color: var(--muted); border-color: #ccc; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a8883e; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 22px 0; }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green); margin-bottom: 6px; display: block;
}
.section-h { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.section-sub { font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 14px; }

/* ── ANIMATIONS ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* ── RESPONSIVE ── */
@media(max-width:600px) {
  .topbar { padding: 0 16px; }
  .topbar-subtitle { display: none; }
  .progress-strip { padding: 8px 16px; }
  .page-wrap { padding: 24px 14px 80px; }
  .step-body, .id-card { padding: 18px 16px; }
  .ex-table { font-size: 12px; }
  .ex-table th, .ex-table td { padding: 8px 8px; }
  .page-title { font-size: 26px; }
  .btn { font-size: 10px; padding: 10px 14px; }
  .fields-grid { grid-template-columns: 1fr; }
  select { font-size: 12px; }
  .num-input { width: 100px; font-size: 13px; }
}
