/* =========================================================
   Rastreo público (/rastreo). Se monta sobre style.css y
   home.css: navbar, hero azul con ola, botones y footer son
   los de la portada; aquí sólo vive lo propio de la página.
   ========================================================= */

[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.r-hero {
    padding: 9rem 0 10rem;
}

.r-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.r-hero .h-lead {
    margin-inline: auto;
}

/* ---------- Tarjeta de búsqueda ---------- */
.r-card {
    width: min(100%, 46rem);
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 24px;
    background: #fff;
    color: var(--foreground);
    text-align: left;
    box-shadow: 0 30px 60px -28px rgba(20, 18, 110, 0.7);
}

.r-card label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.r-search {
    display: flex;
    gap: 0.75rem;
}

.r-input {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    color: var(--muted);
    transition: var(--transition);
}

.r-input:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px var(--secondary-soft);
}

.r-input input {
    width: 100%;
    padding: 1rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--foreground);
    font: inherit;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.r-input input::placeholder {
    color: #94a3b8;
    letter-spacing: 0;
}

.r-search .btn {
    flex-shrink: 0;
    border: 0;
    border-radius: 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.r-search .btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.r-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.r-error {
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ---------- Resultado ---------- */
.r-result {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.r-result-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.r-status-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 16px;
    background: var(--secondary-soft);
    color: var(--secondary);
}

.r-result.is-delivered .r-status-icon {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.r-result.is-cancelled .r-status-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.r-result-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary);
}

.r-result.is-cancelled .r-result-label {
    color: var(--primary);
}

.r-result h2 {
    margin: 0.15rem 0 0.3rem;
    font-size: 1.4rem;
    line-height: 1.3;
}

.r-result-top p {
    color: var(--muted);
    font-size: 0.95rem;
}

.r-number {
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.r-number strong {
    margin-left: 0.35rem;
    color: var(--foreground);
    letter-spacing: 0.02em;
}

/* Barra de pasos: una línea detrás de los íconos que se pinta hasta el paso actual */
.r-steps {
    --avance: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.r-steps::before,
.r-steps::after {
    content: '';
    position: absolute;
    top: 1.375rem;
    left: 12.5%;
    height: 3px;
    border-radius: 3px;
}

.r-steps::before {
    right: 12.5%;
    background: var(--accent);
}

.r-steps::after {
    width: calc(75% * var(--avance));
    background: var(--secondary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.r-steps li {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
}

.r-step-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 3px solid #fff;
    background: var(--accent);
    transition: var(--transition);
}

.r-steps li.is-done {
    color: var(--foreground);
}

.r-steps li.is-done .r-step-icon {
    background: var(--secondary);
    color: #fff;
}

.r-steps li.is-current .r-step-icon {
    box-shadow: 0 0 0 5px var(--secondary-soft);
}

.r-result.is-delivered .r-steps::after,
.r-result.is-delivered .r-steps li.is-done .r-step-icon {
    background: #16a34a;
}

.r-result.is-delivered .r-steps li.is-current .r-step-icon {
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.15);
}

.r-result .r-hint {
    margin-top: 1.5rem;
}

/* ---------- Ayuda ---------- */
.r-ayuda {
    padding: 2rem 0 5.5rem;
}

.r-ayuda-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.r-ayuda-item {
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
}

.r-ayuda-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-radius: 14px;
}

.r-ayuda-icon.is-blue { background: var(--secondary-soft); color: var(--secondary); }
.r-ayuda-icon.is-red { background: var(--primary-soft); color: var(--primary); }

.r-ayuda-item h3 {
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.r-ayuda-item p {
    color: var(--muted);
    font-size: 0.95rem;
}

.r-ayuda-item a {
    color: var(--secondary);
    font-weight: 600;
}

/* Enlace de la página actual en el navbar */
.nav-links .is-current {
    color: var(--primary);
}

@media (max-width: 968px) {
    .r-hero {
        padding: 8rem 0 8.5rem;
    }

    .r-ayuda-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .r-card {
        padding: 1.4rem;
        border-radius: 20px;
    }

    .r-search {
        flex-direction: column;
    }

    .r-search .btn {
        width: 100%;
        min-height: 3.25rem;
    }

    .r-steps li {
        font-size: 0.75rem;
    }

    .r-step-icon {
        width: 2.4rem;
        height: 2.4rem;
    }

    .r-steps::before,
    .r-steps::after {
        top: 1.2rem;
    }

    .r-result h2 {
        font-size: 1.2rem;
    }
}
