/* Colis Transit Tracker — styles publics */
.ctt-tracker {
    --ctt-blue: #1D4ED8;
    --ctt-blue-dark: #1E3A8A;
    --ctt-blue-light: #EFF6FF;
    --ctt-orange: #F97316;
    --ctt-orange-dark: #C2410C;
    --ctt-slate-50: #F8FAFC;
    --ctt-slate-100: #F1F5F9;
    --ctt-slate-400: #94A3B8;
    --ctt-slate-500: #64748B;
    --ctt-slate-800: #1E293B;
    font-family: -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

.ctt-hero { text-align: center; }
.ctt-hero__title {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    color: var(--ctt-slate-800);
    margin: 0 0 .5rem;
    letter-spacing: -0.01em;
}
.ctt-hero__subtitle { color: var(--ctt-slate-500); margin: 0 0 1.75rem; }

.ctt-search {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
}
.ctt-search__field {
    position: relative;
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
}
.ctt-search__field svg { position: absolute; left: 14px; color: var(--ctt-slate-400); }
.ctt-search__field input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.6rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: .95rem;
    font-family: "Courier New", monospace;
    letter-spacing: .03em;
    box-shadow: 0 4px 24px -6px rgba(15,23,42,.08);
}
.ctt-search__field input:focus {
    outline: 2px solid var(--ctt-blue);
    outline-offset: 2px;
    border-color: var(--ctt-blue);
}

