/* =========================================================
   co-voiturage.tn — design system
   Poppins (titres) + Inter (texte) + IBM Plex Mono (prix/data)
   Palette officielle du logo : Sidi Bou Said Blue #1F75D8, Deep Blue #0F4C81
   ========================================================= */
:root {
  --bg: #F4F6F9;
  --bg-alt: #E9EEF5;
  --paper: #FFFFFF;
  --ink: #12212E;
  --muted: #4E6270;
  --brand: #1F75D8;        /* Sidi Bou Said Blue — couleur officielle du logo */
  --brand-dark: #0F4C81;   /* Deep Blue — logo officiel */
  --brand-light: #E9F1FC;
  --accent: #0F4C81;
  --accent-light: #E9F1FC;
  --line: rgba(18, 33, 46, 0.12);
  --radius: 18px;
  --shadow: 0 4px 20px rgba(18, 33, 46, 0.06);
  --shadow-hover: 0 14px 32px -12px rgba(18, 33, 46, 0.18);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h5, h6 { letter-spacing: -0.01em; }

p { color: var(--ink); }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand-dark);
  background: var(--brand-light);
  padding: .35rem .75rem;
  border-radius: 999px;
  margin-bottom: .6rem;
}
.section-eyebrow-dark {
  color: #9CC3EC;
  background: rgba(255,255,255,0.08);
}

/* Badge "Dernière minute" — pulsation douce pour attirer l'œil sans être agressive */
.pulse-badge {
  animation: pulse-badge 1.8s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,117,216,0.55); }
  50% { box-shadow: 0 0 0 8px rgba(31,117,216,0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-badge { animation: none; }
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

.mono, .price, .badge { font-family: 'IBM Plex Mono', monospace; }

/* ================= Navbar ================= */
.navbar {
  background: rgba(244, 246, 249, 0.88) !important;
  backdrop-filter: blur(10px);
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, background .2s ease;
}
.navbar.is-scrolled {
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 8px 24px -16px rgba(18,33,46,0.25);
}
.navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 9px;
  color: var(--ink) !important;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}
.navbar-brand .tn-chip { color: var(--brand-dark); }
.navbar .nav-link {
  color: var(--muted) !important;
  font-weight: 500;
  padding: .5rem .85rem !important;
  border-radius: 999px;
}
.navbar .nav-link:hover {
  background: var(--brand-light);
  color: var(--brand-dark) !important;
}
.navbar .btn { border-radius: 999px; }

/* ================= Buttons ================= */
.btn {
  border-radius: 999px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  padding: .65rem 1.4rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(15,76,129,0.45);
}
.btn-outline-primary {
  color: var(--brand-dark);
  border-color: var(--line);
  font-weight: 600;
}
.btn-outline-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(31,117,216,0.4);
}
.btn-search, .hero .btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,0.06);
}
.btn-search:hover, .hero .btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -6px rgba(15,76,129,0.5);
}

/* ================= Forms ================= */
.form-control, .form-select {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: .6rem .85rem;
  background: var(--paper);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.form-label { font-weight: 600; color: var(--muted); font-size: .82rem; }

/* ================= Hero ================= */
.hero {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 3.5rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -180px; right: -160px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(31,117,216,0.10) 0%, rgba(31,117,216,0) 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  position: relative;
}
.hero p.lead-text { color: var(--muted); font-size: 1.08rem; position: relative; }
.hero form {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 16px;
}
.hero-photo {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  aspect-ratio: 16 / 10;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo-badge {
  position: absolute;
  left: 14px; bottom: 14px;
  background: rgba(18,33,46,0.72);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.hero-photo-badge i { color: #6FE0A8; }
@media (max-width: 991px) {
  .hero-photo { margin-top: 1.5rem; aspect-ratio: 16 / 9; }
}

/* ================= Cards ================= */
.ride-card, .auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-divider { display: flex; align-items: center; text-align: center; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--line); }
.auth-divider span { padding: 0 .75rem; }
.ride-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -14px rgba(31,117,216,0.3);
}
.route-line {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--ink);
}
.ride-card-available { border-left: 4px solid var(--accent); }
.ride-card-full { border-left: 4px solid #b3452f; opacity: .85; }

/* Ticket-style cards (trajets à la une, page d'accueil) */
.ticket {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ticket:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -14px rgba(31,117,216,0.35);
  border-color: var(--brand);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  background: var(--bg); border-radius: 50%; top: 58px;
}
.ticket::before { left: -9px; }
.ticket::after { right: -9px; }
.ticket-route { display: flex; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.02rem; margin-bottom: 12px; }
.ticket-route .line {
  flex: 1; height: 1px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 8px);
}
.ticket-price { font-family: 'IBM Plex Mono', monospace; font-size: .75rem; color: var(--muted); }
.ticket-price b { display: block; font-size: 1.35rem; color: var(--ink); font-family: 'Poppins', sans-serif; font-weight: 600; }
.ticket-seats { font-size: .72rem; color: var(--accent); font-weight: 600; background: var(--accent-light); padding: 4px 9px; border-radius: 8px; }

/* Feature / reassurance cards */
.feature-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.25rem;
  height: 100%;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -14px rgba(31,117,216,0.3); color: var(--ink); }
