/* ===========================================================
   RapportChantier — Design v2 (Proposition A : épuré, aéré)
   Palette : navy #1C3464 / orange #EA5B0C utilisés en accent
   Fond global : crème chaud #FBFAF8
   Ombres douces, cartes légères, plus de blocs colorés massifs
   =========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #FBFAF8;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 110px;
}

/* Layout */
.container { max-width: 640px; margin: 0 auto; padding: 4px 20px 20px; }
.hidden { display: none !important; }

/* ============================================================
   HEADER ARTISAN — allégé, sans gros bandeau navy
   Avatar rond + titre + actions en icônes minimalistes
   ============================================================ */
.header-artisan {
  background: #FBFAF8;
  color: #1a1a1a;
  padding: 14px 22px 14px;
  border-bottom: 1px solid #F0EBE2;
  position: relative;
}
.header-artisan::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #EA5B0C 0%, #EA5B0C 30%, transparent 100%);
}
.header-artisan .top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0;
}
.header-artisan .back {
  color: #555;
  cursor: pointer;
  background: #F4F0E8;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  flex-shrink: 0;
}
.header-artisan .back:hover { background: #ECE6D9; }

/* Avatar rond avec initiales (orange sur fond pâle) */
.header-artisan .header-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE5D9, #FFCBA8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #C84A09;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.header-artisan .header-text { flex: 1; min-width: 0; }
.header-artisan h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1C3464;
  line-height: 1.2;
  margin: 0;
}
.header-artisan .subtitle {
  font-size: 0.72rem;
  color: #999;
  margin-top: 2px;
  line-height: 1.35;
  font-weight: 400;
}
.header-artisan .subtitle .subtitle-name {
  font-weight: 600;
  color: #555;
  font-size: 0.78rem;
  letter-spacing: 0.1px;
}
.header-artisan .subtitle .subtitle-legal {
  font-size: 0.68rem;
  color: #B0AC9F;
  margin-top: 1px;
  letter-spacing: 0.2px;
}