.ctt-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem 1.6rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background-color .15s ease;
}
.ctt-btn--primary { background: var(--ctt-blue); color: #fff; }
.ctt-btn--primary:hover { background: var(--ctt-blue-dark); }
.ctt-btn--primary:disabled { opacity: .6; cursor: not-allowed; }
.ctt-btn--orange { background: var(--ctt-orange); color: #fff; }
.ctt-btn--orange:hover { background: var(--ctt-orange-dark); }
.ctt-btn--whatsapp { background: #25D366; color: #fff; width: 100%; justify-content: center; margin-top: .75rem; text-decoration: none; }

.ctt-result { margin-top: 2rem; }

/* --- Étiquette de fret (signature visuelle) --- */
.ctt-ticket {
    position: relative;
    background: #fff;
    border: 1px solid #F1F5F9;
    border-radius: 20px;
    box-shadow: 0 12px 32px -8px rgba(15,23,42,.16);
    overflow: hidden;
    animation: ctt-fade-up .45s ease-out;
}
.ctt-ticket__notch {
    position: absolute;
    width: 24px; height: 24px;
    background: var(--ctt-slate-50);
    border-radius: 50%;
    top: 50%; transform: translateY(-50%);
}
.ctt-ticket__notch--left { left: -12px; }
.ctt-ticket__notch--right { right: -12px; }

.ctt-ticket__top { display: flex; flex-wrap: wrap; }
.ctt-ticket__photo {
    width: 100%; max-width: 200px; min-height: 180px;
    background: var(--ctt-blue-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--ctt-blue);
    padding: .5rem;
}
.ctt-ticket__photo img { width: 100%; height: 100%; object-fit: contain; }
.ctt-ticket__info { flex: 1; min-width: 220px; padding: 1.5rem; }

.ctt-badge {
    font-family: monospace;
    font-size: .8rem;
    color: var(--ctt-blue);
    background: var(--ctt-blue-light);
    padding: .25rem .6rem;
    border-radius: 6px;
    letter-spacing: .04em;
}
.ctt-status-pill {
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    padding: .3rem .8rem;
    border-radius: 999px;
    float: right;
}
.ctt-ticket__name { font-size: 1.2rem; font-weight: 700; color: var(--ctt-slate-800); margin: .75rem 0 1rem; clear: both; }

.ctt-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; font-size: .9rem; }
.ctt-info-grid span { display: block; font-size: .75rem; color: var(--ctt-slate-400); }
.ctt-info-grid strong { color: var(--ctt-slate-800); font-weight: 600; }

.ctt-perforation {
    height: 6px;
    background-image: radial-gradient(circle, var(--ctt-slate-50) 3px, transparent 3.5px);
    background-size: 16px 16px;
    background-repeat: repeat-x;
    background-position: center;
}

/* --- Timeline --- */
.ctt-timeline { padding: 1.75rem 1.5rem; display: flex; }
.ctt-timeline__step {
    flex: 1;
    text-align: center;
    padding: 0 .5rem;
    position: relative;
}
.ctt-timeline__node {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    margin: 0 auto .6rem;
    background: var(--ctt-slate-100);
    color: var(--ctt-slate-400);
    filter: grayscale(1);
    position: relative;
    z-index: 1;
}
.ctt-timeline__step--completed .ctt-timeline__node { background: #22C55E; color: #fff; filter: none; }
.ctt-timeline__step--current .ctt-timeline__node { color: #fff; filter: none; animation: ctt-pulse 1.8s ease-in-out infinite; }
.ctt-timeline__connector {
    position: absolute; top: 23px; left: 50%; width: 100%;
    height: 2px; background: #E2E8F0; z-index: 0;
}
.ctt-timeline__step:last-child .ctt-timeline__connector { display: none; }
.ctt-timeline__step--completed .ctt-timeline__connector { background: #22C55E; }
.ctt-timeline__label { font-size: .8rem; font-weight: 600; color: var(--ctt-slate-800); }
.ctt-timeline__step--upcoming .ctt-timeline__label { color: var(--ctt-slate-400); }
.ctt-timeline__desc { font-size: .72rem; color: var(--ctt-slate-500); margin-top: .2rem; line-height: 1.3; }

@media (max-width: 640px) {
    .ctt-timeline { flex-direction: column; gap: 1.25rem; align-items: flex-start; }
    .ctt-timeline__step { display: flex; align-items: flex-start; gap: 1rem; text-align: left; padding: 0; width: 100%; }
    .ctt-timeline__node { margin: 0; flex-shrink: 0; }
    .ctt-timeline__connector { display: none; }
}

/* --- Non trouvé --- */
.ctt-not-found { text-align: center; background: #fff; border: 1px solid #F1F5F9; border-radius: 20px; padding: 2.5rem 1.5rem; box-shadow: 0 4px 24px -6px rgba(15,23,42,.08); }
.ctt-not-found p:first-of-type { font-weight: 700; color: var(--ctt-slate-800); margin-top: 1rem; }
.ctt-not-found p { color: var(--ctt-slate-500); }

.ctt-error { text-align: center; color: #B91C1C; background: #FEF2F2; border-radius: 12px; padding: 1rem; }

/* --- WhatsApp flottant : voyant, texte visible, anneau pulsant --- */
.ctt-whatsapp { position: fixed; bottom: 22px; right: 22px; z-index: 9999; }
.ctt-whatsapp__toggle {
    position: relative;
    display: flex; align-items: center; gap: .55rem;
    height: 58px; padding: 0 1.3rem 0 1.1rem;
    border-radius: 999px;
    background: #25D366; color: #fff; border: none;
    box-shadow: 0 14px 34px -8px rgba(37,211,102,.55), 0 4px 10px rgba(0,0,0,.12);
    cursor: pointer;
    font-size: .95rem; font-weight: 700;
    font-family: inherit;
    transition: transform .15s ease;
}
.ctt-whatsapp__toggle:hover { transform: translateY(-2px) scale(1.03); }
.ctt-whatsapp__label { white-space: nowrap; }
.ctt-whatsapp__ring {
    position: absolute; inset: -6px; border-radius: 999px;
    border: 3px solid #25D366; opacity: .55;
    animation: ctt-wa-ring 1.8s ease-out infinite;
}
@keyframes ctt-wa-ring {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(1.18); opacity: 0; }
}

.ctt-whatsapp__panel {
    position: absolute; bottom: 74px; right: 0;
    width: 280px; background: #fff; border-radius: 18px;
    box-shadow: 0 16px 40px -10px rgba(15,23,42,.25);
    padding: 1.2rem; margin-bottom: .5rem;
}
.ctt-whatsapp__header { display: flex; justify-content: space-between; align-items: center; }
.ctt-whatsapp__header button { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--ctt-slate-400); line-height: 1; }
.ctt-whatsapp__panel p { font-size: .85rem; color: var(--ctt-slate-500); margin: .4rem 0 .9rem; }
.ctt-btn--whatsapp-outline {
    background: #fff; color: #128C4A; border: 1.5px solid #25D366;
    width: 100%; justify-content: center; text-decoration: none; margin-top: .55rem;
}

@media (max-width: 480px) {
    .ctt-whatsapp { right: 14px; bottom: 14px; }
    .ctt-whatsapp__label { display: none; }
    .ctt-whatsapp__toggle { width: 58px; padding: 0; justify-content: center; }
}

@keyframes ctt-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ctt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
    .ctt-ticket, .ctt-timeline__step--current .ctt-timeline__node, .ctt-whatsapp__ring { animation: none; }
}
