/* Fiche de déplacement — pensée pour le téléphone d'abord : cibles tactiles
   larges, une colonne, aucun défilement horizontal. La feuille du tableau de
   bord n'est pas réutilisée, ses densités sont faites pour un écran de bureau. */

:root {
  --fond: #f5f6f8;
  --surface: #ffffff;
  --bord: #dfe3e8;
  --texte: #1c2128;
  --texte-doux: #5c6773;
  /* Charte graphique FMO (janvier 2025) : Bleu FMO #275aa9 et Rouge FMO
     #ed292c sont les 2 couleurs dominantes du logo ; Bleu Nuit #092759 sert
     aux moments de marque plus appuyés (cf. --accent-fort). */
  --accent: #275aa9;
  --accent-fort: #092759;
  --danger: #ed292c;
  --ok: #1a7f52;
  --alerte: #b45309;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-bottom: 40px;
  /* Roboto : typographie de la charte graphique FMO (janvier 2025). Chargée
     via Google Fonts (cf. fdd.html) ; system-ui reste le repli si jamais
     elle ne se charge pas. */
  font: 16px/1.5 "Roboto", "Segoe UI", system-ui, sans-serif;   /* 16px : évite le
                                                          zoom automatique iOS
                                                          sur les champs de saisie */
  background: var(--fond);
  color: var(--texte);
}

.entete {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: 10px; }
.logo { height: 20px; }
.entete h1 { margin: 0; font-size: 18px; color: var(--accent-fort); }
.qui { font-size: 13px; color: var(--texte-doux); }
.lien-deconnexion {
  background: none;
  border: none;
  color: var(--texte-doux);
  text-decoration: underline;
  padding: 0;
  min-height: 0;
  font-size: 12px;
  font-weight: 400;
}

.titre-section { margin: 18px 16px 10px; font-size: 15px; color: var(--texte-doux); }

.carte {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 10px;
  margin: 12px 16px;
  padding: 14px 16px;
}

fieldset.carte { border: 1px solid var(--bord); }
legend { padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--accent); }

label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--texte-doux); }
label:last-child { margin-bottom: 0; }

input, textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 7px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;            /* cible tactile confortable */
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:disabled { opacity: .55; }
button.secondaire {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

/* Lien vers le planning technicien depuis l'en-tête — même esprit que
   button.secondaire, mais pour un <a> et à l'échelle du bandeau (pas la
   cible tactile pleine taille des boutons du formulaire). */
.lien-bouton {
  font: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

/* --- Liste des interventions --- */

.intervention {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--texte);
  border: 1px solid var(--bord);
  border-radius: 10px;
  margin: 0 16px 10px;
  padding: 14px 16px;
  font-weight: 400;
}
.intervention:active { background: var(--fond); }
.intervention-client { font-size: 16px; font-weight: 600; }
.intervention-date { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.intervention-machines {
  font-size: 13px;
  color: var(--texte-doux);
  margin-top: 4px;
  /* Un libellé de machines peut être très long : on le borne à trois lignes
     plutôt que de laisser la carte s'étirer sans fin. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Fiche --- */

.lien-retour {
  background: none;
  border: none;
  color: var(--accent);
  padding: 12px 16px 0;
  min-height: 0;
}
.recap h2 { margin: 0 0 4px; font-size: 17px; }
.note { font-size: 13px; color: var(--texte-doux); margin: 0; }

.barre-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--bord);
}
.barre-actions button { flex: 1; }

.etat { margin: 0 16px 8px; min-height: 1.3em; }

.erreur { color: var(--danger); margin: 12px 16px; font-size: 14px; }
.indisponible { color: var(--alerte); }

.identification .note { margin-bottom: 12px; }
.enregistre { color: var(--ok); font-weight: 600; }

/* --- Signature --- */

/* Un bloc par signataire (technicien puis client), empilés verticalement :
   plus confortable à faire tenir sur un écran de téléphone qu'une mise en
   page côte à côte, réservée au rendu PDF final. */
.signature-bloc { margin-bottom: 14px; }
.signature-bloc h3 { margin: 0 0 8px; font-size: 15px; }
.signature-bloc .btn-effacer-signature { margin-top: 8px; }

.signature-zone { padding: 0; overflow: hidden; }
.canvas-signature {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;   /* empêche le défilement de la page pendant le tracé */
  cursor: crosshair;
}
