/*
 * Track & trace (7a) — stijl voor de Blade-componenten in
 * resources/views/components/track-trace/.
 *
 * Geen build-stap, geen framework. Alles is gescoped onder .tt.
 * Contrast volgt de tabel in de README — maak accenttekst niet lichter.
 */

.tt {
    --tt-ink: #063752;
    --tt-accent: #0A5A85;
    --tt-ring: #64ADE2;
    --tt-muted: #4B5563;
    --tt-soft: #6B7280;
    --tt-todo: #C6D2DA;
    --tt-line: #E3E9ED;
    --tt-line-soft: #EDF1F3;
    --tt-amber-ink: #8A5A18;
    --tt-amber-bg: #FDF6EC;
    --tt-amber-node: #B87A2B;
    --tt-amber-line: #E0A85C;
    --tt-rail: 400px;

    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 24px 56px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tt-ink);
    -webkit-font-smoothing: antialiased;
}

.tt, .tt *, .tt *::before, .tt *::after { box-sizing: border-box; }

.tt-icon { display: block; flex: none; }

/* ---------------------------------------------------------------- header */

.tt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tt-line);
}

.tt-logo { display: block; height: 30px; width: auto; }

.tt-order { font-size: 14px; color: var(--tt-muted); }
.tt-order strong { font-weight: 400; color: var(--tt-ink); }

/* ------------------------------------------------------------------ hero */

.tt-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: center;
    gap: 48px;
    padding: 44px 0 40px;
}

.tt-hero > * { min-width: 0; }

.tt-eyebrow {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tt-soft);
}

.tt-title {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 200;
    letter-spacing: -0.01em;
}

.tt-intro { margin: 0; max-width: 46ch; color: var(--tt-muted); }

.tt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 26px;
}

.tt-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--tt-ink);
    color: #FFFFFF;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.tt-cta:hover, .tt-cta:focus-visible { background: var(--tt-accent); }

.tt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tt-accent);
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid rgba(10, 90, 133, 0.3);
}

.tt-link:hover, .tt-link:focus-visible { border-bottom-color: var(--tt-accent); }

/* ------------------------------------------------------------------ ring */

.tt-ring {
    position: relative;
    justify-self: end;
    width: 230px;
    height: 230px;
}

.tt-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.tt-ring-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tt-ring-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tt-soft);
}

.tt-ring-day { font-size: 46px; line-height: 1.1; font-weight: 200; }
.tt-ring-month { font-size: 15px; }
.tt-ring-window { margin-top: 4px; font-size: 13px; color: var(--tt-muted); }

/* ---------------------------------------------------------------- matrix */

.tt-matrix { border-top: 1px solid var(--tt-line); }

.tt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--tt-rail);
    align-items: center;
    gap: 24px;
}

.tt-row--head { padding: 16px 0 10px; }

.tt-col-label {
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--tt-soft);
}

.tt-col-label--center { text-align: center; }

.tt-rail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
}

/* ------------------------------------------------------------ leveringen */

.tt-group { padding-bottom: 6px; border-top: 1px solid var(--tt-line); }
.tt-group:first-of-type { border-top: 0; }

.tt-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 22px;
}

.tt-group-title { font-size: 16px; }

.tt-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--tt-amber-bg);
    color: var(--tt-amber-ink);
    font-size: 12px;
}

.tt-group-meta { font-size: 14px; color: var(--tt-muted); }
.tt-group-meta strong { font-weight: 400; color: var(--tt-ink); }

.tt-group-sub {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 8px 0 4px;
    font-size: 14px;
    color: var(--tt-muted);
}

/* --------------------------------------------------------------- artikel */

.tt-item { padding: 14px 0; border-top: 1px solid var(--tt-line-soft); }

.tt-item-name { margin: 0 0 4px; font-size: 15px; }

.tt-item-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.tt-spec { color: var(--tt-soft); }

.tt-status--done { color: var(--tt-ink); }
.tt-status--moving { color: var(--tt-accent); }
.tt-status--queued { color: var(--tt-soft); }

.tt-status--waiting {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tt-amber-bg);
    color: var(--tt-amber-ink);
}

/* ----------------------------------------------------------------- nodes */

.tt-cell { display: flex; align-items: center; justify-content: center; }