.feature-card i { font-size: 2rem; color: var(--brand-dark); }
.feature-card h5 { margin-top: .75rem; margin-bottom: .4rem; font-family: 'Poppins', sans-serif; }
.feature-card p { color: var(--muted); font-size: .9rem; margin-bottom: 0; }

/* Numbered steps ("Comment ça marche") */
.step-num {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step:nth-child(2) .step-num { background: var(--brand); }
.step:nth-child(3) .step-num { background: var(--accent); }

/* Security / trust band */
.security-band {
  background: var(--ink);
  color: var(--bg);
  border-radius: 24px;
  padding: 2.75rem 2.25rem;
}
.security-band h2 { color: var(--bg); }
.security-band p { color: #C7D0C9; }
.security-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}
.security-item i { color: #9CE0C9; font-size: 1.2rem; }

/* ================= Map ================= */
#map { width: 100%; height: 320px; border-radius: 14px; box-shadow: var(--shadow); }

/* ================= Chat ================= */
.chat-box {
  height: 420px; overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.msg { max-width: 75%; padding: .55rem .9rem; border-radius: 16px; margin-bottom: .6rem; clear: both; font-size: .93rem; }
.msg.mine { background: var(--brand); color: #fff; float: right; border-bottom-right-radius: 4px; }
.msg.theirs { background: var(--bg-alt); color: var(--ink); float: left; border-bottom-left-radius: 4px; }
.msg small { display: block; opacity: .7; font-size: .7rem; margin-top: 3px; }

/* ================= Badges & alerts ================= */
.badge.bg-primary { background: var(--brand) !important; font-weight: 600; }
.badge.bg-success { background: var(--accent) !important; }
.alert { border: none; border-radius: 12px; }
.alert-secondary { background: var(--bg-alt); color: var(--muted); }

/* ================= FAQ accordion ================= */
.accordion-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px !important;
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion-button {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
}
.accordion-button:not(.collapsed) {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: none;
}
.accordion-button:focus { box-shadow: none; border-color: var(--line); }

/* ================= Tabs (bookings.php) ================= */
.nav-tabs { border-bottom: 2px solid var(--line); }
.nav-tabs .nav-link { border: none; color: var(--muted); font-weight: 600; border-radius: 0; padding: .6rem 1rem; }
.nav-tabs .nav-link.active { color: var(--brand-dark); border-bottom: 2px solid var(--brand); background: transparent; }

/* ================= Footer ================= */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); }
.site-footer h6 {
  font-family: 'Inter', sans-serif;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; margin-bottom: .9rem;
}
.site-footer a { color: var(--muted); font-size: .88rem; }
.site-footer a:hover { color: var(--brand-dark); }
.site-footer .footer-bottom { border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* ================= Admin dashboard KPI cards ================= */
.kpi-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; background: var(--paper); }
.kpi-card .kpi-value { font-family: 'Poppins', sans-serif; font-size: 1.7rem; font-weight: 600; color: var(--brand-dark); }
.kpi-card .kpi-label { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.kpi-card.kpi-alert .kpi-value { color: #b3452f; }

/* ================= Notifications ================= */
.notif-badge { position: absolute; top: 2px; right: -2px; font-size: .6rem; padding: .25em .45em; }
.notification-item { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .6rem; background: var(--paper); }
.notification-item.unread { border-left: 4px solid var(--brand); background: var(--brand-light); }

/* ================= List group (messages inbox) ================= */
.list-group-item { border: 1px solid var(--line) !important; border-radius: var(--radius) !important; margin-bottom: .6rem; box-shadow: var(--shadow); background: var(--paper); }
.list-group-item:hover { box-shadow: var(--shadow-hover); }
.list-group-item.unread { border-left: 4px solid var(--brand) !important; background: var(--brand-light); }
