/* ─────────────────────────────────────────────────────────────────────
   InfoBorne — Chauffeur Login / Vehicle Flow Styles  (index.html)
   Screens: 1 QR scan · 2 Identity · 3 Vehicles · 4 Verification · 5 Trajet
   ───────────────────────────────────────────────────────────────────── */

/* ── Page base ──────────────────────────────────────────────────────── */
body { font-size: 16px; }

/* Screens fill the full viewport directly (no #app wrapper on this page) */
.screen { height: 100dvh; }

/* ── Header bar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 6px;
  position: relative;
}
.topbar-brand {
  display: flex;
  align-items: center;
}

.topbar-wordmark {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}
.topbar-wordmark .w-info  { color: var(--brand-cyan); }
.topbar-wordmark .w-borne { color: var(--brand-green); }
.topbar-sub {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.topbar-sep  { color: var(--border); font-size: 12px; }
.topbar-step { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; }

/* ── Content area ───────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.content.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  overflow-y: auto;
}

/* ── Section label ──────────────────────────────────────────────────── */
.label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* ── Headline + sub ─────────────────────────────────────────────────── */
.headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}
.sub {
  font-size: 18px;
  color: #e1e3e7;
  margin-bottom: 28px;
  line-height: 1.5;
}
.accent { color: var(--accent); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--r);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-user-select: none;
}
.btn:active   { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #0B0E15; }
.btn-ghost   { background: var(--surface2); color: var(--text-dim); border: 1px solid #459bac; }
.btn-danger  { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); }

/* ── Driver buttons (Screen 2) ──────────────────────────────────────── */
.driver-list { display: flex; flex-direction: column; gap: 10px; }
.driver-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.driver-btn::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.driver-btn:active { background: var(--accent-dim); border-color: var(--accent); transform: scale(0.98); }
.driver-btn:active::before { background: var(--accent); }

/* ── Confirm card ───────────────────────────────────────────────────── */
.confirm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px 20px; margin-bottom: 20px; }
.confirm-row  { display: flex; flex-direction: column; gap: 18px; }
.confirm-field { display: flex; flex-direction: column; gap: 4px; }
.confirm-field-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.confirm-field-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  letter-spacing: 0.01em;
}
.confirm-field-value.accent { color: var(--accent); }

/* ── Vehicle cards (Screen 3) ───────────────────────────────────────── */
.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
}
.vehicle-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
}
.vehicle-card:active { transform: scale(0.98); }
.vehicle-card.selected          { border-color: var(--accent); background: var(--accent-dim); }
.vehicle-card.warn-card         { border-color: var(--warn); }
.vehicle-card.warn-card.selected{ border-color: var(--warn); background: var(--warn-dim); }

