/* inerWeb Édu TP — Charte graphique inerWeb
   Police corps : Calibri 14pt minimum, interligne 1.5, alignement gauche
   Titres : Trebuchet MS bold
   Couleurs : bleu #1b3a63 / orange #ff6b35 — fond clair uniquement */
:root {
  --bleu: #1b3a63;
  --bleu-light: #2d5a8a;
  --orange: #ff6b35;
  --vert: #4CAF50;
  --rouge: #E53935;
  --jaune: #FFC107;
  --gris: #666;
  --gris-clair: #F5F7FA;
  --blanc: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --font-corps: 'Calibri', 'Segoe UI', Arial, sans-serif;
  --font-titre: 'Trebuchet MS', 'Calibri', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-corps);
  font-size: 14pt;
  line-height: 1.5;
  text-align: left;
  background: var(--gris-clair);
  color: #222;
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-titre); font-weight: bold; text-align: left; }

/* Header fixe */
.header {
  background: linear-gradient(135deg, var(--bleu), var(--bleu-light));
  color: var(--blanc);
  padding: 14px 18px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header h1 { margin: 0; font-family: var(--font-titre); font-size: 18pt; font-weight: bold; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header .sub { font-size: 14pt; opacity: .9; margin-top: 4px; line-height: 1.5; }
.header .logo-badge {
  background: var(--orange);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 14pt;
  font-family: var(--font-titre);
  font-weight: bold;
  letter-spacing: .5px;
}
.header .signature { font-size: 12pt; font-style: italic; opacity: .85; margin-left: 6px; }

/* Container */
.container { max-width: 560px; margin: 0 auto; padding: 16px; }

/* Card */
.card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-titre);
  font-size: 15pt; font-weight: bold;
  color: var(--bleu);
  letter-spacing: .3px;
  margin: 0 0 14px 0;
  display: flex; align-items: center; gap: 10px;
  line-height: 1.5;
}
.card-title .step {
  background: var(--bleu);
  color: var(--blanc);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 14pt;
}

/* Form */
label { display: block; font-size: 14pt; font-weight: 600; color: #333; margin: 12px 0 6px; line-height: 1.5; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-corps);
  font-size: 14pt;
  line-height: 1.5;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  background: var(--blanc);
  color: #222;
  transition: border-color .15s;
  text-align: left;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,53,.18);
}
input[type=number] { text-align: right; }
small.hint { display: block; color: var(--gris); font-size: 14pt; margin-top: 6px; line-height: 1.5; }
.inline-row { display: flex; gap: 10px; }
.inline-row > * { flex: 1; }

/* Consigne pédagogique (balance, sécurité…) */
.consigne {
  background: #FFF8E1;
  border-left: 4px solid var(--jaune);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14pt;
  line-height: 1.5;
  margin: 10px 0 16px;
}
.consigne strong { color: #B8860B; }
.consigne ol { margin: 6px 0 0 0; padding-left: 18px; }
.consigne li { margin: 4px 0; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 22px;
  border: none; border-radius: 10px;
  font-family: var(--font-corps);
  font-size: 14pt; font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: transform .05s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--bleu); color: var(--blanc); }
.btn-primary:hover { background: var(--bleu-light); }
.btn-orange { background: var(--orange); color: var(--blanc); }
.btn-ghost { background: transparent; color: var(--bleu); border: 1.5px solid var(--bleu); }
.btn-danger { background: var(--rouge); color: var(--blanc); }
.btn-block { width: 100%; }
.btn-lg { padding: 18px 26px; font-size: 16pt; }
.btn + .btn { margin-left: 8px; }

/* Badges statut */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14pt;
  font-weight: bold;
}
.badge-neuf { background: #C8E6C9; color: #2E7D32; }
.badge-transfert { background: #BBDEFB; color: #0D47A1; }
.badge-recup { background: #FFE0B2; color: #E65100; }
.badge-vide { background: #E0E0E0; color: #424242; }

/* Résultat */
.result {
  padding: 18px;
  border-radius: 10px;
  margin-top: 14px;
  line-height: 1.5;
}
.result.ok { background: #E8F5E9; border-left: 4px solid var(--vert); }
.result.ko { background: #FFEBEE; border-left: 4px solid var(--rouge); }
.result .note-grande { font-family: var(--font-titre); font-size: 36pt; font-weight: bold; color: var(--bleu); margin: 6px 0; }
.result .detail-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14pt; border-bottom: 1px dashed #ddd; }
.result .detail-line:last-child { border-bottom: 0; }
.result .ok-inline { color: var(--vert); font-weight: bold; }
.result .ko-inline { color: var(--rouge); font-weight: bold; }

/* Écrans (navigation SPA) */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .15s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.progress {
  height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--orange);
  transition: width .25s;
}

/* Footer */
.footer {
  text-align: left;
  font-size: 14pt;
  line-height: 1.5;
  color: var(--gris);
  padding: 20px;
}
.footer .signature { font-style: italic; }
.footer .etablissement { display: block; margin-top: 4px; font-weight: 600; color: var(--bleu); }

/* Camera viewport (QR) */
#qr-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: var(--radius);
  object-fit: cover;
}

/* Grille récap bouteille */
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 14pt; line-height: 1.5; margin: 14px 0; }
.recap-grid div { background: #F5F7FA; padding: 10px 12px; border-radius: 6px; }
.recap-grid strong { display: block; color: var(--bleu); font-size: 14pt; font-family: var(--font-titre); margin-bottom: 4px; }

/* Carte « balance de l'atelier » */
.balance-card {
  background: #F8FAFC;
  border: 1px solid #E0E6EE;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.balance-head {
  background: linear-gradient(90deg, #1B3A63 0%, #2d5a8a 100%);
  color: #fff;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 14pt;
  line-height: 1.5;
}
.balance-head b { font-family: var(--font-titre); font-size: 15pt; }
.balance-specs {
  background: var(--orange);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 14pt;
  font-weight: 600;
  white-space: nowrap;
}
.balance-body {
  padding: 12px;
  font-size: 14pt;
  line-height: 1.5;
  color: #333;
}
.balance-img {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 8px;
  border-radius: 4px;
  background: #fff;
}

/* Badge compétence */
.comp-badge {
  display: inline-block;
  background: var(--bleu);
  color: #fff;
  font-size: 14pt;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Courier New', monospace;
  letter-spacing: .5px;
}
.comp-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px dashed #e0e0e0;
  font-size: 14pt;
  line-height: 1.5;
}
.comp-line:last-child { border-bottom: 0; }
.comp-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.comp-bar-fill { height: 100%; transition: width .3s; }

/* Lignes bilan */
.bilan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
  font-size: 14pt;
  line-height: 1.5;
}
.bilan-row:last-child { border-bottom: 0; }

/* Formule rappel (pour les calculs) */
.formule {
  background: #F5F7FA;
  border: 1px dashed #ccc;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 15pt;
  line-height: 1.5;
  color: var(--bleu);
  margin: 10px 0;
  text-align: left;
}
