/* ============================================================
 *  Dishtro Delivery (Rider) Panel — Common CSS
 *  File: /delivery/assets/css/main.css
 * ============================================================
 *  Theme : Light dashboard, Indigo primary (#4d5bbd)
 *  Layout: Mobile  → body scrolls, bottom nav
 *          Desktop → fixed left sidebar + scrollable main area
 *  Loaded by: layout/header.php (auto)
 *  Mirrors the proven restaurant-panel structure with
 *  rider-specific add-ons (online-pill, auth/wizard, uploads).
 * ============================================================ */


/* ============================================================
 *  1. CSS VARIABLES
 * ============================================================ */
:root {
    /* Brand — Indigo */
    --d-primary:        #4d5bbd;
    --d-primary-dark:   #3a47a3;
    --d-primary-soft:   #dde1f3;
    --d-primary-tint:   #eff1fc;

    /* Functional */
    --d-success:        #10b981;
    --d-success-soft:   #d1fae5;
    --d-warning:        #f59e0b;
    --d-warning-soft:   #fef3c7;
    --d-danger:         #ef4444;
    --d-danger-soft:    #fee2e2;
    --d-info:           #3b82f6;
    --d-info-soft:      #dbeafe;

    /* Surfaces */
    --shell-bg:         #f7f8fa;
    --card-bg:          #ffffff;
    --card-bd:          rgba(15, 23, 42, 0.08);
    --card-shadow:      0 1px 2px rgba(15, 23, 42, 0.04),
                        0 1px 3px rgba(15, 23, 42, 0.06);
    --card-shadow-h:    0 4px 6px rgba(15, 23, 42, 0.05),
                        0 10px 15px rgba(15, 23, 42, 0.08);

    /* Text */
    --d-text:           #0f172a;
    --d-text-2:         #334155;
    --d-muted:          #64748b;
    --d-muted-2:        #94a3b8;
    --d-text-muted:     #64748b; /* alias for inline-styled pages */

    /* Inputs */
    --input-bg:         #ffffff;
    --input-bd:         #e2e8f0;
    --input-bd-focus:   var(--d-primary);

    /* Sizes */
    --sidebar-w:        248px;
    --topbar-h:         64px;
    --bottom-nav-h:     68px;
    --pad-x:            18px;
    --radius-sm:        8px;
    --radius:           12px;
    --radius-lg:        16px;

    /* Aliases used by inline-styled pages */
    --d-card:           #ffffff;
    --d-border:         rgba(15, 23, 42, 0.08);

    /* Dynamic viewport height */
    --vh-100:           100vh;
}
@supports (height: 100dvh) {
    :root { --vh-100: 100dvh; }
}


/* ============================================================
 *  2. RESET + WIDTH SAFETY
 * ============================================================ */
*, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    max-width: 100%;
}

body, p, span, h1, h2, h3, h4, h5, h6, li, a, label, div, td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

img, video, svg, picture, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

input, textarea, select, button {
    font-family: inherit;
    max-width: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    background: var(--shell-bg);
    color: var(--d-text);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--d-primary-dark); text-decoration: none; }
a:hover { color: var(--d-primary); }


/* ============================================================
 *  3. STAGE LAYOUT
 *  Mobile  : body scrolls,  stage = flex column
 *  Desktop : stage = grid [sidebar | main]
 * ============================================================ */

.stage {
    min-height: var(--vh-100);
    display: flex;
    flex-direction: column;
    background: var(--shell-bg);
}

.scroll-area {
    flex: 1;
    width: 100%;
    padding: 16px var(--pad-x) calc(var(--bottom-nav-h) + 32px);
    display: flex;
    flex-direction: column;
}

/* No-nav (login / register / landing)
   Mobile: align to TOP with safe-area aware padding (no big empty gap above)
   Desktop: per-page inline style draws the centered phone-frame.            */
