/* ==========================================================================
   Live Vehicle Status Tracker
   A dark "band" section by design, so it reads the same in light and dark
   themes and stands out as the existing-customer tool on the page.
   ========================================================================== */

.vt-section {
    position: relative;
    color: #ffffff;
    background:
        radial-gradient(circle at 88% 0%, rgba(224, 36, 42, 0.22), transparent 48%),
        radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.05), transparent 45%),
        linear-gradient(135deg, #111214, #232427);
    scroll-margin-top: 80px;
}

.vt {
    --vt-accent: var(--color-primary, #e0242a);
    --vt-amber: #f5a524;
    --vt-green: #2fbf71;
    --vt-surface: rgba(255, 255, 255, 0.045);
    --vt-border: rgba(255, 255, 255, 0.11);
    --vt-muted: #a9abb0;
    --vt-ease: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
    max-width: 880px;
    margin-inline: auto;
}

.vt-head h2 { color: #ffffff; margin-bottom: 0.5rem; }
.vt-head p { color: var(--vt-muted); max-width: 36rem; }

.vt-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Form ---------- */

.vt-form {
    margin-top: 1.5rem;
    padding: 1.1rem;
    border-radius: 18px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.vt-label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cfd0d3;
}

.vt-inputrow { display: flex; gap: 0.6rem; }
.vt-field { position: relative; flex: 1; min-width: 0; }

.vt-field > svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #8d9096;
    pointer-events: none;
}

.vt .vt-input {
    width: 100%;
    height: 54px;
    padding: 0 5.5rem 0 2.8rem;
    border-radius: 12px;
    border: 1px solid #3a3b40;
    background: #0c0d0f;
    color: #ffffff;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.15s var(--vt-ease), box-shadow 0.15s var(--vt-ease);
}
.vt .vt-input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; color: #75787e; }
.vt .vt-input:focus { outline: none; border-color: var(--vt-accent); box-shadow: 0 0 0 3px rgba(224, 36, 42, 0.28); }
.vt-form.has-error .vt-input { border-color: var(--vt-accent); }

.vt-mode {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0c0d0f;
    background: #e9e9ec;
    opacity: 0;
    transition: opacity 0.18s var(--vt-ease), transform 0.18s var(--vt-ease);
    pointer-events: none;
}
.vt-mode.is-on { opacity: 1; transform: translateY(-50%) scale(1); }

.vt-submit { height: 54px; padding-inline: 1.5rem; border-radius: 12px; }

.vt-hint { margin: 0.65rem 0 0; font-size: 0.78rem; color: #8f9297; }

/* ---------- Result card ---------- */

.vt-results:empty { display: none; }
.vt-results { margin-top: 1.25rem; display: grid; gap: 1rem; }

.vt-card {
    --vt-cur: var(--vt-accent);
    position: relative;
    padding: 1.35rem;
    border-radius: 18px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    animation: vt-in 0.45s var(--vt-ease) both;
}

.vt-stage-waiting-parts { --vt-cur: var(--vt-amber); }
.vt-stage-ready,
.vt-stage-picked-up { --vt-cur: var(--vt-green); --vt-accent: var(--vt-green); }
.vt-card.is-changed { animation: vt-in 0.45s var(--vt-ease) both, vt-changed 1.8s var(--vt-ease) 0.2s; }

.vt-card-head { display: flex; align-items: center; gap: 0.85rem; }

.vt-vehicle-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.vt-vehicle-text { flex: 1; min-width: 0; }
.vt-vehicle { margin: 0; font-size: 1.12rem; font-weight: 700; color: #fff; line-height: 1.25; }
.vt-meta { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--vt-muted); }
.vt-meta-part { white-space: nowrap; }

.vt-live {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c9f3dc;
    background: rgba(47, 191, 113, 0.12);
    border: 1px solid rgba(47, 191, 113, 0.28);
}
.vt-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--vt-green);
    animation: vt-blink 1.8s ease-in-out infinite;
}
.vt.is-stale .vt-live { color: #ffe1a8; background: rgba(245, 165, 36, 0.12); border-color: rgba(245, 165, 36, 0.3); }
.vt.is-stale .vt-live-dot { background: var(--vt-amber); }
.vt.is-stale .vt-live-text::after { content: " \00B7  reconnecting"; text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Status block */
.vt-status {
    display: flex;
    gap: 0.9rem;
    margin-top: 1.15rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--vt-cur);
}
.vt-status-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--vt-cur);
}
.vt-status-kicker { margin: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vt-muted); }
.vt-status-title { margin: 0.1rem 0 0.2rem; font-size: 1.15rem; font-weight: 700; color: #fff; }
.vt-status-desc { margin: 0; font-size: 0.88rem; line-height: 1.5; color: #c6c8cc; }

/* ---------- Stepper (the progress bar) ---------- */

.vt-progress { margin-top: 1.4rem; }

.vt-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.vt-step { position: relative; text-align: center; padding: 0 0.25rem; }

/* connector to the next step */
.vt-step::after {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(50% + 19px);
    width: calc(100% - 38px);
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
}
.vt-step:last-child::after { display: none; }
.vt-step.is-done::after { background: var(--vt-accent); }
.vt-step.is-current::after {
    background: repeating-linear-gradient(90deg, var(--vt-cur) 0 8px, transparent 8px 14px);
    background-size: 28px 100%;
    opacity: 0.75;
    animation: vt-flow 0.9s linear infinite;
}
.vt-stage-ready .vt-step.is-current::after { display: none; }

.vt-dot {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    margin: 0 auto 0.55rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #9a9ca1;
    background: #16171a;
    border: 2px solid rgba(255, 255, 255, 0.16);
    transition: background-color 0.3s var(--vt-ease), border-color 0.3s var(--vt-ease);
}
.vt-step.is-done .vt-dot { color: #fff; background: var(--vt-accent); border-color: var(--vt-accent); }
.vt-step.is-current .vt-dot {
    color: #fff;
    background: var(--vt-cur);
    border-color: var(--vt-cur);
    animation: vt-ping 2s var(--vt-ease) infinite;
}
.vt-stage-ready .vt-step.is-current .vt-dot { animation: none; box-shadow: 0 0 0 6px rgba(47, 191, 113, 0.22); }
.vt-step.is-skipped .vt-dot { background: #16171a; border-style: dashed; border-color: rgba(255, 255, 255, 0.28); color: #7b7e84; }

.vt-step-text { display: block; }
.vt-step-label { display: block; font-size: 0.8rem; font-weight: 650; line-height: 1.25; color: #ececee; }
.vt-step.is-upcoming .vt-step-label,
.vt-step.is-skipped .vt-step-label { color: #7d8086; }
.vt-step.is-current .vt-step-label { color: #fff; }
.vt-step-time { display: block; margin-top: 0.15rem; font-size: 0.7rem; color: #8f9297; }

/* Shop note */
.vt-note {
    margin-top: 1.2rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
    color: #e3e4e6;
}
.vt-note-label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vt-muted);
}

/* Footer */
.vt-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--vt-border);
}
.vt-foot-info { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.82rem; color: var(--vt-muted); }
.vt-eta { display: inline-flex; align-items: center; gap: 0.35rem; color: #dfe0e3; }
.vt-eta strong { color: #fff; }

.vt .vt-btn-ghost {
    gap: 0.45rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.28);
}
.vt .vt-btn-ghost:hover { background: #fff; color: #111; border-color: #fff; transform: translateY(-2px); text-decoration: none; }

.vt-actions { text-align: center; }
.vt-link {
    padding: 0.4rem 0.6rem;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: #cfd0d3;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.vt-link:hover { color: #fff; }

/* ---------- Messages ---------- */

.vt-msg {
    display: flex;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    background: var(--vt-surface);
    border: 1px solid var(--vt-border);
    animation: vt-in 0.35s var(--vt-ease) both;
}
.vt-msg-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.vt-msg-error .vt-msg-icon { background: rgba(224, 36, 42, 0.18); color: #ff8a8e; }
.vt-msg-title { margin: 0 0 0.2rem; font-weight: 700; color: #fff; }
.vt-msg-body { margin: 0 0 0.6rem; font-size: 0.9rem; color: #c6c8cc; }
.vt-msg-body a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.vt-msg .vt-link { padding-left: 0; }

/* ---------- Skeleton ---------- */

.vt-skeleton { min-height: 200px; }
.vt-sk,
.vt-sk-steps span {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 100%);
    background-size: 200% 100%;
    animation: vt-shimmer 1.2s linear infinite;
    border-radius: 8px;
}
.vt-sk-title { width: 45%; height: 20px; }
.vt-sk-line { width: 75%; height: 14px; margin-top: 0.7rem; }
.vt-sk-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2rem; }
.vt-sk-steps span { display: block; height: 32px; border-radius: 16px; }

/* ---------- Animations ---------- */

@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vt-flow { to { background-position: 28px 0; } }
@keyframes vt-ping {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vt-cur) 55%, transparent); }
    70%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--vt-cur) 0%, transparent); }
}
@keyframes vt-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes vt-shimmer { to { background-position: -200% 0; } }
@keyframes vt-changed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
    30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--vt-cur) 60%, transparent); }
}

