/* ─── Movalet Design System ─────────────────────────────────────────── */
:root {
  --indigo:      #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-light:#e0e7ff;
  --purple:      #a855f7;
  --dark:        #1e1b4b;
  --text:        #374151;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --bg:          #f9fafb;
  --white:       #ffffff;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 25px rgba(0,0,0,.1);
  --transition:  .2s ease;
}

/* ─── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); background: var(--white); line-height: 1.6; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ─── Typography ────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.35rem, 3.5vw, 2.2rem); font-weight: 700; line-height: 1.25; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

/* ─── Utilities ─────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.badge { display: inline-flex; align-items: center; padding: .25rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 600; letter-spacing: .03em; }
.badge-indigo  { background: var(--indigo-light); color: var(--indigo-dark); }
.badge-green   { background: #d1fae5; color: #065f46; }
.badge-yellow  { background: #fef3c7; color: #92400e; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-gray    { background: #f3f4f6; color: #374151; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.35rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); white-space: nowrap; }
.btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.btn-primary   { background: var(--indigo); color: var(--white); }
.btn-primary:hover { background: var(--indigo-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.btn-outline   { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn-outline:hover { background: var(--indigo); color: var(--white); }
.btn-white     { background: var(--white); color: var(--indigo-dark); }
.btn-white:hover { background: var(--indigo-light); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-sm        { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg        { padding: .9rem 2rem; font-size: 1rem; }
.btn-full      { width: 100%; justify-content: center; }

/* ─── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-control { width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--text); font-size: .95rem; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 2.6rem; }
.input-icon .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .95rem; pointer-events: none; }

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg); }

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 1.25rem; }
.navbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.3rem; color: var(--dark); }
.brand-logo { width: 36px; height: 36px; background: linear-gradient(135deg, var(--indigo), var(--purple)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 1rem; }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-link { padding: .5rem .85rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; color: var(--text); transition: all var(--transition); }
.nav-link:hover, .nav-link.active { background: var(--indigo-light); color: var(--indigo-dark); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .4rem; border: none; background: none; }
.hamburger span { width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: all var(--transition); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.mobile-nav { display: none; position: fixed; inset: 64px 0 0 0; background: var(--white); z-index: 99; padding: 1.5rem; border-top: 1px solid var(--border); flex-direction: column; gap: 1rem; overflow-y: auto; }
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { padding: .85rem 1rem; font-size: 1rem; border-radius: var(--radius); border: 1px solid transparent; }
.mobile-nav .nav-link:hover { border-color: var(--border); }
.mobile-nav .nav-divider { height: 1px; background: var(--border); margin: .5rem 0; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--white); cursor: pointer; font-size: .85rem; font-weight: 500; transition: all var(--transition); }
.user-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--indigo); color: white; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.user-dropdown { display: none; position: absolute; top: calc(100% + .5rem); right: 0; min-width: 190px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem 0; }
.user-dropdown.open { display: block; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; font-size: .85rem; color: var(--text); width: 100%; background: none; border: none; cursor: pointer; text-align: left; transition: background var(--transition); }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); color: var(--indigo); }
.user-dropdown .divider { height: 1px; background: var(--border); margin: .4rem 0; }

/* ─── Hero ──────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--dark) 0%, #312e81 60%, #4c1d95 100%); color: var(--white); padding: 5rem 0 4rem; position: relative; overflow: hidden; }
.hero::before { content:''; position:absolute; inset:0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Cg opacity='.06'%3E%3Ccircle cx='600' cy='100' r='300' fill='%23fff'/%3E%3Ccircle cx='100' cy='500' r='200' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E") center/cover; }
.hero .container { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-tag { display: inline-block; background: rgba(255,255,255,.15); padding: .3rem .9rem; border-radius: 99px; font-size: .8rem; font-weight: 600; letter-spacing: .05em; margin-bottom: 1.25rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.8); margin-bottom: 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat-value { font-size: 1.8rem; font-weight: 800; }
.hero-stat-label { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: .1rem; }

/* ─── Search Card ──────────────────────────────────────────────────── */
.search-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.75rem; }
.search-card h3 { font-size: 1.1rem; margin-bottom: 1.25rem; color: var(--dark); }
.search-divider { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; }
.search-divider .line { flex: 1; height: 1px; background: var(--border); }
.trip-swap { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; flex-shrink: 0; font-size: .8rem; transition: all var(--transition); }
.trip-swap:hover { background: var(--indigo); color: white; border-color: var(--indigo); }
.mode-tabs { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: .25rem; gap: .25rem; margin-bottom: 1.25rem; }
.mode-tab { flex: 1; text-align: center; padding: .5rem; border-radius: 6px; font-size: .82rem; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--muted); transition: all var(--transition); }
.mode-tab.active { background: var(--white); color: var(--indigo-dark); box-shadow: var(--shadow); }