.tt-line { flex: 1 1 auto; min-width: 6px; height: 1px; }
.tt-line.is-blank { background: transparent; }
.tt-line.is-empty { background: var(--tt-line); }
.tt-line.is-filled { background: var(--tt-ink); }

/* De stap waar nu aan gewerkt wordt: een donker segment dat over het lichte balkje
   naar de volgende node schuift. Zonder beweging leest een gevulde bol als "klaar". */
.tt-line.is-progress {
    position: relative;
    height: 2px;
    border-radius: 1px;
    background: var(--tt-line);
    overflow: hidden;
}

.tt-line.is-progress::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    border-radius: inherit;
    background: var(--tt-ink);
    animation: tt-travel 1.9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.tt-line.is-progress.is-waiting::after { background: var(--tt-amber-line); }

@keyframes tt-travel {
    0%   { transform: translateX(-100%); }
    65%  { transform: translateX(222%); }
    100% { transform: translateX(222%); }
}

.tt-node {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--tt-line);
    border-radius: 50%;
    background: #FFFFFF;
}

.tt-node--done { border-color: var(--tt-ink); }
.tt-node--active { background: var(--tt-ink); border-color: var(--tt-ink); }
.tt-node--waiting { background: var(--tt-amber-node); border-color: var(--tt-amber-node); }

/* Een ring die uitdijt en vervaagt, in de maat van het balkje ernaast. Dit is het
   verschil tussen "hier zijn we nu" en "dit is gebeurd". */
.tt-node--active, .tt-node--waiting { position: relative; }

.tt-node--active::after,
.tt-node--waiting::after {
    content: '';
    position: absolute;
    inset: -1px;
    border: 2px solid var(--tt-ink);
    border-radius: 50%;
    pointer-events: none;
    animation: tt-pulse 1.9s ease-out infinite;
}

.tt-node--waiting::after { border-color: var(--tt-amber-node); }

@keyframes tt-pulse {
    0%   { transform: scale(1); opacity: 0.5; }
    70%  { transform: scale(1.75); opacity: 0; }
    100% { transform: scale(1.75); opacity: 0; }
}

/* Wie beweging heeft uitgezet krijgt hetzelfde verschil, alleen stil: een halve balk
   en een vaste ring lezen ook als "hier zijn we nu". */
@media (prefers-reduced-motion: reduce) {
    .tt-line.is-progress::after { animation: none; width: 50%; }

    .tt-node--active::after,
    .tt-node--waiting::after { animation: none; opacity: 0.35; }
}

/* ---------------------------------------------------------------- footer */

.tt-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--tt-line);
    font-size: 14px;
    color: var(--tt-muted);
}

.tt-foot strong { font-weight: 400; color: var(--tt-ink); }
.tt-footnote { color: var(--tt-soft); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
    .tt { padding: 24px 16px 40px; }

    .tt-hero {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 28px 0 24px;
    }

    .tt-title { font-size: 26px; }

    .tt-ring {
        justify-self: start;
        width: 180px;
        height: 180px;
    }

    .tt-ring-day { font-size: 38px; }

    .tt-row { grid-template-columns: 1fr; gap: 10px; }
    .tt-row--head { display: none; }

    .tt-node { width: 30px; height: 30px; }
}

/* ---------------------------------------------------------------------------
   Debug panel — staff only, never rendered for customers. Deliberately plain:
   it must not read as part of the page it is diagnosing.
   --------------------------------------------------------------------------- */