.stage.no-nav {
    min-height: var(--vh-100);
    display: grid;
    align-content: start;
    justify-items: center;
}
.stage.no-nav .scroll-area {
    position: relative;
    padding: 64px var(--pad-x) 28px;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Desktop layout (≥901px): sidebar + main ===== */
@media (min-width: 901px) {
    .stage {
        display: grid;
        grid-template-columns: var(--sidebar-w) 1fr;
        grid-template-rows: 1fr;
        height: var(--vh-100);
        overflow: hidden;
    }
    .scroll-area {
        grid-column: 2;
        overflow-y: auto;
        padding: 24px 32px 32px;
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
    .stage.no-nav {
        display: grid;
        align-content: start;
        justify-items: center;
        grid-template-columns: 1fr;
    }
    .stage.no-nav .scroll-area {
        padding: 40px var(--pad-x) 40px;
    }
}


/* ============================================================
 *  4. SIDEBAR (desktop) + TOPBAR + BOTTOM-NAV (mobile)
 * ============================================================ */

/* ----- Sidebar (desktop only) ----- */
.sidebar { display: none; }

@media (min-width: 901px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        grid-column: 1;
        background: #fff;
        border-right: 1px solid var(--card-bd);
        height: var(--vh-100);
        position: sticky;
        top: 0;
        padding: 22px 14px;
        gap: 4px;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 10px 22px;
        margin-bottom: 6px;
        border-bottom: 1px solid var(--card-bd);
    }
    .sidebar-brand .logo-dot {
        width: 36px; height: 36px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
        display: grid; place-items: center;
        color: #fff; font-size: 18px;
        box-shadow: 0 4px 10px rgba(77, 91, 189, 0.35);
    }
    .sidebar-brand .brand-text {
        font-weight: 800; font-size: 16px;
        color: var(--d-text); line-height: 1.1;
    }
    .sidebar-brand .brand-sub {
        font-size: 11px; color: var(--d-muted); font-weight: 500;
    }

    .sidebar-nav {
        display: flex; flex-direction: column;
        gap: 2px; margin-top: 10px; flex: 1;
    }
    .sidebar-item {
        display: flex; align-items: center; gap: 12px;
        padding: 11px 14px;
        border-radius: 10px;
        color: var(--d-text-2);
        font-weight: 600; font-size: 13.5px;
        transition: background 0.15s, color 0.15s;
        position: relative;
    }
    .sidebar-item i {
        font-size: 18px; color: var(--d-muted);
        transition: color 0.15s;
    }
    .sidebar-item:hover { background: #f1f5f9; color: var(--d-text); }
    .sidebar-item.active {
        background: var(--d-primary-tint);
        color: var(--d-primary-dark);
    }
    .sidebar-item.active i { color: var(--d-primary-dark); }
    .sidebar-item .nav-badge {
        margin-left: auto;
        background: var(--d-danger);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 10px;
        padding: 0 5px;
        display: inline-flex; align-items: center; justify-content: center;
    }

    .sidebar-footer {
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid var(--card-bd);
    }
    .sidebar-user {
        display: flex; align-items: center; gap: 10px;
        padding: 10px;
        border-radius: 10px;
    }
    .sidebar-user .avatar {
        width: 36px; height: 36px;
        border-radius: 50%;
        background: var(--d-primary-tint);
        color: var(--d-primary-dark);
        display: grid; place-items: center;
        font-weight: 700; font-size: 14px;
        flex-shrink: 0;
        overflow: hidden;
    }
    .sidebar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
    .sidebar-user .meta { min-width: 0; flex: 1; }
    .sidebar-user .meta .nm {
        font-weight: 700; font-size: 13px;
        color: var(--d-text);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sidebar-user .meta .em {
        font-size: 11px; color: var(--d-muted);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        text-transform: capitalize;
    }
    .sidebar-user .logout-btn {
        background: transparent;
        border: none;
        color: var(--d-muted);
        font-size: 18px;
        padding: 6px;
        border-radius: 8px;
        cursor: pointer;
    }
    .sidebar-user .logout-btn:hover {
        background: var(--d-danger-soft);
        color: var(--d-danger);
    }
}

/* ----- Mobile top bar ----- */
.mobile-topbar {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px var(--pad-x);
    background: #fff;
    border-bottom: 1px solid var(--card-bd);
    position: sticky;
    top: 0;
    z-index: 50;
}
.mobile-topbar .brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 15px;
    color: var(--d-text);
}
.mobile-topbar .brand .logo-dot {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
    display: grid; place-items: center;
    color: #fff; font-size: 16px;
}
.mobile-topbar .topbar-actions {
    display: flex; gap: 6px; align-items: center;
}
.topbar-icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--shell-bg);
    border: 1px solid var(--card-bd);
    display: grid; place-items: center;
    color: var(--d-text-2);
    font-size: 17px;
    cursor: pointer;
    text-decoration: none;
}
.topbar-icon-btn:hover { background: #eef2f6; color: var(--d-text); }

@media (min-width: 901px) {
    .mobile-topbar { display: none; }
}

/* Online / Offline pill (rider-specific) */
.online-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.online-pill .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor;
}
.online-pill.on {
    color: #047857;
    background: var(--d-success-soft);
    border-color: rgba(16, 185, 129, 0.3);
}
.online-pill.on .dot {
    background: var(--d-success);
    animation: pulse-dot 1.8s ease-in-out infinite;
}
.online-pill.off {
    color: var(--d-muted);
    background: #f1f5f9;
    border-color: var(--card-bd);
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
    50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

/* ----- Bottom nav (mobile only) ----- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: #fff;
    border-top: 1px solid var(--card-bd);
    display: flex;
    align-items: stretch;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04);
}
.bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    color: var(--d-muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 4px;
    position: relative;
}
.bottom-nav-item i {
    font-size: 22px;
    transition: transform 0.15s;
}
.bottom-nav-item.active {
    color: var(--d-primary-dark);
}
.bottom-nav-item.active i {
    color: var(--d-primary-dark);
    transform: scale(1.05);
}
.bottom-nav-item .badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--d-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

@media (min-width: 901px) {
    .bottom-nav { display: none; }
    .scroll-area { padding-bottom: 32px; }
}


/* ============================================================
 *  5. PAGE HEADER + COMMON BLOCKS
 * ============================================================ */
.page-head { margin-bottom: 18px; }
.page-head h1 {
    font-size: 22px; font-weight: 800;
    margin: 0 0 4px;
    color: var(--d-text);
    letter-spacing: -0.02em;
}
.page-head p {
    font-size: 13px; color: var(--d-muted); margin: 0;
}

.section-title {
    font-size: 15px; font-weight: 700;
    color: var(--d-text);
    margin: 22px 0 10px;
    display: flex; align-items: center;
    justify-content: space-between; gap: 8px;
}
.section-title .link-more {
    font-size: 12px; font-weight: 600;
    color: var(--d-primary-dark);
}


/* ============================================================
 *  6. CARDS
 * ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-bd);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
}
.card-flush { padding: 0; overflow: hidden; }


/* ============================================================
 *  7. BUTTONS
 * ============================================================ */
.btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s, border-color 0.15s;
    min-height: 44px;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--d-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(77, 91, 189, 0.25);
}
.btn-primary:hover { background: var(--d-primary-dark); color: #fff; }

.btn-ghost {
    background: #fff;
    color: var(--d-text);
    border-color: var(--input-bd);
}
.btn-ghost:hover { background: #f8fafc; }

.btn-danger {
    background: var(--d-danger);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-block { width: 100%; }
.btn-sm    { padding: 8px 14px; min-height: 36px; font-size: 13px; }


/* ============================================================
 *  8. FORM CONTROLS (base)
 * ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--d-text-2);
    margin-bottom: 6px;
}
.input,
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--input-bd);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--d-text);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 46px;
}
.input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--input-bd-focus);
    box-shadow: 0 0 0 3px var(--d-primary-soft);
}
.input.has-error { border-color: var(--d-danger); }

.form-help {
    font-size: 12px;
    color: var(--d-muted);
    margin-top: 6px;
}


/* ============================================================
 *  9. BADGES / PILLS
 * ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-success { background: var(--d-success-soft); color: #047857; }
.badge-warning { background: var(--d-warning-soft); color: #a16207; }
.badge-danger  { background: var(--d-danger-soft);  color: #b91c1c; }
.badge-info    { background: var(--d-info-soft);    color: #1d4ed8; }
.badge-muted   { background: #f1f5f9; color: var(--d-muted); }


/* ============================================================
 * 10. LIST ROWS
 * ============================================================ */
.list {
    background: var(--card-bg);
    border: 1px solid var(--card-bd);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-bd);
    text-decoration: none;
    color: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #f8fafc; }

.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--d-muted);
}
.empty-state i {
    font-size: 42px; color: var(--d-muted-2);
    margin-bottom: 10px;
}


/* ============================================================
 * 11. SKELETON LOADERS
 * ============================================================ */
.skel {
    background: linear-gradient(90deg,
        #eef2f6 0%, #f7f8fa 50%, #eef2f6 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
    display: block;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skel-line   { height: 12px; margin-bottom: 8px; }
.skel-line.short { width: 40%; }
.skel-line.med   { width: 70%; }
.skel-card   { height: 96px; border-radius: 12px; margin-bottom: 10px; }
.skel-circle { width: 40px; height: 40px; border-radius: 50%; }

.content-block  { display: none; }
.skeleton-block { display: block; }
body.loaded .content-block  { display: block; }
body.loaded .skeleton-block { display: none; }


/* ============================================================
 * 12. TOASTS
 * ============================================================ */
.toast-host {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 14px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
@media (min-width: 901px) {
    .toast-host { bottom: 22px; }
}
.toast {
    background: var(--d-text);
    color: #fff;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    pointer-events: auto;
    max-width: 90vw;
    animation: toast-in 0.25s ease;
}
.toast.t-error,
.toast.error   { background: var(--d-danger); }
.toast.t-success,
.toast.success { background: var(--d-success); }
.toast.info    { background: var(--d-info); }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
 * 13. BOTTOM SHEET / MODAL
 * ============================================================ */
.sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 8000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.sheet-overlay.open { opacity: 1; visibility: visible; }

.sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 22px 22px max(22px, env(safe-area-inset-bottom));
    z-index: 8500;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    max-width: 540px;
    margin: 0 auto;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
}
.sheet.open { transform: translateY(0); }

@media (min-width: 901px) {
    .sheet {
        left: 50%; right: auto;
        bottom: 50%;
        transform: translate(-50%, calc(50% + 20px));
        opacity: 0;
        border-radius: 16px;
        width: min(420px, 92vw);
        transition: transform 0.22s, opacity 0.22s;
    }
    .sheet.open {
        transform: translate(-50%, 50%);
        opacity: 1;
    }
}

.sheet h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
    color: var(--d-text);
}
.sheet p {
    margin: 0 0 16px;
    font-size: 13.5px;
    color: var(--d-muted);
    line-height: 1.5;
}
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }


/* ============================================================
 * 14. AUTH PAGES — common (login + register + landing)
 * ============================================================
 *  Page-level CSS:
 *    - login/index.php and register/index.php each inject their
 *      own small <style> block via $PAGE_HEAD_EXTRA which sets
 *      the body backdrop + desktop phone-frame container.
 *    - main.css here owns every actual UI class (auth-*, wiz-*,
 *      veh-*, upload-*, success-* etc.).
 * ============================================================ */

/* Back arrow (top-left of auth pages) — floats so it doesn't push content */
.auth-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: inline-flex;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--card-bd);
    align-items: center; justify-content: center;
    color: var(--d-text-2);
    font-size: 18px;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.auth-back:hover {
    background: #fff;
    color: var(--d-text);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.auth-back:active { transform: scale(0.95); }

/* Brand block (logo + name above welcome heading) */
.auth-brand {
    text-align: center;
    margin-bottom: 22px;
}
.auth-brand .logo-wrap {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
    display: grid; place-items: center;
    color: #fff;
    font-size: 30px;
    box-shadow: 0 10px 24px rgba(77, 91, 189, 0.32),
                0 2px 6px rgba(77, 91, 189, 0.2);
}
.auth-brand .b-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--d-text);
    letter-spacing: -0.01em;
}
.auth-brand .b-sub {
    font-size: 12px;
    color: var(--d-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* Welcome heading on login */
.auth-welcome {
    text-align: center;
    margin-bottom: 24px;
}
.auth-welcome .eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--d-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.auth-welcome h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: var(--d-text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.auth-welcome h1 .grad {
    background: linear-gradient(120deg, var(--d-primary), #6f7fde);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-welcome p {
    margin: 0;
    font-size: 13.5px;
    color: var(--d-muted);
    line-height: 1.5;
}

/* Card wrapping the form */
.auth-card {
    background: #fff;
    border: 1px solid var(--card-bd);
    border-radius: 18px;
    padding: 22px 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04),
                0 1px 3px rgba(15, 23, 42, 0.05);
}

/* Field (label + input) */
.auth-field {
    margin-bottom: 13px;
}
.auth-field > label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--d-text-2);
    margin-bottom: 6px;
}
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}
.auth-input-wrap .field-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--d-muted);
    font-size: 17px;
    pointer-events: none;
    z-index: 2;
}
.auth-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 1px solid var(--input-bd);
    border-radius: 12px;
    background: #fff;
    color: var(--d-text);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 48px;
}
.auth-input:focus {
    outline: none;
    border-color: var(--d-primary);
    box-shadow: 0 0 0 4px rgba(77, 91, 189, 0.14);
}

