/* ===========================================================
   Track your order - BDStall (/track-order/)
   Public, no login: order number + mobile, then the status trail.
   Same shell as the auth pages (title above one card), colours from
   the site tokens in common.css. Mobile-first, kebab-case names.
   =========================================================== */

.track-page {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px 64px;
    background: #ECECE6;
    color: var(--color-text-primary, #1C1C1A);
}
.track-page-column { width: 100%; max-width: 520px; }
.track-page *, .track-page *::before, .track-page *::after { box-sizing: border-box; }

.track-visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Title above the card */
.track-page-head { text-align: center; padding: 0 8px; margin: 0 0 16px; }
.track-page-title {
    margin: 0 0 4px;
    font-size: 1.375rem;   /* same as the auth / category page h1 */
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
@media (min-width: 1024px) { .track-page-title { font-size: 1.75rem; } }
.track-page-subtitle { margin: 0; font-size: 14px; color: #5F5E5A; line-height: 1.5; }

/* The card */
.track-card,
.track-result {
    width: 100%;
    background: #fff;
    border: 1px solid #E8E8E4;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
@media (min-width: 600px) {
    .track-card, .track-result { padding: 32px; }
}

.track-flash-error {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    font-weight: 600;
    background: #FCE4CC;
    color: #8C3A0F;
    border: 1px solid #F0C898;
}

/* Form */
.track-form { display: flex; flex-direction: column; gap: 16px; }
.track-field { display: flex; flex-direction: column; gap: 5px; }
.track-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5F5E5A;
}
.track-hint { margin: 0; font-size: 12px; color: #6B6964; line-height: 1.4; }

.track-input,
.track-mobile-wrap {
    width: 100%;
    background: #fff;
    border: 1px solid #D3D1C7;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.track-input {
    padding: 12px 14px;
    font-size: 16px;      /* 16px keeps iOS from zooming the field */
    font-family: inherit;
    color: inherit;
    line-height: 1.4;
    min-height: 48px;
}
.track-input:focus,
.track-mobile-wrap:focus-within {
    outline: none;
    border-color: var(--green, #149A49);
    box-shadow: 0 0 0 3px rgba(20,154,73,0.12);
}
.track-mobile-wrap { display: flex; align-items: stretch; overflow: hidden; }
.track-mobile-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: #D9F0E0;
    color: #0E7A38;
    font-size: 15px;
    font-weight: 700;
    border-right: 1px solid #E8E8E4;
    flex-shrink: 0;
}
.track-mobile-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: inherit;
    line-height: 1.4;
    min-height: 48px;
}

.track-captcha { display: flex; justify-content: center; min-height: 65px; }

.track-submit {
    width: 100%;
    min-height: 48px;
    padding: 13px;
    background: var(--green, #149A49);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: background 0.15s;
}
.track-submit:hover  { background: var(--green-dark, #0E7A38); }
.track-submit:active { transform: translateY(1px); }

/* Result */
.track-result { margin-top: 16px; }
.track-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #F0F0EC;
}
.track-result-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5F5E5A;
}
.track-result-number { margin: 2px 0 0; font-size: 1.125rem; font-weight: 700; line-height: 1.2; }

/* Status colour families (shared by the badge and the timeline dots) */
.track-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}
.track-status.is-open     { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.track-status.is-moving   { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.track-status.is-done     { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.track-status.is-stopped  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.track-status.is-returned { background: #F5F3FF; color: #7C3AED; border-color: #DDD6FE; }
.track-status.is-hold     { background: #FFF7ED; color: #B45309; border-color: #FED7AA; }

.track-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
}
@media (min-width: 480px) { .track-facts { grid-template-columns: repeat(3, 1fr); } }
.track-fact dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5F5E5A;
}
.track-fact dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }

.track-timeline-title {
    margin: 24px 0 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5F5E5A;
}
.track-timeline { list-style: none; margin: 0; padding: 0; }
.track-step {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 18px 0;
}
.track-step::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: #E8E8E4;
}
.track-step:last-child::before { display: none; }
.track-step-dot {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 50%;
    border: 3px solid #9CA3AF;
    background: #fff;
}
.track-step.is-open     .track-step-dot { border-color: #1D4ED8; }
.track-step.is-moving   .track-step-dot { border-color: #4338CA; }
.track-step.is-done     .track-step-dot { border-color: #15803D; background: #15803D; }
.track-step.is-stopped  .track-step-dot { border-color: #B91C1C; }
.track-step.is-returned .track-step-dot { border-color: #7C3AED; }
.track-step.is-hold     .track-step-dot { border-color: #B45309; }
.track-step-body { min-width: 0; }
.track-step-status { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.track-step-time { display: block; margin-top: 3px; font-size: 12px; color: #6B6964; }
.track-timeline-empty { margin: 0; font-size: 14px; color: #5F5E5A; }

/* Help row below the card, the same bordered CTA row the auth pages use */
.track-help-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    margin-top: 16px;
    padding: 10px 14px;
    background: #FAFAF7;
    border: 1px solid #D3D1C7;
    border-radius: 8px;
    color: #5F5E5A;
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
}
.track-help-cta strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0E7A38;
    font-weight: 700;
    white-space: nowrap;
}
.track-help-cta:hover { background: #F2F7EC; border-color: #0E7A38; color: #5F5E5A; }