/* ---------- Responsive: vertical stepper on phones ---------- */

@media (max-width: 640px) {
    .vt-inputrow { flex-direction: column; }
    .vt-submit { width: 100%; }
    .vt-card { padding: 1.1rem; }
    .vt-live-text { display: none; }
    .vt-live { padding: 0.45rem; }

    .vt-steps { grid-template-columns: minmax(0, 1fr); }
    .vt-step {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 0.85rem;
        align-items: start;
        text-align: left;
        padding: 0 0 1.1rem;
    }
    .vt-step:last-child { padding-bottom: 0; }
    .vt-dot { margin: 0; }
    .vt-step-text { padding-top: 0.35rem; }
    .vt-step::after {
        top: 36px;
        left: 14.5px;
        width: 3px;
        height: calc(100% - 40px);
    }
    .vt-step.is-current::after {
        background: repeating-linear-gradient(180deg, var(--vt-cur) 0 8px, transparent 8px 14px);
        background-size: 100% 28px;
        animation-name: vt-flow-y;
    }
    .vt-card-foot { flex-direction: column; align-items: stretch; }
    .vt-card-foot .vt-btn-ghost { justify-content: center; }
}
@keyframes vt-flow-y { to { background-position: 0 28px; } }

@media (prefers-reduced-motion: reduce) {
    .vt-step.is-current::after,
    .vt-step.is-current .vt-dot,
    .vt-live-dot { animation: none; }
}