/* Field with no leading icon (e.g. plain selects, OTP) */
.auth-input-wrap.no-ico .auth-input { padding-left: 14px; }
.auth-input-wrap:not(.has-ico) .auth-input { /* defensive — only pad when icon present */ }

select.auth-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Eye-toggle (password) */
.auth-input-wrap.has-toggle .auth-input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--d-muted);
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    display: grid; place-items: center;
    z-index: 2;
}
.pw-toggle:hover { color: var(--d-text); background: #f1f5f9; }

/* Phone wrap (+91 prefix) */
.phone-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.phone-wrap .cc-box {
    flex-shrink: 0;
    min-width: 64px;
    padding: 0 14px;
    border: 1px solid var(--input-bd);
    border-radius: 12px;
    background: #fff;
    color: var(--d-text);
    font-weight: 700;
    font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.phone-wrap .auth-input-wrap { flex: 1; }

/* Two-column row (used in register password+confirm) */
.field-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 380px) {
    .field-row.two-col { grid-template-columns: 1fr; }
}

/* Error state */
.auth-field.has-error .auth-input {
    border-color: var(--d-danger);
    background: #fff8f8;
}
.auth-field.has-error .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}
.field-error {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--d-danger);
    display: flex; align-items: center; gap: 5px;
}
.field-error i { font-size: 13px; }
.field-help {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--d-muted);
}

