*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-alt: #f0f4f8;
    --navy: #0a1929;
    --navy-light: #112240;
    --accent: #0066cc;
    --accent-dim: rgba(0, 102, 204, 0.08);
    --text: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #8896a6;
    --border: #e2e8f0;
    --success: #16a34a;
    --success-dim: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-dim: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.08);
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* === HEADER === */
.header {
    padding: 20px 0;
    border-bottom: none;
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo { height: 32px; }
.header-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.25);
}
.header-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.03em;
}

/* === CONTENT WRAPPER (navy rectangle) === */
.content-wrap {
    max-width: 820px;
    margin: 40px auto;
    background: var(--navy);
    border-radius: 16px;
    padding: 40px 50px;
}

/* === MAIN === */
.main {
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
}

/* === LOADING STATE === */
.loading-container {
    text-align: center;
    padding: 80px 0;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

/* === ERROR STATE === */
.error-container {
    text-align: center;
    padding: 80px 0;
}
.error-icon {
    font-size: 56px;
    color: var(--danger);
    margin-bottom: 20px;
}
.error-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}
.error-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    max-width: 400px;
    margin: 0 auto;
}

/* === ORDER HEADER === */
.order-header {
    margin-bottom: 32px;
}
.order-greeting {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}
.order-greeting strong {
    color: #ffffff;
}
.order-ref {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: #ffffff;
}
.order-ref span {
    color: #00d4ff;
}
.order-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* === STATUS CARD === */
.status-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}
.status-current {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot.active { background: var(--accent); box-shadow: 0 0 12px rgba(0, 102, 204, 0.3); }
.status-dot.success { background: var(--success); box-shadow: 0 0 12px rgba(22, 163, 74, 0.3); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 12px rgba(217, 119, 6, 0.3); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 12px rgba(220, 38, 38, 0.3); animation: none; }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}
.status-label {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
}

/* === STEP TRACKER === */
.tracker {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
}
.step {
    flex: 1;
    text-align: center;
    position: relative;
}
.step-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
    position: relative;
    z-index: 2;
    transition: all 0.3s;
}
.step.completed .step-icon-wrap {
    background: var(--navy);
    color: #ffffff;
}
.step.active .step-icon-wrap {
    background: rgba(10, 25, 41, 0.1);
    color: var(--navy);
    border: 2px solid var(--navy);
    animation: pulse-step 2s ease-in-out infinite;
}
@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 0 rgba(10, 25, 41, 0.25); }
    50% { box-shadow: 0 0 0 10px rgba(10, 25, 41, 0); }
}
.step.pending .step-icon-wrap {
    background: #e2e8f0;
    color: #8896a6;
    border: 2px solid var(--border);
}
.step-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8896a6;
}
.step.completed .step-name { color: var(--navy); }
.step.active .step-name { color: var(--navy); }

/* Step status label */
.step-status {
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
    color: #8896a6;
}
.step.completed .step-status { color: var(--navy); }
.step.active .step-status { color: var(--navy); font-weight: 700; }

/* Connector lines */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    left: calc(50% + 22px);
    width: calc(100% - 44px);
    height: 3px;
    background: var(--border);
    z-index: 1;
}
.step.completed:not(:last-child)::after {
    background: var(--navy);
}

/* === INFO CARDS === */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.info-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.info-card.full { grid-column: 1 / -1; }
.info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}
.info-value.accent { color: var(--navy); }
.info-value a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}
.info-value a:hover { opacity: 0.8; }

/* === TRACKING TRANSPORTEUR === */
.tracking-banner {
    background: linear-gradient(135deg, var(--bg-card-alt), var(--bg-card));
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.tracking-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--navy);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.tracking-banner-info { flex: 1; }
.tracking-banner-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.tracking-banner-number {
    font-size: 16px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.04em;
    color: #1a1a2e;
}
.tracking-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--navy);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
    flex-shrink: 0;
}
.tracking-banner-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* === INVOICE BUTTON === */
.invoice-banner {
    background: linear-gradient(135deg, var(--bg-card-alt), var(--bg-card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.invoice-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--navy);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.invoice-banner-info { flex: 1; }
.invoice-banner-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.invoice-banner-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}
.invoice-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--navy);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
    flex-shrink: 0;
}
.invoice-banner-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* === ITEMS LIST === */
.items-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.items-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }
.item-qty {
    background: rgba(10, 25, 41, 0.08);
    color: var(--navy);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}
.item-title {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    color: #1a1a2e;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 32px 24px;
    background: var(--navy);
    border-top: none;
    margin-top: 0;
}
.footer-brand {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}
.footer-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
.refresh-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.refresh-info i { font-size: 14px; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .content-wrap { margin: 16px; padding: 24px 16px; }
    .main { padding: 0; }
    .order-ref { font-size: 22px; }
    .status-label { font-size: 17px; }
    .info-grid { grid-template-columns: 1fr; }
    .step-name { font-size: 10px; }
    .step-icon-wrap { width: 36px; height: 36px; font-size: 15px; }
    .step:not(:last-child)::after { top: 18px; left: calc(50% + 18px); width: calc(100% - 36px); }
    .tracking-banner { flex-direction: column; text-align: center; }
    .tracking-banner-btn { width: 100%; justify-content: center; }
    .invoice-banner { flex-direction: column; text-align: center; }
    .invoice-banner-btn { width: 100%; justify-content: center; }
    .status-card { padding: 20px; }
}

/* Utility classes for inline styles */
.hidden { display: none; }