/* ─── Sections ──────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-dark { background: var(--dark); color: var(--white); }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title .label { display: inline-block; background: var(--indigo-light); color: var(--indigo-dark); padding: .3rem .9rem; border-radius: 99px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; margin-bottom: .75rem; }

/* ─── How It Works ──────────────────────────────────────────────────── */
.step-card { text-align: center; padding: 2rem 1.5rem; }
.step-num { width: 56px; height: 56px; background: var(--indigo); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1.2rem; margin: 0 auto 1.25rem; box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.step-card h3 { margin-bottom: .6rem; }

/* ─── Driver Cards ──────────────────────────────────────────────────── */
.driver-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: all var(--transition); }
.driver-card:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-light); transform: translateY(-2px); }
.driver-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo), var(--purple)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1.2rem; flex-shrink: 0; }
.driver-info { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.driver-name { font-weight: 700; font-size: 1rem; }
.driver-vehicle { font-size: .8rem; color: var(--muted); }
.stars { color: var(--warning); font-size: .85rem; }
.rating-badge { font-size: .78rem; font-weight: 600; color: var(--text); margin-left: .25rem; }

/* ─── Offer Card ────────────────────────────────────────────────────── */
.offer-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; transition: all var(--transition); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.offer-card:hover { border-color: var(--indigo); box-shadow: var(--shadow-md); }
.offer-card.best { border-color: var(--success); background: #f0fdf4; }
.offer-card.best::before { content: 'Meilleure offre'; font-size: .7rem; font-weight: 700; color: var(--success); display: block; margin-bottom: .5rem; letter-spacing: .05em; }
.offer-price { font-size: 1.5rem; font-weight: 800; color: var(--indigo-dark); white-space: nowrap; }

/* ─── Countdown ─────────────────────────────────────────────────────── */
.countdown-bar { background: linear-gradient(135deg, var(--warning) 0%, #f97316 100%); color: white; padding: 1rem 1.5rem; border-radius: var(--radius); text-align: center; margin-bottom: 1.5rem; }
.countdown-timer { font-size: 2rem; font-weight: 900; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.countdown-label { font-size: .8rem; opacity: .85; margin-top: .2rem; }
.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ─── Trip Timeline ─────────────────────────────────────────────────── */
.trip-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all var(--transition); }
.trip-card:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-light); }
.trip-card-header { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--bg); }
.trip-route { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.25rem; }
.trip-point { display: flex; align-items: center; gap: .75rem; }
.trip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.trip-dot.origin { background: var(--indigo); }
.trip-dot.destination { background: var(--success); }
.trip-line { width: 2px; height: 20px; background: var(--border); margin-left: 4px; }
.trip-meta { display: flex; flex-wrap: wrap; gap: .75rem; padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg); font-size: .8rem; color: var(--muted); }
.trip-meta span { display: flex; align-items: center; gap: .3rem; }

/* ─── Portal Layout ─────────────────────────────────────────────────── */
.portal-wrap { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 240px; background: var(--dark); color: var(--white); flex-shrink: 0; display: flex; flex-direction: column; padding: 1.5rem 1rem; gap: .25rem; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.sidebar-title { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: rgba(255,255,255,.4); padding: 1rem .75rem .4rem; text-transform: uppercase; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border-radius: var(--radius-sm); font-size: .88rem; color: rgba(255,255,255,.7); transition: all var(--transition); cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-link.active { background: var(--indigo); color: white; }
.portal-main { flex: 1; padding: 2rem; overflow: hidden; }
.portal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.portal-header h1 { font-size: 1.6rem; color: var(--dark); }
.portal-toggle { display: none; position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 200; width: 48px; height: 48px; background: var(--dark); color: white; border: none; border-radius: 50%; cursor: pointer; font-size: 1.1rem; box-shadow: var(--shadow-lg); }

/* ─── Stat Cards ─────────────────────────────────────────────────────── */
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-icon.indigo  { background: var(--indigo-light); color: var(--indigo); }
.stat-icon.green   { background: #d1fae5; color: var(--success); }
.stat-icon.yellow  { background: #fef3c7; color: var(--warning); }
.stat-icon.purple  { background: #f3e8ff; color: var(--purple); }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); }

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th { padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: .9rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); display: flex; gap: .75rem; font-size: .88rem; border-left: 3px solid; margin-bottom: 1rem; }
.alert-success { background: #f0fdf4; border-color: var(--success); color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer { background: var(--dark); color: rgba(255,255,255,.7); padding: 3rem 0 1.5rem; }
footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
footer .footer-brand p { font-size: .85rem; margin-top: .75rem; max-width: 260px; line-height: 1.7; }
footer .footer-col h4 { color: white; font-size: .85rem; font-weight: 700; margin-bottom: 1rem; }
footer .footer-col a { display: block; font-size: .83rem; margin-bottom: .5rem; transition: color var(--transition); }
footer .footer-col a:hover { color: white; }
footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .78rem; }

/* ─── Auth Pages ─────────────────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 2rem 1.25rem; }
.auth-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 2.5rem 2rem; width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .brand { justify-content: center; font-size: 1.5rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; }
.auth-divider span { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.auth-divider .line { flex: 1; height: 1px; background: var(--border); }

/* ─── Empty State ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { color: var(--text); margin-bottom: .5rem; }

/* ─── Toast ──────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--dark); color: white; padding: .85rem 1.25rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .85rem; max-width: 320px; display: flex; align-items: center; gap: .75rem; animation: slideIn .25s ease; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  footer .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links, .nav-actions .btn-outline { display: none; }
  .hamburger { display: flex; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero .search-card { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .portal-wrap { flex-direction: column; }
  .sidebar { display: none; width: 100%; position: fixed; top: 64px; left: 0; height: auto; max-height: 70vh; z-index: 99; border-radius: 0 0 var(--radius) var(--radius); }
  .sidebar.mobile-open { display: flex; }
  .portal-main { padding: 1.25rem; }
  .portal-toggle { display: flex; align-items: center; justify-content: center; }
  footer .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .offer-card { flex-direction: column; align-items: flex-start; }
  .table-wrap { font-size: .78rem; }
  thead th, tbody td { padding: .6rem .75rem; }
  .stat-card { padding: 1.1rem; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .btn { padding: .6rem 1.1rem; font-size: .85rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .search-card { padding: 1.25rem; }
  .grid-4 { grid-template-columns: 1fr; }
}