.vehicle-immat {
  display: flex;
  align-items: stretch;
  border: 3px solid #aaa;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  background: #fff;
  width: 100%;
}
.vehicle-immat-strip {
  background: #003EA8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  gap: 2px;
  min-width: 36px;
  flex-shrink: 0;
}
.vehicle-immat-eu { font-size: 14px; line-height: 1; }
.vehicle-immat-f  { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 13px; color: #fff; line-height: 1; }
.vehicle-immat-text {
  background: #fff;
  color: #111;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.vehicle-meta { font-size: 18px; color: #e1e3e7; margin-bottom: 10px; }
.vehicle-statut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.vehicle-statut.ok   { background: var(--ok-dim);   color: var(--ok); }
.vehicle-statut.warn { background: var(--warn-dim); color: var(--warn); }
.vehicle-warn-badge  { margin-top: 10px; font-size: 13px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.vehicle-selected-tick {
  position: absolute;
  top: 16px; right: 16px;
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #0B0E15;
  font-weight: 700;
}
.vehicle-card.selected .vehicle-selected-tick { display: flex; }

/* ── KM input ───────────────────────────────────────────────────────── */
.km-block { margin-bottom: 20px; }
.km-block label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e1e3e7;
  margin-bottom: 8px;
}
.km-input {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid #459bac;
  border-radius: var(--r);
  color: #e1e3e7;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.km-input::placeholder { color: #b0b8c4; font-weight: 400; font-size: 15px; }
.km-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,166,35,0.25); }

/* ── Trajet screen (Screen 5) ───────────────────────────────────────── */
.trajet-check {
  width: 80px; height: 80px;
  background: var(--ok-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
  animation: pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.trajet-nom {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.trajet-greeting {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
}
.trajet-id-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
  max-width: 320px;
}
.trajet-id-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.trajet-id-value {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.trajet-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ok);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 8px;
}

/* ── Alert banners ──────────────────────────────────────────────────── */
.alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert.visible { display: flex; }
.alert-icon    { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-text    { flex: 1; }
.alert-error   { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,77,77,0.3); }
.alert-warn    { background: var(--warn-dim);   color: var(--warn);   border: 1px solid rgba(255,140,0,0.3); }
.alert-permis  { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,77,77,0.3); }

/* ── Loading overlay ────────────────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,14,21,0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.loading-overlay.active { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Scan screen (Screen 1) ─────────────────────────────────────────── */
#screen-scan { position: relative; overflow: hidden; }
.scan-video-wrap { position: relative; flex: 1; overflow: hidden; background: #000; }
#scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
#scan-canvas { display: none; }

.scan-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scan-mask-top, .scan-mask-bottom { width: 100%; background: rgba(11,14,21,0.6); }
.scan-mask-top    { flex: 1; }
.scan-mask-bottom { flex: 1; }
.scan-middle      { display: flex; align-items: center; width: 100%; }
.scan-mask-side   { flex: 1; height: 240px; background: rgba(11,14,21,0.6); }
.scan-frame       { width: 240px; height: 240px; position: relative; flex-shrink: 0; }

/* Corner brackets */
.scan-frame::before, .scan-frame::after, .scan-corner-bl, .scan-corner-br {
  content: ''; position: absolute;
  width: 28px; height: 28px;
  border-color: var(--accent);
  border-style: solid;
}
.scan-frame::before { top: 0;    left: 0;  border-width: 3px 0 0 3px; }
.scan-frame::after  { top: 0;    right: 0; border-width: 3px 3px 0 0; }
.scan-corner-bl     { bottom: 0; left: 0;  border-width: 0 0 3px 3px; }
.scan-corner-br     { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

/* Scanning line animation */
.scan-line {
  position: absolute;
  left: 4px; right: 4px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scan-move 2s ease-in-out infinite;
  opacity: 0.9;
}
@keyframes scan-move {
  0%   { top: 8px;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 228px; opacity: 0; }
}
.scan-footer { padding: 20px 20px 28px; background: var(--bg); flex-shrink: 0; }
.scan-hint {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 16px;
  letter-spacing: 0.04em;
  text-align: center; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 14px;
}
.scan-hint .hl { color: var(--accent); }
.scan-error-block { display: none; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px; text-align: center; }
.scan-error-block.visible { display: flex; }
.scan-error-icon { font-size: 48px; }
.scan-error-text { font-size: 15px; color: var(--text-dim); line-height: 1.5; }

/* ── Screen footer ──────────────────────────────────────────────────── */
.screen-footer {
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 20px);
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Verification screen (Screen 4) ─────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.check-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.check-card:active  { transform: scale(0.98); }
.check-card.checked { border-color: var(--ok);   background: var(--ok-dim); }
.check-card.problem { border-color: var(--warn); background: var(--warn-dim); }
.check-card-icon  { font-size: 24px; flex-shrink: 0; }
.check-card-label { flex: 1; font-size: 16px; font-weight: 500; color: var(--text); line-height: 1.3; }
.check-card-tick {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #9BA8BC;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: transparent; font-weight: 700; font-size: 16px;
}
.check-card.checked .check-card-tick { background: var(--ok);   border-color: var(--ok);   color: #0B0E15; }
.check-card.problem .check-card-tick { background: var(--warn); border-color: var(--warn); color: #0B0E15; }

.damage-row { display: flex; gap: 10px; margin-bottom: 20px; }
.damage-row .btn { flex: 1; min-height: 56px; font-size: 16px; }
.damage-row .btn-yes { border-color: var(--warn); color: var(--warn); background: var(--surface2); }

.damage-report {
  display: none; flex-direction: column; gap: 12px;
  padding: 18px;
  background: var(--surface); border: 1px solid var(--warn);
  border-radius: var(--r); margin-bottom: 20px;
}
.damage-report.visible { display: flex; }
.damage-textarea {
  width: 100%; min-height: 100px; padding: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text); font-family: 'Barlow', sans-serif;
  font-size: 16px; resize: vertical; outline: none;
}
.damage-textarea:focus { border-color: var(--accent); }
.damage-textarea::placeholder { color: var(--text-dim); }
#damage-photo-preview { width: 100%; max-height: 240px; object-fit: contain; border-radius: var(--r-sm); background: var(--surface2); }

/* ── Scroll-to-top button ───────────────────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 100px; right: 16px;
  width: 40px; height: 40px;
  background: var(--accent); color: #0B0E15;
  border: none; border-radius: 50%;
  font-size: 18px; font-weight: 700; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 9999; transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.scroll-top.visible { display: flex; }
.scroll-top:active  { transform: scale(0.92); }

/* ── Legal footer ───────────────────────────────────────────────────── */
.ib-legal-footer {
  margin-top: auto;
  padding: 18px 20px 24px;
  background: transparent;
  border-top: 1px solid rgba(48,54,61,0.5);
  color: #6e7681;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}
.ib-legal-footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.ib-legal-footer a {
  color: #8b949e; text-decoration: none;
  border-bottom: 1px dotted rgba(240,165,0,0.3);
  padding-bottom: 1px;
  transition: color 0.12s, border-color 0.12s;
}
.ib-legal-footer a:hover,
.ib-legal-footer a:focus-visible { color: #f0a500; border-bottom-color: #f0a500; }
.ib-legal-footer a:focus-visible  { outline: 2px solid #f0a500; outline-offset: 2px; border-radius: 2px; }
.ib-legal-footer .ib-legal-copy   { color: #6e7681; font-size: 12px; }
.ib-legal-footer span[aria-hidden]{ color: #30363d; }
@media (max-width: 600px) {
  .ib-legal-footer { padding: 14px 12px 18px; font-size: 12px; }
  .ib-legal-footer-inner { gap: 6px; }
}
@media (min-width: 520px) {
  body { flex-wrap: wrap; }
  .ib-legal-footer { flex-basis: 100%; }
}