/* Boutons icône (déconnexion, paramètres) */
.header-artisan .logout-btn,
.header-artisan .settings-btn {
  background: #F4F0E8;
  color: #555;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.header-artisan .logout-btn:hover,
.header-artisan .settings-btn:hover { background: #ECE6D9; }
.header-artisan .logout-btn {
  font-size: 0.78rem;
  width: auto;
  padding: 0 14px;
  border-radius: 18px;
}

/* ============================================================
   HEADER CLIENT (vue partagée publique)
   Garde le navy plein car ambiance "officielle"
   ============================================================ */
.header-client {
  background: #1C3464;
  color: white;
  padding: 28px 20px 32px;
  text-align: center;
  border-bottom: 3px solid #EA5B0C;
}
.header-client h1 { font-size: 1.4rem; margin-bottom: 6px; }
.header-client .sub { font-size: 0.95rem; opacity: 0.95; }
.header-client .address { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  background: #EA5B0C; color: white; border: none;
  padding: 13px 20px; border-radius: 14px; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; width: 100%; font-family: inherit;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.btn-loading {
  cursor: wait !important;
  opacity: 0.85 !important;
  position: relative;
  animation: btnPulse 1.4s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(234,91,12,0.2); }
  50% { box-shadow: 0 6px 22px rgba(234,91,12,0.45); }
}
.btn.ghost { background: transparent; color: #555; border: 1px solid #E8E2D6; }
.btn.ghost:hover { background: #FAF7F2; }
.btn.pdf { background: #1C3464; }
.btn.blue { background: #1E88E5; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; width: auto; border-radius: 10px; }
.btn.btn-compact {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
}

/* ============================================================
   BARRE DE RECHERCHE + FILTRES (allégés, sans card conteneur)
   ============================================================ */
.search-bar {
  background: transparent;
  padding: 16px 0 4px;
  margin-bottom: 8px;
  box-shadow: none;
  border-radius: 0;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid #F0EBE2;
}
.search-icon {
  position: absolute;
  left: 16px;
  font-size: 0.95rem;
  pointer-events: none;
  color: #B0AC9F;
}
#search-input {
  width: 100%;
  padding: 14px 44px 14px 42px;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #333;
}
#search-input:focus { outline: none; }
#search-input::placeholder { color: #B0AC9F; }
.search-clear {
  position: absolute;
  right: 10px;
  background: #F4F0E8;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { background: #ECE6D9; }

.search-filters {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.filter-chip {
  background: white;
  border: 1px solid #E8E2D6;
  color: #555;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.filter-chip:hover { background: #FAF7F2; }
.filter-chip.active {
  background: #1C3464;
  color: white;
  border-color: #1C3464;
}
.filter-chip-archive {
  background: #FFF5EC;
  border-color: #F0A772;
  color: #B85F1A;
}
.filter-chip-archive:hover { background: #FFE9D5; }
.filter-chip-archive.active {
  background: #F0A772;
  border-color: #F0A772;
  color: white;
}
.search-count {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #B0AC9F;
  padding-left: 4px;
  font-weight: 500;
}

/* ============================================================
   CARTES DOSSIERS (refonte avec dot-badge + stat-chips)
   ============================================================ */
.card {
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
.card:active { transform: scale(0.99); }
/* On supprime la flèche absolue (devient un › discret en bas droite, après les chips) */
.card::after { content: none; }

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1C3464;
  margin: 6px 0 4px;
  line-height: 1.25;
}
.card .client {
  color: #7A7A7A;
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #F4F0E8;
}
.card .meta span {
  font-size: 0.72rem;
  color: #555;
  background: #F7F3EC;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
}
.card .meta::after {
  content: "›";
  margin-left: auto;
  color: #C9C2B5;
  font-size: 1.1rem;
  font-weight: 300;
}

/* Cercle de rang navy sur les cartes dossier */
.rang-circle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1C3464;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Badge photo séparé du badge passages */
.card .meta-photo {
  margin-left: 6px;
}

/* ============================================================
   BADGES (pastille colorée + texte UPPERCASE)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #888;
  background: transparent;
  margin-bottom: 0;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #EA5B0C;
  display: inline-block;
  flex-shrink: 0;
}
.badge.devis::before { background: #1C3464; }
.badge.archived::before { background: #F0A772; }
/* Date à droite dans la card */
.card .badge {
  display: inline-flex;
  margin-bottom: 0;
}

/* ============================================================
   DÉTAIL DOSSIER
   ============================================================ */
.detail-header {
  background: white;
  padding: 22px 22px 18px;
  margin: 14px 0 0;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.detail-header > div:first-child { margin-bottom: 4px; }
.detail-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1C3464;
  margin: 10px 0 14px;
  line-height: 1.2;
}
.detail-header .meta {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.7;
}
.detail-header .meta a { color: #EA5B0C; font-weight: 600; text-decoration: none; }
.detail-header .share {
  margin-top: 14px;
  padding: 12px;
  background: #FAF7F2;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}
.copy-btn {
  background: #EA5B0C; color: white; border: none;
  padding: 6px 10px; border-radius: 6px; font-size: 0.8rem;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  font-weight: 600;
}

/* Detail-actions ancien (legacy) — gardé au cas où */
.detail-actions { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 140px; }

/* Detail-actions-compact : grille 2x2 de tuiles
   Spécificité maximale (#view-detail) pour gagner sur tout */
#view-detail .detail-actions-compact,
.detail-actions.detail-actions-compact {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin: 16px 0 0 !important;
  flex-wrap: unset !important;
}
#view-detail .detail-actions-compact .btn,
.detail-actions.detail-actions-compact .btn {
  flex: none !important;
  min-width: 0 !important;
  width: 100% !important;
  padding: 16px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 14px;
  background: white;
  color: #1C3464;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: none;
  text-align: center;
  letter-spacing: 0.1px;
}
#view-detail .detail-actions-compact .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
/* Le bouton "Ajouter" reste orange plein (action principale) */
#view-detail .detail-actions-compact #add-passage-btn {
  background: #EA5B0C !important;
  color: white !important;
  box-shadow: 0 6px 16px rgba(234,91,12,0.25);
}
#view-detail .detail-actions-compact #navigate-btn {
  background: #1C3464 !important; color: white !important;
}
#view-detail .detail-actions-compact #pdf-btn {
  background: #0F1F4D !important; color: white !important;
}
#view-detail .detail-actions-compact #pdf-portfolio-btn {
  background: white !important; color: #1C3464 !important;
  border: 2px solid #1C3464 !important;
}

/* Deuxième ligne d'actions (Modifier / Clôturer / Supprimer)
   en boutons texte fins, sur 1 ligne 3 colonnes */
#view-detail .detail-actions-compact:nth-of-type(2) {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
#view-detail .detail-actions-compact:nth-of-type(2) .btn {
  background: transparent !important;
  color: #555 !important;
  border: 1px solid #E8E2D6 !important;
  padding: 9px 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
#view-detail .detail-actions-compact:nth-of-type(2) .btn:hover {
  background: #FAF7F2 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-size: 0.78rem;
  color: #B0AC9F;
  margin: 24px 0 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   PASSAGES (cards de rapport)
   ============================================================ */
.report-card {
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  overflow: hidden;
  min-width: 0;
}
.report-date {
  font-size: 0.78rem;
  color: #B0AC9F;
  margin-bottom: 10px;
  text-transform: capitalize;
  font-weight: 500;
}
.report-note {
  background: #FAF7F2;
  padding: 14px;
  border-radius: 12px;
  margin: 12px 0;
  line-height: 1.55;
  color: #333;
  font-size: 0.92rem;
  border-left: 3px solid #EA5B0C;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}
.client .report-note { border-left-color: #1E88E5; }

/* Photos grid dans les passages (vue détail) */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  align-items: start;
}
.photos-grid .photo-with-caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.photos-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  display: block;
}
.photos-grid .photo-caption-view {
  font-size: 0.76rem;
  color: #555;
  font-style: italic;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.photos-grid .photo-meta {
  font-size: 0.65rem;
  color: #999;
  line-height: 1.3;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* ============================================================
   TIMELINE (vue client)
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 2px; background: #E3F2FD;
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 20px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; border: 3px solid #1E88E5;
}
.timeline-item.latest::before {
  background: #1E88E5; box-shadow: 0 0 0 4px rgba(30,136,229,0.2);
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,52,100,0.6);
  z-index: 10000; padding: 20px; overflow-y: auto;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body.modal-open #map-wrapper { visibility: hidden; }
.modal-overlay.show { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: #FBFAF8;
  border-radius: 22px;
  padding: 26px 24px;
  width: 100%; max-width: 560px;
  margin: 20px auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.modal h2 {
  margin-bottom: 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1C3464;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1C3464;
}
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E8E2D6;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #EA5B0C;
  box-shadow: 0 0 0 3px rgba(234,91,12,0.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}
.modal-actions .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 18px;
  font-size: 0.9rem;
  border-radius: 12px;
}

/* Type picker */
.type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-option {
  border: 2px solid #E8E2D6;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  background: white;
}
.type-option.selected {
  border-color: #EA5B0C;
  background: #FFF5F0;
  box-shadow: 0 2px 8px rgba(234,91,12,0.1);
}
.type-option .emoji { font-size: 1.6rem; margin-bottom: 6px; }
.type-option .label { font-size: 0.88rem; font-weight: 700; color: #1C3464; }
.type-option .desc { font-size: 0.74rem; color: #888; margin-top: 4px; }

/* Photo upload (modale passage) */
.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
  align-items: start;
}
.photo-thumb-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.photo-thumb .remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.7); color: white;
  border: none; border-radius: 50%;
  width: 22px; height: 22px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.photo-arrows {
  position: absolute;
  bottom: 4px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.photo-arrow {
  background: rgba(0,0,0,0.65);
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.photo-arrow:active {
  background: var(--orange);
}
.photo-caption-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.78rem;
  border: 1px solid #E8E2D6;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
  color: #333;
  background: #FAF7F2;
}
.photo-caption-input:focus {
  outline: none;
  border-color: #EA5B0C;
  background: white;
}
.photo-add {
  aspect-ratio: 1;
  border: 2px dashed #EA5B0C;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #EA5B0C;
  font-size: 1.8rem;
  cursor: pointer;
  background: white;
  align-self: start;
  width: 100%;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #B0AC9F;
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty p { color: #7A7A7A; }
.empty h3 { font-size: 1.1rem; margin-bottom: 8px; color: #1C3464; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #1C3464; color: white;
  padding: 12px 20px; border-radius: 12px;
  font-size: 0.9rem; z-index: 200;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
  max-width: 90%; text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  font-weight: 600;
}
.toast.show { opacity: 1; }
.toast.error { background: #BE1522; }
.toast.success { background: #2E7D32; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: white;
}
.auth-top {
  flex: 0 0 auto;
  background: white;
  padding: 50px 24px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-top .brand-mark .brand-ico svg { width: 72px; height: 58px; }
.auth-top .brand-mark .brand-name { font-size: 1.7rem; }
.auth-top .brand-mark .brand-tag { font-size: 0.86rem; margin-top: 4px; }
.auth-bottom {
  flex: 1 1 auto;
  background: #1C3464;
  padding: 36px 20px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  position: relative;
  margin-top: -16px;
}
.auth-bottom::before {
  content: "";
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}
.auth-card {
  background: white;
  border-radius: 22px;
  padding: 32px 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  margin-top: 16px;
}
@media (max-width: 420px) {
  .auth-top { padding: 36px 20px 28px; }
  .auth-top .brand-mark .brand-ico svg { width: 60px; height: 48px; }
  .auth-top .brand-mark .brand-name { font-size: 1.4rem; }
  .auth-top .brand-mark .brand-tag { font-size: 0.78rem; }
  .auth-bottom { padding: 32px 16px 32px; }
  .auth-card { padding: 28px 20px; }
}
.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #1C3464;
  font-weight: 800;
}
.auth-card .auth-subtitle {
  color: #7A7A7A;
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.auth-card .switch {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #666;
}
.auth-card .switch a {
  color: #EA5B0C;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   LIGHTBOX (zoom photo)
   ============================================================ */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 11000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; }
.lightbox .close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.2);
  color: white; border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  border: 3px solid #F4F0E8;
  border-top: 3px solid #EA5B0C;
  border-radius: 50%;
  width: 30px; height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ============================================================
   INSTALL BANNER (PWA)
   ============================================================ */
.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #1C3464;
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.install-banner.hidden { display: none; }
.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  line-height: 1.3;
}
.install-text strong { font-weight: 700; }
.install-text span { font-size: 0.78rem; opacity: 0.92; }
.install-btn-action {
  background: white;
  color: #EA5B0C;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.install-btn-close {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ============================================================
   VOICE BUTTON (dictée)
   ============================================================ */
.voice-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: white;
  border: 1px solid #E8E2D6;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  font-family: inherit;
}
.voice-btn:hover { background: #FAF7F2; }
.voice-btn.recording {
  background: #FFEDED;
  border-color: #E57373;
  color: #BE1522;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(190,21,34,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(190,21,34,0); }
}

/* ============================================================
   SIGNATURE PAD (modale paramètres)
   ============================================================ */
.signature-pad-wrap {
  position: relative;
  border: 2px dashed #EA5B0C;
  border-radius: 12px;
  background: white;
  overflow: hidden;
  touch-action: none;
}
.signature-pad-wrap canvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: crosshair;
  touch-action: none;
  background: white;
}
.signature-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #B0AC9F;
  font-size: 0.92rem;
  font-style: italic;
  pointer-events: none;
  user-select: none;
}
.signature-pad-wrap.has-signature .signature-placeholder { display: none; }

/* ============================================================
   BRAND WORDMARK (logo visible sur la page d'accueil de l'app)
   ============================================================ */
.brand-wordmark {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 24px 0 8px;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark .brand-ico { display: flex; align-items: center; flex-shrink: 0; }
.brand-mark .brand-ico svg { width: 44px; height: 35px; display: block; }
.brand-mark .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-mark .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #1C3464;
}
.brand-mark .brand-accent { color: #EA5B0C; }
.brand-mark .brand-name sup {
  font-size: 0.5em; font-weight: 400;
  opacity: 0.65; margin-left: 2px;
  vertical-align: super; color: #1C3464;
}
.brand-mark .brand-tag {
  font-size: 0.72rem;
  font-style: italic;
  color: #7A7A7A;
  font-weight: 400;
  margin-top: 3px;
  letter-spacing: 0.2px;
}
@media (max-width: 420px) {
  .brand-mark .brand-name { font-size: 1.15rem; }
  .brand-mark .brand-tag { font-size: 0.68rem; }
  .brand-mark .brand-ico svg { width: 38px; height: 30px; }
}

/* ============================================================
   FAB (Nouveau dossier — bouton flottant)
   ============================================================ */
.fab,
#fab {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #EA5B0C;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 28px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(234,91,12,0.4);
  cursor: pointer;
  font-family: inherit;
  width: auto;
  max-width: 280px;
  z-index: 5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 420px) {
  .container { padding: 4px 16px 20px; }
  .header-artisan { padding: 12px 16px; }
  .filter-chip { padding: 7px 12px; font-size: 0.76rem; }
  .modal { padding: 22px 20px; border-radius: 18px; }
}
