/* ── Variáveis ──────────────────────────────────────────────────────────── */
:root {
  --amarelo: #f2c94c;
  --amarelo-esc: #d4a800;
  --cinza-bg: #f0f2f5;
  --cinza-card: #ffffff;
  --cinza-borda: #e0e0e0;
  --texto: #222222;
  --texto-muted: #757575;
  --verde: #27ae60;
  --azul: #2d6cdf;
  --sombra: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
* { font-family: 'Montserrat', sans-serif; }
body {
  background-color: var(--cinza-bg);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 48px 0 100px;
  overflow: hidden;
  flex-shrink: 0;
}

.header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 10% 120%, rgba(242,201,76,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 400px 200px at 90% -20%, rgba(242,201,76,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.header-content {
  position: relative;
  text-align: center;
  color: #fff;
}

.logo {
  height: 52px;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
}

.logo-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--amarelo);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 16px;
}

.header-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.header-subtitle {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.8;
  margin: 0;
}

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 0 0 48px;
}

/* ── Card de Busca ──────────────────────────────────────────────────────── */
.search-card {
  background: var(--cinza-card);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  margin-top: -52px;
  position: relative;
  z-index: 10;
}

.search-card-inner {
  padding: 32px;
}

.search-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 24px;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-muted);
  margin-bottom: 6px;
}

.form-select,
.form-control {
  border: 1.5px solid var(--cinza-borda);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus,
.form-control:focus {
  border-color: var(--amarelo);
  box-shadow: 0 0 0 3px rgba(242,201,76,0.2);
  outline: none;
}

.btn-rastrear {
  background: var(--amarelo);
  color: #1a1a2e;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.btn-rastrear:hover {
  background: var(--amarelo-esc);
  transform: translateY(-1px);
  color: #fff;
}

.btn-rastrear:active { transform: translateY(0); }
.btn-rastrear:disabled { opacity: 0.7; cursor: not-allowed; }

/* ── Card de Pedido ─────────────────────────────────────────────────────── */
.pedido-card {
  background: var(--cinza-card);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow: hidden;
  margin-top: 24px;
}

.pedido-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #fff;
}

.pedido-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pedido-numero {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.pedido-transportadora {
  background: rgba(242,201,76,0.2);
  color: var(--amarelo);
  border: 1px solid rgba(242,201,76,0.4);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.pedido-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  padding: 8px 14px;
  border-radius: 20px;
}

.status-icon {
  font-size: 1.1rem;
}

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Meta ───────────────────────────────────────────────────────────────── */
.pedido-meta {
  padding: 14px 24px;
  border-bottom: 1px solid var(--cinza-borda);
  background: #fafafa;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--texto-muted);
  padding: 4px 12px 4px 0;
}

.meta-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.meta-value { font-weight: 500; color: var(--texto); }

/* ── Timeline ───────────────────────────────────────────────────────────── */
.timeline-section {
  padding: 20px 24px 24px;
}

.timeline-title {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-muted);
  margin-bottom: 16px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--amarelo) 0%, var(--cinza-borda) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

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

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cinza-bg);
  border: 2px solid var(--cinza-borda);
  z-index: 1;
  transition: all 0.2s;
}

.timeline-item:first-child .timeline-dot {
  background: var(--amarelo);
  border-color: var(--amarelo);
  box-shadow: 0 0 0 3px rgba(242,201,76,0.25);
}

.timeline-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texto-muted);
  margin-bottom: 3px;
}

.timeline-desc {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--texto);
  line-height: 1.4;
}

.timeline-item:first-child .timeline-desc {
  color: #1a1a2e;
  font-weight: 700;
}

.timeline-local {
  font-size: 0.78rem;
  margin-top: 2px;
}

/* ── Status cores ───────────────────────────────────────────────────────── */
.status-entregue .pedido-status-badge { background: rgba(39,174,96,0.15); color: var(--verde); }
.status-entregue .status-icon::before { content: '✅'; }
.status-transito .status-icon::before { content: '🚚'; }
.status-nao-encontrado .status-icon::before { content: '📦'; }

/* ── Vazio / Error ──────────────────────────────────────────────────────── */
.empty-icon {
  font-size: 4rem;
  color: var(--cinza-borda);
}

.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.5);
  padding: 20px 0;
  font-size: 0.82rem;
  text-align: center;
  flex-shrink: 0;
}

.site-footer a {
  color: var(--amarelo);
  text-decoration: none;
}

.site-footer p { margin: 0; }

/* ── Responsivo ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 32px 0 80px; }
  .header-title { font-size: 1.5rem; }
  .search-card-inner { padding: 20px; }
  .pedido-header { flex-direction: column; align-items: flex-start; }
  .timeline-section { padding: 16px; }
}

/* ── Loading skeleton ───────────────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
}
