/* ===== Timeline de produção (página da cliente) =====
   Complementa o style.css: reaproveita .card, .header, .logo, .title, .btn e .footer. */

[hidden] { display: none !important; }

.tl-card { max-width: 30rem; }

.tl-marca {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.tl-titulo {
    font-family: 'Jersey 10', cursive;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.05;
    margin-bottom: 10px;
}

.tl-texto {
    font-size: 14px;
    line-height: 1.55;
    color: #ddd;
}

/* ----- Busca pelo código ----- */
.tl-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0 6px;
    text-align: left;
}

.tl-rotulo {
    font-size: 13px;
    font-weight: 600;
    color: #caaeff;
}

.tl-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid rgba(101, 65, 151, 0.7);
    background: rgba(18, 9, 30, 0.9);
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 20px;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
}

.tl-form input::placeholder { color: #6f5a8f; }

.tl-form input:focus-visible {
    outline: none;
    border-color: #7FFF00;
    box-shadow: 0 0 0 3px rgba(127, 255, 0, 0.25);
}

.tl-erro {
    font-size: 13px;
    font-weight: 600;
    color: #ff9c9c;
}

/* <button> com a aparência dos .btn do site */
button.btn {
    width: 100%;
    font-family: inherit;
    cursor: pointer;
}

button.btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ----- Pedido encontrado ----- */
.tl-saudacao {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.tl-pedido {
    margin-top: 4px;
    font-size: 13px;
    color: #caaeff;
    overflow-wrap: anywhere;
}

.tl-pedido b {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ADFF2F;
}

/* Palco da cena animada */
.tl-palco {
    margin: 18px 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(101, 65, 151, 0.55);
    background:
        radial-gradient(circle at 50% 38%, rgba(178, 75, 243, 0.28), transparent 62%),
        #12091e;
    aspect-ratio: 320 / 200;
    overflow: hidden;
}

.cena {
    display: block;
    width: 100%;
    height: 100%;
}

.tl-fase {
    font-family: 'Jersey 10', cursive;
    font-size: 20px;
    letter-spacing: 3px;
    color: #ADFF2F;
}

.tl-etapa {
    font-family: 'Jersey 10', cursive;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1;
    margin: 2px 0 8px;
    text-wrap: balance;
}

/* Barra de progresso (XP) */
.tl-xp {
    height: 12px;
    margin-top: 16px;
    border-radius: 999px;
    border: 1px solid rgba(101, 65, 151, 0.7);
    background: rgba(18, 9, 30, 0.9);
    overflow: hidden;
}

.tl-xp-barra {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #7FFF00, #ADFF2F);
    box-shadow: 0 0 12px rgba(127, 255, 0, 0.55);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-previsao {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(127, 255, 0, 0.45);
    background: rgba(127, 255, 0, 0.08);
    font-size: 13px;
    color: #e6ffc7;
}

.tl-previsao b { color: #fff; }

/* ----- Lista vertical de etapas ----- */
.tl-lista {
    list-style: none;
    margin: 28px 0 6px;
    text-align: left;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 30px 1fr;
    column-gap: 14px;
    padding-bottom: 20px;
}

.tl-item:last-child { padding-bottom: 0; }

/* Linha que liga uma etapa à seguinte */
.tl-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: rgba(101, 65, 151, 0.45);
}

.tl-item:last-child::before { display: none; }
.tl-item.feita::before { background: #7FFF00; }

.tl-ponto {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(101, 65, 151, 0.7);
    background: #180e26;
    font-size: 13px;
    font-weight: 700;
    color: #9B67CF;
}

.tl-item.feita .tl-ponto {
    border-color: #7FFF00;
    background: #7FFF00;
    color: #0a0510;
}

.tl-item.atual .tl-ponto {
    border-color: #B24BF3;
    background: #B24BF3;
    color: #fff;
    animation: tl-pulso 1.8s ease-out infinite;
}

@keyframes tl-pulso {
    0%   { box-shadow: 0 0 0 0 rgba(178, 75, 243, 0.7); }
    100% { box-shadow: 0 0 0 12px rgba(178, 75, 243, 0); }
}

.tl-item-texto { padding-top: 4px; min-width: 0; }

.tl-item-titulo {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.tl-item.futura .tl-item-titulo { color: #9887b3; font-weight: 600; }

.tl-item-info {
    margin-top: 1px;
    font-size: 12px;
    color: #b9a8d4;
}

.tl-item.atual .tl-item-info { color: #ADFF2F; font-weight: 600; }

.tl-atualizado {
    margin: 18px 0 22px;
    font-size: 12px;
    color: #9887b3;
}

.tl-card .links { margin-bottom: 0; }

@media (max-width: 420px) {
    .tl-card { padding: 28px 18px; }
    .tl-etapa { font-size: 36px; }
    .tl-form input { font-size: 18px; letter-spacing: 2px; }
}

/* ===================================================================
   Cenas animadas (timeline-cenas.js)
   Em elementos SVG, transform parte da origem do grupo onde estão,
   por isso cada peça animada fica dentro de um <g transform="translate(...)">.
   =================================================================== */

/* Brilhos que piscam (várias cenas) */
.cena .brilho { animation: cena-brilho 2.4s ease-in-out infinite; }
.cena .b2 { animation-delay: 0.8s; }
.cena .b3 { animation-delay: 1.6s; }
@keyframes cena-brilho {
    0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    50%      { transform: scale(1) rotate(45deg); opacity: 1; }
}

/* 1. Pedido confirmado */
.c1-papel { animation: c1-flutuar 3.6s ease-in-out infinite; }
@keyframes c1-flutuar {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.c1-selo { animation: c1-selo 3.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
@keyframes c1-selo {
    0%, 8%   { transform: scale(0); }
    24%, 92% { transform: scale(1); }
    100%     { transform: scale(0); }
}
.c1-check { stroke-dasharray: 1; animation: c1-check 3.6s ease-out infinite; }
@keyframes c1-check {
    0%, 23%  { stroke-dashoffset: 1; opacity: 0; }
    24%      { stroke-dashoffset: 1; opacity: 1; }
    42%, 90% { stroke-dashoffset: 0; opacity: 1; }
    96%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

/* 3. Tufagem — 4 fileiras de 2s cada */
.c3-fios { animation: c3-ciclo 8s linear infinite; }
@keyframes c3-ciclo {
    0%, 97% { opacity: 1; }
    100%    { opacity: 0; }
}
.c3-fio { stroke-dasharray: 1; animation: 8s linear infinite; }
.c3-fio.f1 { animation-name: c3-f1; }
.c3-fio.f2 { animation-name: c3-f2; }
.c3-fio.f3 { animation-name: c3-f3; }
.c3-fio.f4 { animation-name: c3-f4; }
@keyframes c3-f1 { 0% { stroke-dashoffset: 1; } 25%, 100% { stroke-dashoffset: 0; } }
@keyframes c3-f2 { 0%, 25% { stroke-dashoffset: 1; } 50%, 100% { stroke-dashoffset: 0; } }
@keyframes c3-f3 { 0%, 50% { stroke-dashoffset: 1; } 75%, 100% { stroke-dashoffset: 0; } }
@keyframes c3-f4 { 0%, 75% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

.c3-linha { animation: c3-linha 8s step-end infinite; }
@keyframes c3-linha {
    0%        { transform: translateY(0); }
    25%       { transform: translateY(28px); }
    50%       { transform: translateY(56px); }
    75%, 100% { transform: translateY(84px); }
}
.c3-vai { animation: c3-vai 2s linear infinite; }
@keyframes c3-vai {
    from { transform: translateX(0); }
    to   { transform: translateX(172px); }
}
.c3-treme { animation: c3-treme 0.12s linear infinite alternate; }
@keyframes c3-treme {
    from { transform: translate(0, 0); }
    to   { transform: translate(1.6px, -1.6px); }
}

/* 4. Colagem e secagem — rolo passa (metade do ciclo), depois seca */
.c4-cola { animation: c4-cola 7s linear infinite; }
@keyframes c4-cola {
    0%, 4%   { transform: scaleX(0); opacity: 0.86; }
    42%, 94% { transform: scaleX(1); opacity: 0.86; }
    100%     { transform: scaleX(1); opacity: 0; }
}
.c4-rolo { animation: c4-rolo 7s linear infinite; }
@keyframes c4-rolo {
    0%        { transform: translateX(-16px); opacity: 0; }
    4%        { transform: translateX(0); opacity: 1; }
    42%       { transform: translateX(180px); opacity: 1; }
    48%, 100% { transform: translateX(196px); opacity: 0; }
}
.c4-onda { opacity: 0.9; animation: c4-onda 7s ease-out infinite; }
.c4-onda.o2 { animation-delay: 0.3s; }
.c4-onda.o3 { animation-delay: 0.6s; }
@keyframes c4-onda {
    0%, 46%  { transform: translateY(10px); opacity: 0; }
    54%      { transform: translateY(4px); opacity: 0.95; }
    66%      { transform: translateY(-8px); opacity: 0; }
    67%      { transform: translateY(10px); opacity: 0; }
    75%      { transform: translateY(4px); opacity: 0.95; }
    87%, 100% { transform: translateY(-8px); opacity: 0; }
}
.c4-ponteiro { animation: c4-ponteiro 3.5s linear infinite; }
@keyframes c4-ponteiro { to { transform: rotate(360deg); } }

/* 5. Acabamento — lâminas abrindo e fechando, fiapos voando */
.c5-lamina-a { animation: c5-lamina-a 0.32s ease-in-out infinite alternate; }
.c5-lamina-b { animation: c5-lamina-b 0.32s ease-in-out infinite alternate; }
@keyframes c5-lamina-a { from { transform: rotate(16deg); } to { transform: rotate(0deg); } }
@keyframes c5-lamina-b { from { transform: rotate(-16deg); } to { transform: rotate(0deg); } }
.c5-fiapo { animation: c5-fiapo 0.64s ease-out infinite; }
.c5-fiapo.p2 { animation-delay: 0.2s; }
.c5-fiapo.p3 { animation-delay: 0.4s; }
@keyframes c5-fiapo {
    0%   { transform: translate(0, 0); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(16px, -30px); opacity: 0; }
}

/* 6. Pronto — a tampa fecha a caixa */
.c6-tampa { animation: c6-tampa 4.5s ease-in-out infinite; }
@keyframes c6-tampa {
    0%       { transform: translateY(-46px) rotate(-10deg); }
    22%      { transform: translateY(0) rotate(0deg); }
    28%      { transform: translateY(-7px) rotate(2deg); }
    34%, 90% { transform: translateY(0) rotate(0deg); }
    100%     { transform: translateY(-46px) rotate(-10deg); }
}

/* 7. Entregue — LEVEL UP! e confete */
.c7-texto { animation: c7-texto 1.1s ease-in-out infinite alternate; }
@keyframes c7-texto {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-7px) scale(1.07); }
}
.c7-confete { animation: c7-confete 3s linear infinite; }
@keyframes c7-confete {
    0%   { transform: translateY(-14px) rotate(0deg); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(196px) rotate(540deg); opacity: 0; }
}

/* Quem pediu menos movimento vê as cenas paradas no estado final */
@media (prefers-reduced-motion: reduce) {
    .cena *,
    .tl-item.atual .tl-ponto {
        animation: none !important;
    }
    .c7-confete { opacity: 0; }
    .tl-xp-barra { transition: none; }
}
