/* =============================================
   Portal de Rastreio — Complete Bari
   Primário: #006254  |  Lime: #C4FB5A (pontual)
   ============================================= */

:root {
    --brand:        #006254;
    --brand-dark:   #004a3d;
    --brand-accent: #C4FB5A;          /* usar só pontualmente */
    --brand-pale:   rgba(0,98,84,0.07);
    --bg-page:      #f6f7f8;
}

body {
    background-color: var(--bg-page);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Bootstrap overrides ──────────────────── */
.btn-primary {
    --bs-btn-bg:                 var(--brand);
    --bs-btn-border-color:       var(--brand);
    --bs-btn-hover-bg:           var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg:          var(--brand-dark);
    --bs-btn-focus-shadow-rgb:   0, 98, 84;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.6);
    color: #fff !important;
}

/* ── Consulta ─────────────────────────────── */
.page-consulta {
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.consulta-topbar {
    height: 4px;
    background: var(--brand);
    flex-shrink: 0;
}

.consulta-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.consulta-card {
    max-width: 480px;
    width: 100%;
}

.brand-logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Label "Portal de Rastreio" — separador elegante */
.portal-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.portal-label-line {
    width: 40px;
    height: 1px;
    background: #e5e7eb;
    display: block;
}

.portal-label-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}

.portal-label-text i {
    color: var(--brand);
    font-size: 0.75rem;
}

.consulta-form-card {
    background: #ffffff;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05),
                0 20px 60px -10px rgba(0,0,0,0.1) !important;
}

.consulta-titulo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.consulta-subtitulo {
    font-size: 0.93rem;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.6;
}

.consulta-btn {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.footer-consulta {
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

.alert-nao-encontrado {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 0.6rem;
    color: #9a3412;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
}

/* ── Resultado ────────────────────────────── */
.page-resultado {
    min-height: 100vh;
}

.resultado-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 1.75rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-logo {
    height: 36px;
    width: auto;
}

.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    background-color: var(--brand-pale);
    border: 1px solid rgba(0, 98, 84, 0.12);
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── Card destaque ────────────────────────── */
.card-destaque {
    border-left: 5px solid var(--brand) !important;
    border: 1px solid #d0e5de;
    background: #fff;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.meta-label {
    font-size: 0.77rem;
    color: #9ca3af;
    font-weight: 500;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a2e29;
}

/* ── Timeline ─────────────────────────────── */
.timeline-wrap {
    position: relative;
    padding-left: 2.25rem;
}

.timeline-wrap::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 1rem;
    bottom: 0.5rem;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

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

.timeline-dot {
    position: absolute;
    left: -1.575rem;
    top: 0.35rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background-color: #d1d5db;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d1d5db;
    z-index: 1;
}

.timeline-item.is-last .timeline-dot {
    width: 1.125rem;
    height: 1.125rem;
    left: -1.7rem;
    top: 0.2rem;
    background-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 98, 84, 0.2);
    border-color: #fff;
}

.timeline-content {
    min-height: 1.5rem;
}

/* ── Status badge ─────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ── Histórico cards ──────────────────────── */
.pedido-historico {
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    border: 1px solid #e9ecef !important;
    background: #fff;
}

.pedido-historico:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px);
}

/* ── Grupo de status no histórico ─────────── */
.grupo-status-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-count {
    background-color: #f3f4f6;
    color: #6b7280;
    border-radius: 1rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: auto;
}

/* ── Status icon colors ───────────────────── */
.status-entregue-icon           { color: #2e7d32; }
.status-processamento-icon      { color: #0277bd; }
.status-em-transito-icon        { color: #6a1b9a; }
.status-aguardando-retirada-icon { color: #4527a0; }
.status-atencao-icon            { color: #e65100; }
.status-devolucao-icon          { color: #bf360c; }
.status-problema-icon           { color: #b71c1c; }
.status-cancelado-icon          { color: #37474f; }
.status-em-aberto-icon          { color: #546e7a; }

/* ── Botão "Ver timeline" toggle ─────────── */
.btn-outline-secondary {
    --bs-btn-color:              var(--brand);
    --bs-btn-border-color:       #d1d5db;
    --bs-btn-hover-bg:           var(--brand-pale);
    --bs-btn-hover-color:        var(--brand);
    --bs-btn-hover-border-color: var(--brand);
}

.btn[data-bs-toggle="collapse"] .ver-label::after {
    content: ' ▾';
}
.btn[data-bs-toggle="collapse"][aria-expanded="true"] .ver-label::after {
    content: ' ▴';
}

/* ── Form focus ───────────────────────────── */
.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(0, 98, 84, 0.15);
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 576px) {
    .timeline-wrap       { padding-left: 2rem; }
    .card-destaque       { border-left-width: 3px !important; }
    .resultado-header h1 { font-size: 1.2rem !important; }
    .status-badge        { font-size: 0.75rem; }
    .header-logo         { height: 28px; }
}