/* Forgot / remember row */
.forgot-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 14px;
}
.forgot-row a {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--d-primary-dark);
}

/* Submit button (auth full-width) */
.auth-submit,
.btn-submit {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(120deg, var(--d-primary), var(--d-primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    min-height: 50px;
    position: relative;
    overflow: hidden;
    transition: transform 0.05s, box-shadow 0.15s;
    box-shadow: 0 6px 16px rgba(77, 91, 189, 0.28);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
}
.auth-submit:hover,
.btn-submit:hover { box-shadow: 0 8px 20px rgba(77, 91, 189, 0.38); }
.auth-submit:active,
.btn-submit:active { transform: translateY(1px); }
.auth-submit::after,
.btn-submit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmerCta 2.6s ease-in-out infinite;
}
.auth-submit:disabled,
.btn-submit:disabled {
    opacity: 0.7; cursor: not-allowed;
}
@keyframes shimmerCta {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* Alert banner (server flash error) */
.auth-alert,
.global-error {
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--d-danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: flex-start; gap: 8px;
}
.auth-alert i,
.global-error i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* Footer link below auth card */
.auth-footer-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--d-muted);
}
.auth-footer-link a,
.signin-link {
    color: var(--d-primary-dark);
    font-weight: 700;
}

/* Divider with "OR" text */
.auth-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 16px 0;
    font-size: 11px; font-weight: 700;
    color: var(--d-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--card-bd);
}

