/* MyMlm – Stylesheet (mobile-first, monochrome) */

:root {
    --black: #000;
    --white: #fff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #ebebeb;
    --gray-300: #d4d4d4;
    --gray-500: #737373;
    --gray-700: #404040;
    --gray-900: #171717;
    --green: #16a34a;
    --red: #dc2626;
    --sheet-radius: 28px;
    --shadow-soft: 0 -8px 32px rgba(0,0,0,.08);
    --shadow-card: 0 2px 12px rgba(0,0,0,.06);
    --shadow-fab: 0 4px 16px rgba(0,0,0,.12);
    --ease: cubic-bezier(.32,.72,0,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    background: var(--white);
    color: var(--black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ===== TOPBAR ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: calc(60px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}
.topbar.dark {
    background: var(--black); color: var(--white);
    border-bottom-color: rgba(255,255,255,.1);
}
.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; background: var(--white);
    box-shadow: var(--shadow-card); transition: transform .15s var(--ease);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; }
.topbar.dark .icon-btn { background: rgba(255,255,255,.08); box-shadow: none; }

.brand-mark {
    font-weight: 500; font-size: 18px; letter-spacing: -.02em;
    display: inline-flex; align-items: center; gap: 8px;
}
.brand-mark strong { font-weight: 800; }
.brand-mark .badge {
    font-size: 9px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; padding: 3px 8px;
    border: 1px solid currentColor; border-radius: 100px; font-style: normal;
}

.topnav { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.link-muted { color: var(--gray-500); font-weight: 500; }
.link-muted:hover { color: var(--black); }
.hello { color: var(--gray-700); font-weight: 500; }

/* ===== HOME ===== */
.page-home { background: var(--white); min-height: 100vh; }
.hero {
    padding: calc(80px + env(safe-area-inset-top)) 24px 32px;
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
}
.hero-inner { max-width: 480px; margin: 0 auto; width: 100%; }
.hero-title {
    font-size: clamp(40px, 12vw, 64px);
    font-weight: 800; line-height: .95; letter-spacing: -.04em; margin-bottom: 12px;
}
.hero-title .thin { font-weight: 300; }
.hero-sub { color: var(--gray-500); font-size: 16px; margin-bottom: 32px; font-weight: 400; }

.search-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 20px;
    padding: 8px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}
.field {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 14px; border-radius: 14px;
    transition: background .15s var(--ease);
}
.field:focus-within { background: var(--gray-50); }
.field-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.field-dot.pickup { border: 3px solid var(--black); background: var(--white); }
.field-dot.dropoff { background: var(--black); position: relative; }
.field-dot.dropoff::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--white); }
.field input {
    flex: 1; min-width: 0; background: transparent; border: none; outline: none;
    font-size: 16px; font-weight: 500; color: var(--black);
}
.field input::placeholder { color: var(--gray-500); font-weight: 400; }
.field-action {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gray-100); color: var(--black);
    transition: background .15s var(--ease), transform .15s var(--ease);
}
.field-action:active { transform: scale(.92); background: var(--gray-200); }
.field-action svg { width: 16px; height: 16px; stroke-linecap: round; }
.field-divider {
    height: 1px; background: var(--gray-200); margin: 0 14px;
}

.suggestions {
    list-style: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    background: var(--white); border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    max-height: 260px; overflow-y: auto;
    z-index: 100;
    display: none;
}
.suggestions.open { display: block; }
.suggestions li {
    padding: 12px 16px; font-size: 14px; cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.4;
}
.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover, .suggestions li.active { background: var(--gray-50); }

.cta {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--black); color: var(--white);
    padding: 18px; border-radius: 100px;
    font-size: 15px; font-weight: 600;
    margin-top: 4px;
    transition: transform .15s var(--ease), opacity .2s var(--ease);
}
.cta:active { transform: scale(.97); }
.cta:disabled { opacity: .4; cursor: not-allowed; }
.cta svg { width: 16px; height: 16px; stroke-linecap: round; stroke-linejoin: round; }

.hint {
    display: flex; align-items: center; gap: 6px;
    color: var(--gray-500); font-size: 12px; padding: 4px 8px;
}
.hint svg { stroke-linecap: round; }