.tt-debug-link {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px 40px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.tt-debug-link a { color: #6B7280; }

.tt-debug {
    max-width: 1040px;
    margin: 0 auto 48px;
    padding: 20px 24px 28px;
    border: 1px solid #D7DEE3;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #1F2937;
}

.tt-debug-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #E3E9ED;
}

.tt-debug-head strong { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.tt-debug-head span { color: #8A5A18; }

.tt-debug h3 {
    margin: 22px 0 8px;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6B7280;
}

.tt-debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 6px 18px;
}

.tt-debug-grid span { color: #6B7280; margin-right: 6px; }
.tt-debug-grid code { color: #063752; word-break: break-all; }

.tt-debug-block {
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #E3E9ED;
    border-radius: 6px;
    background: #FBFCFD;
}

.tt-debug-title { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.tt-debug-badge { font-weight: 600; }
.tt-debug-muted { color: #6B7280; word-break: break-all; }

.tt-debug pre {
    margin: 8px 0 0;
    padding: 10px 12px;
    overflow-x: auto;
    max-height: 340px;
    border-radius: 6px;
    background: #F4F6F8;
    font-size: 11.5px;
    line-height: 1.5;
}

.tt-debug-scroll { overflow-x: auto; }

.tt-debug table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tt-debug th, .tt-debug td { padding: 6px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #E3E9ED; }
.tt-debug th { color: #6B7280; font-weight: 600; white-space: nowrap; }
.tt-debug td a { color: #0A5A85; }

@media (max-width: 720px) {
    .tt-debug { margin: 0 16px 32px; padding: 16px; }
    .tt-debug-link { padding: 0 16px 28px; }
}

/* Shown only while the live status is being fetched; the page is already usable. */
.tt-live-note {
    max-width: 1040px;
    margin: -32px auto 0;
    padding: 0 24px 32px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: #6B7280;
}

@media (max-width: 720px) {
    .tt-live-note { padding: 0 16px 24px; }
}

/* Follow links, one per physical box — an order can leave in more than one. */

.tt-parcels {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 4px;
}

.tt-parcel {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border: 1px solid #CFE0EC;
    border-radius: 10px;
    background: #F7FBFD;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.tt-parcel:hover { border-color: #64ADE2; background: #EFF7FC; }

.tt-parcel-body { display: flex; flex-direction: column; gap: 2px; }
.tt-parcel-label { font-size: 14px; color: #0A5A85; }
.tt-parcel-meta { font-size: 12px; color: #4B5563; }

@media (max-width: 720px) {
    .tt-parcels { flex-direction: column; align-items: stretch; }
    .tt-parcel { justify-content: space-between; }
}

/* Offer to ship the available part while one article waits on stock. */
.tt-request {
    margin: 8px 0 4px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #FDF6EC;
    font-size: 14px;
    color: #8A5A18;
}

.tt-request .tt-link { color: #8A5A18; border-bottom-color: rgba(138, 90, 24, .35); }

/* Articles sharing one progress row. */
.tt-item-names {
    margin: 0 0 4px;
    padding: 0 0 0 16px;
    list-style: disc;
}

.tt-item-names li {
    font-size: 15px;
    color: #063752;
    margin-bottom: 2px;
}

/* Most support contact about an order is a wrong address; make it one click. */
.tt-address-check {
    display: inline-block;
    margin-left: 6px;
}

@media (max-width: 720px) {
    .tt-address-check { display: block; margin: 6px 0 0; }
}

/* --------------------------------------------------------- levering: herkomst */

/* Waar een levering vandaan komt. Nooit een leveranciersnaam en nooit het woord
   partner — het land verklaart waarom het langer duurt en klopt met de tracking. */
.tt-group-origin {
    font-size: 14px;
    color: var(--tt-muted);
}

.tt-badge--done {
    background: #E8F5E9;
    color: #1B5E20;
}

.tt-badge--later {
    background: #EDF1F3;
    color: #4B5563;
}

/* Wat er in een bundel zit: één artikel voor de klant, meerdere regels bij ons. */
.tt-item-includes {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--tt-soft);
}

/* ------------------------------------------------------------ zoekformulier */

/* De zoekpagina heeft geen rail, dus ook geen brede kolom nodig. */
.tt--narrow { max-width: 560px; }

.tt-lookup { padding: 40px 0 8px; }

.tt-lookup .tt-title { font-size: 30px; }
.tt-lookup .tt-intro { margin-bottom: 28px; }

.tt-error {
    margin: 0 0 22px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--tt-amber-bg);
    color: var(--tt-amber-ink);
    font-size: 15px;
}

.tt-form { display: flex; flex-direction: column; gap: 18px; }

.tt-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 0; }

.tt-field-label { font-size: 14px; color: var(--tt-muted); }

.tt-field-row { display: flex; gap: 18px; }

.tt-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--tt-line);
    border-radius: 8px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 16px;
    font-weight: 300;
    color: var(--tt-ink);
}

.tt-input:focus-visible {
    outline: none;
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px rgba(100, 173, 226, 0.28);
}

.tt-submit {
    align-self: flex-start;
    margin-top: 6px;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 300;
}

@media (max-width: 480px) {
    .tt-field-row { flex-direction: column; gap: 18px; }
}