/* Optional ambient orbs / grid (used by login if rendered) */
.auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}
.auth-orb.orb-1 {
    width: 280px; height: 280px;
    top: -80px; left: -80px;
    background: radial-gradient(circle, rgba(77,91,189,0.35), transparent 70%);
}
.auth-orb.orb-2 {
    width: 320px; height: 320px;
    bottom: -120px; right: -100px;
    background: radial-gradient(circle, rgba(77,91,189,0.22), transparent 70%);
}
.auth-orb.orb-3 {
    width: 200px; height: 200px;
    top: 40%; right: -60px;
    background: radial-gradient(circle, rgba(111,127,222,0.18), transparent 70%);
}
.auth-grid {
    position: fixed; inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(77,91,189,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77,91,189,0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    z-index: 0;
}

/* Entrance animations */
.auth-anim {
    opacity: 0;
    transform: translateY(10px);
    animation: authUp 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.auth-anim.d1 { animation-delay: 0.05s; }
.auth-anim.d2 { animation-delay: 0.14s; }
.auth-anim.d3 { animation-delay: 0.23s; }
.auth-anim.d4 { animation-delay: 0.32s; }
.auth-anim.d5 { animation-delay: 0.41s; }
@keyframes authUp {
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
 * 15. REGISTER WIZARD
 * ============================================================ */
.reg-topbar {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}
/* When auth-back lives inside the reg-topbar flex row, opt out of the
   absolute positioning used on the standalone login page. */
.reg-topbar .auth-back {
    position: static;
    top: auto;
    left: auto;
}
.reg-topbar .signin-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--card-bd);
    color: var(--d-primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: background 0.15s, box-shadow 0.15s;
}
.reg-topbar .signin-link:hover {
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* Progress bar + step dots */
.wiz-progress {
    position: relative;
    margin-bottom: 22px;
    height: 24px;
    display: flex; align-items: center;
    justify-content: space-between;
}
.wiz-progress::before {
    content: "";
    position: absolute;
    left: 12px; right: 12px;
    top: 50%;
    height: 3px;
    background: var(--card-bd);
    border-radius: 999px;
    z-index: 1;
    transform: translateY(-50%);
}
.wiz-progress .fill {
    position: absolute;
    left: 12px;
    top: 50%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--d-primary), var(--d-primary-dark));
    z-index: 2;
    width: 0%;
    transform: translateY(-50%);
    transition: width 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.wiz-step-dot {
    position: relative;
    z-index: 3;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--card-bd);
    color: var(--d-muted);
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.wiz-step-dot .num { line-height: 1; }
.wiz-step-dot.active {
    background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
    border-color: var(--d-primary-dark);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(77,91,189,0.32);
}
.wiz-step-dot.done {
    background: var(--d-primary);
    border-color: var(--d-primary);
    color: #fff;
}

/* Step panels */
.wiz-step { display: none; }
.wiz-step.active {
    display: block;
    animation: stepIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes stepIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.step-head {
    margin-bottom: 18px;
    text-align: center;
}
.step-head .ico {
    width: 52px; height: 52px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: var(--d-primary-tint);
    color: var(--d-primary-dark);
    display: grid; place-items: center;
    font-size: 24px;
}
.step-head .ttl {
    font-size: 19px;
    font-weight: 800;
    color: var(--d-text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.step-head .sub {
    font-size: 13px;
    color: var(--d-muted);
    line-height: 1.5;
}

/* Wizard nav buttons */
.wiz-nav {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.btn-back {
    flex: 0 0 auto;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid var(--input-bd);
    background: #fff;
    color: var(--d-text-2);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    min-height: 50px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-back:hover { background: #f8fafc; }
.btn-next {
    flex: 1;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(120deg, var(--d-primary), var(--d-primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    min-height: 50px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 6px 16px rgba(77, 91, 189, 0.28);
    transition: box-shadow 0.15s, transform 0.05s;
}
.btn-next:hover  { box-shadow: 0 8px 20px rgba(77, 91, 189, 0.38); }
.btn-next:active { transform: translateY(1px); }


/* ============================================================
 * 16. VEHICLE CHIP GRID
 * ============================================================ */
.veh-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.veh-chip {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    padding: 16px 10px;
    border: 1.5px solid var(--input-bd);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.veh-chip input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}
.veh-chip .ico {
    font-size: 28px;
    color: var(--d-muted);
    transition: color 0.15s;
}
.veh-chip .lbl {
    font-size: 13px;
    font-weight: 600;
    color: var(--d-text-2);
}
.veh-chip:hover {
    border-color: var(--d-primary-soft);
    background: var(--d-primary-tint);
}
.veh-chip:has(input:checked) {
    border-color: var(--d-primary);
    background: var(--d-primary-tint);
    box-shadow: 0 0 0 4px rgba(77, 91, 189, 0.12);
}
.veh-chip:has(input:checked) .ico { color: var(--d-primary-dark); }
.veh-chip:has(input:checked) .lbl { color: var(--d-primary-dark); font-weight: 700; }


/* ============================================================
 * 17. UPLOAD TILES (selfie / aadhar / licence)
 * ============================================================ */
.upload-tile {
    position: relative;
    display: block;
    width: 100%;
    border: 1.5px dashed var(--input-bd);
    border-radius: 14px;
    background: #fafbff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.upload-tile input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-tile .placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    color: var(--d-muted);
    padding: 14px;
    text-align: center;
}
.upload-tile .placeholder i {
    font-size: 28px;
    color: var(--d-primary);
}
.upload-tile .placeholder .ttl {
    font-size: 13px;
    font-weight: 700;
    color: var(--d-text-2);
}
.upload-tile .placeholder .sub {
    font-size: 11.5px;
    color: var(--d-muted);
    line-height: 1.4;
}
.upload-tile .replace-hint {
    position: absolute;
    inset: auto 0 0 0;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    display: none;
}
.upload-tile.has-preview { background: #000; border-style: solid; border-color: var(--d-primary); }
.upload-tile.has-preview .placeholder { display: none; }
.upload-tile.has-preview .replace-hint { display: block; }
.upload-tile.has-preview img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.upload-tile:hover {
    border-color: var(--d-primary);
    background: var(--d-primary-tint);
}
.upload-tile.has-error {
    border-color: var(--d-danger);
    background: #fff8f8;
}

/* Aspect ratios */
.upload-tile.aspect-square  { aspect-ratio: 1 / 1; }
.upload-tile.aspect-selfie  { aspect-ratio: 3 / 4; max-width: 240px; margin: 0 auto; }
.upload-tile.aspect-aadhar  { aspect-ratio: 1.58 / 1; }
.upload-tile.aspect-license { aspect-ratio: 1.58 / 1; }


/* ============================================================
 * 18. SUCCESS CARD (after registration)
 * ============================================================ */
.success-card {
    background: #fff;
    border: 1px solid var(--card-bd);
    border-radius: 18px;
    padding: 28px 22px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.success-ico {
    width: 80px; height: 80px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--d-success-soft);
    color: var(--d-success);
    display: grid; place-items: center;
    font-size: 44px;
    position: relative;
}
.success-ico::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--d-success);
    opacity: 0.3;
    animation: successPulse 1.8s ease-out infinite;
}
@keyframes successPulse {
    0%   { transform: scale(0.9); opacity: 0.45; }
    100% { transform: scale(1.2); opacity: 0; }
}
.success-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--d-text);
    letter-spacing: -0.01em;
}
.success-card > p {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: var(--d-muted);
    line-height: 1.55;
}
.email-tag {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--d-primary-tint);
    color: var(--d-primary-dark);
    font-size: 12.5px;
    font-weight: 600;
}
.email-tag i { font-size: 14px; }

.next-steps {
    display: flex; flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    text-align: left;
}
.next-steps .step {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px;
    background: var(--d-primary-tint);
    border: 1px solid var(--d-primary-soft);
    border-radius: 12px;
}
.next-steps .step .ico {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--d-primary);
    color: #fff;
    display: grid; place-items: center;
    font-size: 12px;
    font-weight: 700;
}
.next-steps .step strong {
    display: block;
    font-size: 13px;
    color: var(--d-text);
    margin-bottom: 2px;
}
.next-steps .step div {
    font-size: 12.5px;
    color: var(--d-muted);
    line-height: 1.5;
}

.reg-terms {
    margin-top: 16px;
    text-align: center;
    font-size: 11.5px;
    color: var(--d-muted);
    line-height: 1.55;
}
.reg-terms a {
    color: var(--d-primary-dark);
    font-weight: 600;
}


/* ============================================================
 * 19. UTILITIES
 * ============================================================ */
.text-muted   { color: var(--d-muted); }
.text-primary { color: var(--d-primary-dark); }
.text-danger  { color: var(--d-danger); }
.text-success { color: var(--d-success); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fw-800       { font-weight: 800; }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex             { display: flex; }
.flex-col         { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.gap-8            { gap: 8px; }
.gap-12           { gap: 12px; }
.w-100            { width: 100%; }
.hide             { display: none !important; }


/* ============================================================
 * 20. ENTRANCE ANIMATIONS (generic)
 * ============================================================ */
.anim-up {
    opacity: 0;
    transform: translateY(8px);
    animation: animUp 0.45s ease forwards;
}
.anim-up.d1 { animation-delay: 0.05s; }
.anim-up.d2 { animation-delay: 0.12s; }
.anim-up.d3 { animation-delay: 0.20s; }
.anim-up.d4 { animation-delay: 0.28s; }
.anim-up.d5 { animation-delay: 0.36s; }
@keyframes animUp {
    to { opacity: 1; transform: translateY(0); }
}