/* ===== MAP ===== */
.map-shell {
    position: fixed; inset: 0; z-index: 1;
}
#map {
    width: 100%; height: 100%;
    background: var(--gray-100);
    filter: grayscale(1) contrast(1.05);
}
.leaflet-control-attribution {
    font-family: 'Poppins', sans-serif !important; font-size: 9px !important;
    background: rgba(255,255,255,.7) !important; backdrop-filter: blur(8px);
}
.leaflet-control-zoom { display: none; }

.live-pill {
    position: fixed; top: calc(76px + env(safe-area-inset-top)); left: 16px;
    z-index: 500;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: var(--black); color: var(--white);
    border-radius: 100px; font-size: 11px; font-weight: 600; letter-spacing: .08em;
}
.pulse {
    width: 6px; height: 6px; border-radius: 50%; background: var(--white);
    animation: pulse 1.5s var(--ease) infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%     { opacity: .4; transform: scale(.8); }
}
.recenter {
    position: fixed; right: 16px; bottom: calc(45vh + 16px); z-index: 500;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--white); color: var(--black);
    display: grid; place-items: center;
    box-shadow: var(--shadow-fab);
    transition: transform .15s var(--ease);
}
.recenter:active { transform: scale(.92); }
.recenter svg { width: 20px; height: 20px; stroke-linecap: round; }

/* ===== BOTTOM SHEET ===== */
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: var(--white);
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    box-shadow: var(--shadow-soft);
    padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
    max-height: 75vh; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.sheet-handle {
    width: 36px; height: 4px; background: var(--gray-300);
    border-radius: 2px; margin: 0 auto 16px;
}

.status-block { margin-bottom: 20px; }
.status-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.status-label { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.eta { display: flex; align-items: baseline; gap: 4px; }
.eta-num { font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.eta-unit { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.progress { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--black); border-radius: 2px; transition: width .8s var(--ease); }
.status-sub { margin-top: 10px; font-size: 13px; color: var(--gray-500); }

/* Driver Card */
.driver-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--gray-50);
    border-radius: 16px; margin-bottom: 16px;
}
.avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--black); color: var(--white);
    display: grid; place-items: center; font-weight: 600; font-size: 18px;
    flex-shrink: 0;
}
.driver-info { flex: 1; min-width: 0; }
.driver-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.driver-meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gray-500); }
.driver-meta .star { width: 11px; height: 11px; color: var(--black); }
.driver-meta .dot { margin: 0 2px; }
.plate { text-align: right; flex-shrink: 0; }
.plate-car { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }
.plate-num {
    font-size: 13px; font-weight: 700;
    padding: 4px 8px; background: var(--white);
    border: 1.5px solid var(--black); border-radius: 6px;
    display: inline-block; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}

