@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: oklch(98% 0.01 30);
  --ink: oklch(25% 0.02 30);
  --ink-soft: oklch(45% 0.02 30);
  /* Palette DIAKY PREMIUM TERMINAL — sarcelle/teal (couleur de marque du logo DIAKY), en
     remplacement du rouge/bordeaux hérité de l'ancienne identité. Noms de variables
     "--teal-*" conservés tels quels pour ne toucher aucune règle CSS ci-dessous. */
  --teal-900: #0E4A4A;
  --teal-700: #146666;
  --teal-500: #1EA7A7;
  --gold: oklch(72% 0.11 75);
  --line: oklch(88% 0.02 30);
  --white: oklch(100% 0 0);
  --danger: oklch(55% 0.18 25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}

.serif { font-family: 'Playfair Display', serif; }

a { color: inherit; }

/* ---------- Écran de connexion ---------- */

.login-screen {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  /* CORRECTIF (06/09/2026) : n'occupe plus tout l'écran en flex centré (qui poussait une
     grande carte opaque par-dessus les photos) — sert uniquement de conteneur positionnel
     pour la barre flottante, ancrée en bas, voir .login-float ci-dessous. */
}

/* ---------- Barre d'accès flottante (06/09/2026) ----------
   Remplace l'ancienne carte pleine, opaque et centrée, qui masquait la quasi-totalité du
   carrousel photo. Verre dépoli compact, ancré en bas de l'écran : le code reste saisissable
   en permanence, sans jamais rivaliser avec les photos et leurs slogans en plein écran. */
.login-float {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  width: min(92vw, 460px);
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  animation: fadeUp 0.7s ease-out both;
}

.login-float img.logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  padding: 3px;
  flex-shrink: 0;
}

.login-float form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.login-float .field-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Petite identité de marque, discrète, fixe en haut à gauche — remplace le grand titre
   centré de l'ancienne carte (qui n'a plus lieu d'être une fois la carte retirée). */
.brand-mark {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
}

.brand-mark img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  padding: 3px;
}

.brand-mark span {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

/* ---------- Carrousel d'accueil (photos DIAKY TRANSPORT & LOGISTIQUE) ---------- */

.accueil-carrousel {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--teal-900);
}

.accueil-carrousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.8s ease, transform 9s ease;
}

.accueil-carrousel-slide.active {
  opacity: 1;
  transform: scale(1);
}

/* CORRECTIF (06/09/2026, demande client : "afficher les images animées... sans gêner
   l'animation des images d'accueil avec les slogans") — le voile précédent (jusqu'à 88%
   d'opacité, uniforme sur toute l'image) écrasait quasiment les photos et leurs slogans déjà
   intégrés (ex. "Un voyage apaisant" sur voyage-apaisant.jpg), donnant l'impression d'un fond
   uni plutôt que d'une vraie animation. Assombri UNIQUEMENT en haut (pour que le futur bouton
   "Se connecter" flottant, en haut à droite, reste lisible) et en bas (pour la petite barre
   d'accès flottante) ; le centre de l'image, où vivent les photos et leurs slogans, reste
   pleinement visible. */
.accueil-carrousel-voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11,46,46,0.55) 0%,
    rgba(11,46,46,0.08) 22%,
    rgba(11,46,46,0.04) 62%,
    rgba(11,46,46,0.62) 100%
  );
}

.field-wrap .code-input {
  width: 100%;
  padding: 11px 38px 11px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  text-align: left;
}

.field-wrap .code-input::placeholder { color: var(--ink-soft); }

.code-input:focus {
  outline: 2px solid var(--teal-500);
  outline-offset: 1px;
}

.login-btn {
  flex-shrink: 0;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: var(--teal-500);
  color: var(--teal-900);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.login-btn:hover { background: var(--white); }
.login-btn:active { transform: scale(0.97); }
.login-btn:disabled { opacity: 0.6; cursor: wait; }

.error-msg {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--white);
  background: rgba(200,40,40,0.85);
  backdrop-filter: blur(6px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.error-msg:empty { display: none; }

@keyframes fadeUp {
  0% { opacity: 0; transform: translate(-50%, 16px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Interfaces internes ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .brand img {
  width: 34px;
  border-radius: 4px;
}

.app-header .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  /* CORRECTIF (04/08/2026, demande client) : teal-900 (oklch 20% de luminosité) se lisait
     visuellement comme du texte noir plutôt que "en couleur" — passé à teal-500, nettement
     plus vif, tout en restant dans la palette de marque (cohérent avec .login-title). */
  color: var(--teal-500);
}

.app-header .domain-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.logout-btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-soft);
}

.logout-btn:hover { border-color: var(--teal-500); color: var(--teal-700); }

/* Boutons compagnies (06/09/2026) — voir js/compagnies.js. Rail horizontal, défilable si
   jamais plus de 5 compagnies actives (le réglage recommande de n'en garder que 5, mais
   rien ne l'impose techniquement). */
.compagnies-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px;
  flex: 1;
  min-width: 0;
}

.compagnie-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.compagnie-btn:hover {
  border-color: var(--teal-500);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.compagnie-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #eee;
}

.compagnie-btn .compagnie-nom {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compagnie-btn .compagnie-quai {
  font-size: 10px;
  font-weight: 500;
  color: var(--teal-500);
  white-space: nowrap;
}

.app-hero {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.app-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.55));
}

.app-hero-title {
  position: relative;
  z-index: 1;
  padding: 28px 32px;
  color: var(--white);
}

.app-hero-title .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.app-hero-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  margin: 4px 0 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  padding: 32px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
}

.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--teal-900);
  margin-top: 6px;
}

.panel {
  margin: 0 32px 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
}

.panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  margin: 0 0 14px;
  color: var(--teal-900);
}

.panel p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
