/* ==========================================================================
   Track & Trace — app.css
   Brand color injected via --primary inline on <html>
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f5f7;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* --- Page wrapper --- */
.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1rem;
}

/* --- Shared header --- */
.header {
    width: 100%;
    max-width: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
}
.header__logo {
    height: 48px;
    max-width: 200px;
    object-fit: contain;
}
.header__back {
    position: absolute;
    left: 0;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}
.header__back:hover { text-decoration: underline; }
.header__back svg { width: 16px; height: 16px; }

/* --- Card container (shared) --- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.04);
    width: 100%;
    max-width: 540px;
    padding: 2rem;
}

/* ==========================================================================
   Search View
   ========================================================================== */
.search__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.5rem;
}
.search__subtitle {
    font-size: 0.9375rem;
    color: #666;
    text-align: center;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* Form */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-group input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    color: #1a1a1a;
    transition: border-color .15s;
    background: #fff;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8125rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: opacity .15s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner inside button */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
.btn--loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline error */
.error-msg {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.error-msg.is-visible { display: block; }

/* ==========================================================================
   Results View
   ========================================================================== */

/* Status header */
.status-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}
.status-header__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.status-header__icon svg { width: 28px; height: 28px; }

.status-header__icon--gepland   { background: #dbeafe; color: #2563eb; }
.status-header__icon--onderweg  { background: #fef3c7; color: #d97706; }
.status-header__icon--afgeleverd { background: #d1fae5; color: #059669; }
.status-header__icon--manco     { background: #fee2e2; color: #dc2626; }

.status-header__label {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a1a;
}
.status-header__order {
    font-size: 0.8125rem;
    color: #888;
    margin-top: 0.25rem;
}

/* --- Progress stepper --- */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    position: relative;
    padding: 0 0.5rem;
}
/* Connecting line behind dots */
.stepper::before {
    content: '';
    position: absolute;
    top: 14px;
    left: calc(0.5rem + 14px);
    right: calc(0.5rem + 14px);
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}
.stepper__progress {
    position: absolute;
    top: 14px;
    left: calc(0.5rem + 14px);
    height: 3px;
    background: var(--primary);
    z-index: 1;
    transition: width .4s ease;
}

.stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}
.stepper__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .3s, border-color .3s;
}
.stepper__dot svg {
    width: 14px;
    height: 14px;
    color: #fff;
    display: none;
}
.stepper__step.is-done .stepper__dot {
    background: var(--primary);
    border-color: var(--primary);
}
.stepper__step.is-done .stepper__dot svg { display: block; }
.stepper__step.is-active .stepper__dot {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.stepper__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    margin-top: 0.5rem;
    text-align: center;
}
.stepper__step.is-done .stepper__label,
.stepper__step.is-active .stepper__label {
    color: #1a1a1a;
}

/* --- Manco warning badge --- */
.manco-badge {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}
.manco-badge svg { flex-shrink: 0; width: 18px; height: 18px; }
.manco-badge.is-visible { display: flex; }

/* --- Delivery info --- */
.delivery-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
.delivery-info__item {
    min-width: 0;
}
.delivery-info__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.delivery-info__value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
}

/* --- Timeline --- */
.timeline__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}
.timeline__list {
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
}
/* Vertical line */
.timeline__list::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e5e7eb;
}
.timeline__item {
    position: relative;
    padding-bottom: 1.25rem;
    padding-left: 0.75rem;
}
.timeline__item:last-child { padding-bottom: 0; }

/* Dot on the line */
.timeline__item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
    border: 2px solid #f4f5f7;
}
.timeline__item:first-child::before {
    background: var(--primary);
}
.timeline__status {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
}
.timeline__desc {
    font-size: 0.8125rem;
    color: #666;
    margin-top: 0.125rem;
}
.timeline__time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Empty timeline */
.timeline__empty {
    font-size: 0.875rem;
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.8125rem;
    color: #999;
}
.footer a {
    color: var(--primary);
    text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Utility — hidden
   ========================================================================== */
[hidden] { display: none !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .page { padding: 1.25rem 0.75rem; }
    .card { padding: 1.5rem 1.25rem; border-radius: 10px; }
    .search__title { font-size: 1.3rem; }
    .status-header__label { font-size: 1.2rem; }
    .delivery-info { grid-template-columns: 1fr; gap: 0.75rem; }
    .stepper__label { font-size: 0.6875rem; }
}