/* Route */
.route {
    position: relative; padding: 16px 0;
    border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200);
    margin-bottom: 16px;
}
.route-line {
    position: absolute; left: 7px; top: 28px; bottom: 28px; width: 2px;
    background: repeating-linear-gradient(to bottom, var(--gray-300) 0, var(--gray-300) 3px, transparent 3px, transparent 6px);
}
.route-stop { display: flex; align-items: center; gap: 14px; padding: 8px 0; position: relative; }
.stop-marker { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; z-index: 1; background: var(--white); }
.stop-marker.pickup { border: 4px solid var(--black); }
.stop-marker.dropoff { background: var(--black); position: relative; }
.stop-marker.dropoff::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--white); }
.stop-text { flex: 1; min-width: 0; }
.stop-label { font-size: 11px; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.stop-addr { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-time { font-size: 12px; color: var(--gray-700); font-weight: 500; }

/* Summary */
.summary { padding: 4px 0; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.summary-row span:first-child { color: var(--gray-500); }
.summary-row span:last-child, .summary-row select { font-weight: 500; font-variant-numeric: tabular-nums; }
.summary-row.total { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--gray-200); font-size: 16px; }
.summary-row.total span:first-child { color: var(--black); font-weight: 600; }
.summary-row.total span:last-child { font-weight: 700; }
.select-inline {
    border: none; background: transparent; font-size: 14px; font-weight: 500;
    text-align: right; padding-right: 4px; cursor: pointer;
}

/* Book Form */
.book-form { margin-top: 16px; }
.form-row { margin-bottom: 10px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.book-form input {
    width: 100%; padding: 14px 16px;
    background: var(--gray-50); border: 1.5px solid var(--gray-200);
    border-radius: 12px; font-size: 14px; font-weight: 500;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.book-form input:focus { outline: none; border-color: var(--black); background: var(--white); }
.note { margin-top: 12px; font-size: 12px; color: var(--gray-500); text-align: center; min-height: 16px; }
.note.success { color: var(--green); font-weight: 500; }
.note.error   { color: var(--red);   font-weight: 500; }

/* ===== AUTH PAGES ===== */
.page-auth { background: var(--white); min-height: 100vh; }
.auth {
    padding: calc(100px + env(safe-area-inset-top)) 24px 40px;
    max-width: 420px; margin: 0 auto;
}
.auth-title { font-size: 36px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-sub { color: var(--gray-500); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
    width: 100%; padding: 16px;
    background: var(--gray-50); border: 1.5px solid var(--gray-200);
    border-radius: 12px; font-size: 15px; font-weight: 500;
}
.auth-form input:focus { outline: none; border-color: var(--black); background: var(--white); }
.auth-form .cta { margin-top: 8px; }
.auth-link { text-align: center; margin-top: 20px; font-size: 13px; color: var(--gray-500); }
.auth-link a { color: var(--black); font-weight: 600; }
.auth-error {
    background: #fef2f2; color: #991b1b; padding: 12px 16px;
    border-radius: 12px; font-size: 14px; margin-bottom: 16px;
}
.auth-help { text-align: center; margin-top: 24px; font-size: 12px; color: var(--gray-500); }
.auth-help code { background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-family: 'Poppins', monospace; font-size: 11px; }

/* ===== DRIVER ===== */
.driver-theme { background: var(--gray-900); }
.driver-theme .sheet { background: var(--white); }
.driver-greeting {
    font-size: 14px; color: var(--gray-700);
    margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;
}
.online-status {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
    padding: 4px 10px; border-radius: 100px;
    background: var(--gray-100); color: var(--gray-500);
}
.online-status.online { background: var(--black); color: var(--white); }
.online-toggle {
    position: relative; width: 48px; height: 28px;
    border-radius: 100px; background: rgba(255,255,255,.15);
    cursor: pointer; transition: background .2s var(--ease);
}
.online-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.online-toggle span {
    position: absolute; top: 3px; left: 3px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--white); transition: transform .2s var(--ease);
}
.online-toggle input:checked ~ span { transform: translateX(20px); }
.online-toggle:has(input:checked) { background: var(--green); }

.section-title { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 12px; }
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state { padding: 32px 16px; text-align: center; color: var(--gray-500); font-size: 14px; }

.job-card {
    border: 1.5px solid var(--gray-200); border-radius: 16px;
    padding: 14px; background: var(--white); cursor: pointer;
    transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.job-card:active { transform: scale(.98); }
.job-card:hover { border-color: var(--black); }
.job-meta { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; color: var(--gray-500); }
.job-price { font-size: 18px; font-weight: 800; }
.job-addresses { font-size: 13px; line-height: 1.5; }
.job-addresses .from { color: var(--gray-700); }
.job-addresses .to { font-weight: 600; }

.active-job { padding: 4px 0; }
.job-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.job-status {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    background: var(--black); color: var(--white);
    padding: 4px 10px; border-radius: 100px;
}
.job-id { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.job-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.job-actions.split { grid-template-columns: 1fr 1fr; }
.btn-primary, .btn-secondary {
    padding: 14px; border-radius: 100px;
    font-size: 14px; font-weight: 600;
    transition: transform .15s var(--ease);
}
.btn-primary { background: var(--black); color: var(--white); }
.btn-secondary { background: var(--gray-100); color: var(--black); }
.btn-primary:active, .btn-secondary:active { transform: scale(.97); }

/* ===== ANIMATIONS ===== */
.eta-num.updated, .status-label.updated { animation: bump .5s var(--ease); }
@keyframes bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); opacity: .7; }
    100% { transform: scale(1); }
}

/* ===== TABLET+ ===== */
@media (min-width: 768px) {
    .sheet {
        left: auto; right: 16px; bottom: 16px;
        width: 400px; border-radius: var(--sheet-radius);
        max-height: calc(100vh - 92px);
        box-shadow: 0 16px 48px rgba(0,0,0,.12);
    }
    .recenter { bottom: 32px; right: 432px; }
}
@media (min-width: 1024px) {
    .sheet { width: 440px; right: 24px; bottom: 24px; }
    .recenter { right: 480px; bottom: 40px; }
}
