/* ============================================================
   home-shipment.css — Terceira página inicial "Remessa com caminhão"
   Reescrita fiel ao design de referência (cargoencomenda.com)
   Tokens de cor do design de referência:
   --primary: #E11F25 | --secondary: #22315E | --bg: #f8fafc | --surface: #ffffff
   ============================================================ */

:root {
  --primary: #E11F25;
  --primary-hover: #c4181e;
  --primary-light: #fef2f2;
  --primary-dark: #7f0000;
  --secondary: #22315E;
  --secondary-hover: #192548;
  --secondary-light: #eef2ff;
  --secondary-dark: #0f172a;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-border: #fcd34d;
  --success: #10b981;
  --success-light: #ecfdf5;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.1);
}

html { scroll-behavior: smooth; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-tap-highlight-color: transparent; }

button, input, select, a, .btn-main, .map-recenter-btn { touch-action: manipulation; }

body {
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  color: var(--text-main);
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--surface);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.06);
  margin: 0 auto;
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

@media (max-width: 479px) {
  .app-shell { width: 100%; max-width: 100%; margin: 0; border-radius: 0; box-shadow: none; padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
  .app-header { width: 100%; max-width: 100%; margin: 0; border-radius: 0; }
}

@media (min-width: 480px) {
  .app-shell { min-height: 100vh; border-radius: 0; margin: 0 auto; border: none; padding-top: 56px; }
}

/* Top App Bar Header 100% Fixo e Imutável */
.app-header {
  background: #ffffff;
  padding: env(safe-area-inset-top, 0px) 16px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 480px;
  z-index: 999999;
  height: calc(56px + env(safe-area-inset-top, 0px));
  min-height: 56px;
  border-bottom: 2px solid var(--secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  transform: none !important;
  backface-visibility: hidden;
}

.brand-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  margin: 0 auto;
}

.brand-wrap.dual-brand {
  gap: 14px;
}

.header-logo-img { height: 30px; max-height: 30px; width: auto; object-fit: contain; display: block; transition: all 0.2s ease; }

.brand-wrap.dual-brand .header-logo-img { height: 24px; max-height: 24px; }

.header-gov-img {
  height: 22px;
  max-height: 22px;
  width: auto;
  object-fit: contain;
  display: none;
  transition: all 0.2s ease;
}

.brand-wrap.dual-brand .header-gov-img { display: block; }

.header-brand-divider {
  width: 1.5px;
  height: 20px;
  background: #cbd5e1;
  display: none;
  flex-shrink: 0;
  border-radius: 1px;
}

.brand-wrap.dual-brand .header-brand-divider { display: block; }

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
  width: 100%;
}

/* Step views */
.step-view { display: none; flex-direction: column; flex: 1; opacity: 0; transform: translateY(6px); }
.step-view.active { display: flex; animation: nativeSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes nativeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-padded { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.info-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field-wrapper { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.app-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #f8fafc;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.2s;
  -webkit-text-size-adjust: 100%;
}

.app-input:focus {
  outline: none;
  border-color: var(--secondary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(34, 49, 94, 0.15);
}

.btn-main {
  width: 100%;
  height: 48px;
  background: #E11F25;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(225, 31, 37, 0.25);
  user-select: none;
  -webkit-user-select: none;
}

.btn-main:active { background: #c4181e; transform: scale(0.98); box-shadow: 0 2px 6px rgba(225, 31, 37, 0.2); }

/* Alerta de divergência (retenção) */
.alert-divergence-bar {
  background: linear-gradient(135deg, #fff7f7 0%, #fef2f2 100%);
  border-bottom: 1.5px solid #fee2e2;
  border-left: 4px solid #E11F25;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(225, 31, 37, 0.05);
}

.alert-divergence-icon {
  width: 36px; height: 36px; border-radius: 10px; background: #fee2e2; color: #E11F25;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(225, 31, 37, 0.15); margin-top: 1px;
}

.alert-divergence-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.alert-title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.alert-urgency-pill {
  font-size: 0.60rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; background: #E11F25; color: #ffffff;
  padding: 2px 6px; border-radius: 4px; display: inline-block; line-height: 1.2;
}

.alert-divergence-text h4 { font-size: 0.88rem; font-weight: 800; color: #991b1b; line-height: 1.25; margin: 0; }
.alert-divergence-text p { font-size: 0.78rem; color: #7f1d1d; line-height: 1.4; font-weight: 500; margin: 2px 0 0; }

/* Mapa interativo */
.map-container-wrap { position: relative; height: 180px; width: 100%; background: #e2e8f0; overflow: hidden; }
#deliveryMap { width: 100%; height: 100%; z-index: 1; }
.map-floating-badge {
  position: absolute; bottom: 10px; left: 12px; right: 12px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); padding: 8px 12px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); z-index: 10; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.map-badge-info h4 { font-size: 0.8rem; font-weight: 700; color: var(--text-main); }
.map-badge-info p { font-size: 0.7rem; color: var(--text-muted); }
.map-eta { font-size: 0.75rem; font-weight: 800; color: #E11F25; background: #fee2e2; padding: 3px 8px; border-radius: 6px; border: 1px solid #fca5a5; }

/* Cabeçalho de card */
.card-heading-row { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); margin-bottom: 12px; }
.card-heading-title { font-size: 0.85rem; font-weight: 700; color: var(--secondary); display: flex; align-items: center; gap: 6px; }
.barcode-display { font-family: monospace; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

.product-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.product-avatar { width: 44px; height: 44px; border-radius: var(--radius-sm); background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 1px solid var(--border); flex-shrink: 0; }
.product-meta h3 { font-size: 0.88rem; font-weight: 700; color: var(--text-main); line-height: 1.25; }
.product-meta p { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f8fafc; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.data-grid-item .label { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; display: block; margin-bottom: 2px; }
.data-grid-item .val { font-size: 0.82rem; font-weight: 700; color: var(--text-main); word-break: break-word; }

/* Título do rastreio */
.tracking-card-title { font-size: 0.95rem; font-weight: 800; color: #0f172a; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }

/* Timeline de rastreamento */
.tracking-timeline-list { display: flex; flex-direction: column; position: relative; }
.tracking-item { display: flex; align-items: flex-start; position: relative; min-height: 64px; }
.tracking-item:last-child { min-height: auto; }
.tracking-item-time { width: 62px; flex-shrink: 0; text-align: right; padding-right: 12px; padding-top: 1px; }
.tracking-item-time .day { display: block; font-size: 0.78rem; font-weight: 700; color: #1e293b; line-height: 1.1; }
.tracking-item-time .hour { display: block; font-size: 0.7rem; font-weight: 500; color: #64748b; margin-top: 2px; }
.tracking-item-axis { width: 24px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; position: relative; align-self: stretch; }
.tracking-bullet-ring { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #E11F25; background: #ffffff; display: flex; align-items: center; justify-content: center; z-index: 2; position: relative; box-shadow: 0 0 0 3px rgba(225, 31, 37, 0.15); flex-shrink: 0; animation: livePulseRing 2s infinite cubic-bezier(0.4, 0, 0.6, 1); }
.tracking-bullet-ring .bullet-inner { width: 8px; height: 8px; border-radius: 50%; background: #E11F25; animation: livePulseDot 2s infinite ease-in-out; }
@keyframes livePulseRing {
  0% { box-shadow: 0 0 0 0 rgba(225, 31, 37, 0.6), 0 0 0 2px rgba(225, 31, 37, 0.2); }
  70% { box-shadow: 0 0 0 8px rgba(225, 31, 37, 0), 0 0 0 3px rgba(225, 31, 37, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 31, 37, 0), 0 0 0 0 rgba(225, 31, 37, 0); }
}
@keyframes livePulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.85; }
}
.tracking-bullet-check { width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; display: flex; align-items: center; justify-content: center; z-index: 2; position: relative; color: #ffffff; flex-shrink: 0; }
.tracking-bullet-check svg { width: 10px; height: 10px; stroke-width: 3.5; }
.tracking-axis-line { position: absolute; top: 18px; bottom: 0px; left: 50%; transform: translateX(-50%); width: 0; border-left: 2px dashed #94a3b8; z-index: 1; }
.tracking-item:last-child .tracking-axis-line { display: none; }
.tracking-item-content { flex: 1; padding-left: 12px; padding-bottom: 18px; }
.tracking-item-content h4 { font-size: 0.85rem; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.tracking-item-content h4.title-alert { color: #E11F25; }
.tracking-item-content h4.title-done { color: #1e293b; }
.tracking-item-content p.desc { font-size: 0.76rem; color: #475569; line-height: 1.35; margin-bottom: 4px; }
.tracking-item-content p.location-tag { font-size: 0.7rem; font-weight: 600; color: #64748b; }

/* Bottom action bar (sticky) */
.bottom-action-bar { padding: 12px 16px; background: #ffffff; border-top: 1px solid var(--border); position: sticky; bottom: 0; z-index: 20; }
.btn-warning-action {
  width: 100%; height: 48px; background: #E11F25; color: #ffffff; border: none; border-radius: var(--radius-md);
  font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(225, 31, 37, 0.3); transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease; user-select: none; -webkit-user-select: none;
}
.btn-warning-action:active { background: #c4181e; transform: scale(0.98); box-shadow: 0 2px 6px rgba(225, 31, 37, 0.2); }

/* Step 3 — Emissão de guia */
.guide-intro-card { background: #ffffff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.guide-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.guide-card-header h2 { font-size: 1.12rem; font-weight: 800; color: #0f172a; }
.guide-card-divider { border: none; border-top: 1.5px solid #e2e8f0; margin: 0 0 14px; }
.guide-intro-text { font-size: 0.85rem; color: #475569; line-height: 1.45; margin-bottom: 16px; }
.guide-steps-list { display: flex; flex-direction: column; gap: 12px; }
.guide-step-row { display: flex; align-items: flex-start; gap: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.guide-step-icon { width: 36px; height: 36px; border-radius: 8px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.guide-step-body h4 { font-size: 0.88rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.guide-step-body p { font-size: 0.78rem; color: #64748b; line-height: 1.35; }

.operation-summary-card { background: #ffffff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.operation-title { font-size: 1rem; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
.operation-details-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.operation-detail-row { display: flex; justify-content: space-between; align-items: flex-start; font-size: 0.82rem; gap: 8px; }
.op-label { color: #64748b; font-weight: 500; flex-shrink: 0; }
.op-val { color: #0f172a; font-weight: 700; text-align: right; }

/* Selo de autenticação SISCOMEX / RFB */
.gov-auth-seal-badge {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%); border: 1.5px dashed #10b981; border-radius: 12px; padding: 10px 12px; margin: 14px 0 0; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}
.gov-seal-icon-box { width: 34px; height: 34px; border-radius: 50%; background: #dcfce7; border: 1.5px solid #86efac; color: #059669; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15); }
.gov-seal-content { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.gov-seal-title { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 800; color: #065f46; letter-spacing: 0.3px; line-height: 1.2; }
.gov-seal-check { font-weight: 900; color: #059669; }
.gov-seal-code { font-size: 0.86rem; color: #0f172a; letter-spacing: 0.2px; }
.gov-seal-code strong { font-family: monospace, monospace; color: #047857; font-weight: 800; }
.gov-seal-sub { font-size: 0.65rem; font-weight: 600; color: #059669; margin-top: 1px; }

.btn-proceed-payment {
  width: 100%; height: 50px; background: #E11F25; color: #ffffff; border: none; border-radius: 12px;
  font-size: 0.98rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(225, 31, 37, 0.3); transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease; margin-top: 8px; user-select: none; -webkit-user-select: none;
}
.btn-proceed-payment:active { background: #c4181e; transform: scale(0.98); box-shadow: 0 2px 6px rgba(225, 31, 37, 0.2); }

/* Step 4 — PIX */
.pix-section-header { text-align: center; margin-bottom: 12px; }
.pix-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.pix-title-img { width: 24px; height: 24px; object-fit: contain; display: inline-block; }
.pix-title-row h2 { font-size: 1.2rem; font-weight: 800; color: #0f172a; margin: 0; }
.pix-intro-desc { font-size: 0.82rem; color: #64748b; margin: 0; }

.pix-value-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.pix-value-label { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.pix-value-number { font-size: 1.15rem; font-weight: 800; color: #E11F25; }

.pix-fast-steps { display: flex; align-items: center; justify-content: space-between; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 10px; margin: 12px 0 14px; gap: 4px; }
.pix-step-item { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.pix-step-icon { color: #E11F25; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.pix-step-title { font-size: 0.74rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.pix-step-sub { font-size: 0.62rem; color: #64748b; margin-top: 2px; line-height: 1.15; }
.pix-step-arrow { color: #cbd5e1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: -8px; }

.pix-qrcode-wrapper { display: flex; justify-content: center; align-items: center; margin: 8px 0; }
.pix-qrcode-box { background: #ffffff; padding: 12px; border-radius: 16px; border: 1.5px solid #cbd5e1; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: inline-flex; cursor: pointer; user-select: none; -webkit-user-select: none; transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, border-color 0.15s ease; }
.pix-qrcode-box:active { transform: scale(0.97); border-color: var(--secondary); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); }
.pix-qrcode-box canvas { width: 190px !important; height: 190px !important; display: block; }
.pix-qrcode-img { width: 190px; height: 190px; display: block; object-fit: contain; }
.pix-qr-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 190px; height: 190px; }
.pix-qr-spinner { width: 42px; height: 42px; border: 4px solid #e2e8f0; border-top-color: #E11F25; border-radius: 50%; animation: pix-spin 0.9s linear infinite; }
@keyframes pix-spin { to { transform: rotate(360deg); } }
.pix-qr-loading span { font-size: 0.8rem; color: #475569; text-align: center; }

.pix-copiacola-section { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; }
.pix-copiacola-title { font-size: 0.85rem; color: #475569; margin-bottom: 8px; text-align: center; }
.pix-copiacola-input-wrap { margin-bottom: 10px; }
.pix-copiacola-input-wrap input { width: 100%; height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid #cbd5e1; background: #f1f5f9; font-family: monospace; font-size: 0.78rem; color: #334155; text-align: center; cursor: pointer; user-select: all; -webkit-user-select: all; transition: all 0.15s ease; }
.pix-copiacola-input-wrap input:hover, .pix-copiacola-input-wrap input:active { background: #ffffff; border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(34, 49, 94, 0.1); }

.btn-pix-copy-action {
  width: 100%; height: 48px; background: #E11F25; color: #ffffff; border: none; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 4px 14px rgba(225, 31, 37, 0.35); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn-pix-copy-action:active, .btn-pix-copy-action.btn-copied-active { background: #16a34a !important; transform: scale(0.96); box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35) !important; }

.pix-expiration-row { text-align: center; margin-top: 12px; font-size: 0.82rem; color: #64748b; }
.pix-timer-digits { color: #E11F25; font-weight: 800; font-family: monospace; font-size: 0.92rem; transition: color 0.3s ease; }
.pix-timer-digits.urgent-timer { color: #dc2626 !important; animation: timer-pulse 1.2s ease-in-out infinite alternate; }
@keyframes timer-pulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0.75; transform: scale(1.08); } }

.pix-urgency-banner { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 10px; padding: 10px 12px; margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: #9f1239; line-height: 1.35; animation: urgency-fade 0.3s ease-out; }
@keyframes urgency-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.pix-urgency-icon { font-size: 1.1rem; flex-shrink: 0; animation: urgency-shake 1.8s infinite ease-in-out; }
@keyframes urgency-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(8deg); } 75% { transform: rotate(0); } }

/* Card oficial Receita Federal / SISCOMEX */
.gov-official-card { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 14px; padding: 14px; }
.gov-official-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; margin-bottom: 10px; }
.gov-card-logo { height: 28px; width: auto; object-fit: contain; }
.gov-official-titles { flex: 1; }
.gov-title-main { font-size: 0.74rem; font-weight: 800; color: #0f172a; letter-spacing: 0.4px; }
.gov-title-sub { font-size: 0.62rem; font-weight: 600; color: #475569; }
.gov-siscomex-badge { background: #22315E; color: #ffffff; font-size: 0.65rem; font-weight: 800; padding: 3px 6px; border-radius: 4px; letter-spacing: 0.5px; }

.gov-darf-box { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.gov-darf-title { font-size: 0.74rem; font-weight: 700; color: #0f172a; }
.gov-darf-desc { font-size: 0.65rem; color: #64748b; }

.operation-price-row { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1.5px dashed #cbd5e1; }
.price-label { font-size: 0.92rem; font-weight: 800; color: #0f172a; }
.price-amount { font-size: 1.15rem; font-weight: 800; color: #16a34a; font-family: monospace, monospace; }

.gov-legal-notice-box { background: #fffbeb; border: 1px solid #fef3c7; border-radius: 8px; padding: 8px 10px; }
.gov-legal-header { display: flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 800; color: #b45309; margin-bottom: 4px; }
.gov-legal-text { font-size: 0.68rem; color: #78350f; line-height: 1.35; }

/* Selo de criptografia SPI / Bacen */
.pix-security-badge-card { background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%); border: 1px solid #d1fae5; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 4px rgba(16, 185, 129, 0.05); }
.pix-security-shield-icon { width: 38px; height: 38px; border-radius: 50%; background: #dcfce7; border: 1.5px solid #86efac; color: #059669; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12); }
.pix-security-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pix-security-title { font-size: 0.77rem; font-weight: 800; color: #065f46; letter-spacing: 0.2px; display: flex; align-items: center; gap: 5px; line-height: 1.25; }
.pix-security-desc { font-size: 0.71rem; color: #475569; line-height: 1.35; font-weight: 500; }

.reg-pix-error { display: none; align-items: center; gap: 6px; margin-top: 10px; padding: 9px 12px; background: var(--primary-light); border: 1px solid rgba(225, 31, 37, 0.25); border-radius: var(--radius-sm); font-size: 0.74rem; font-weight: 600; color: var(--primary); }

/* Modal de pagamento confirmado */
.paid-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 9999999; display: none; align-items: center; justify-content: center; padding: 20px; }
.paid-modal-wrap { background: var(--surface); border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35); animation: nativeSlideIn 0.4s ease-out; }

.paid-page-card { background: #ffffff; border-radius: 18px; padding: 24px 18px; width: 100%; text-align: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04); border: 1px solid #e2e8f0; }
.paid-icon-box { width: 60px; height: 60px; border-radius: 50%; background: #dcfce7; border: 3px solid #86efac; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: #16a34a; box-shadow: 0 4px 14px rgba(22, 163, 74, 0.2); }
.paid-status-pill { display: inline-flex; align-items: center; gap: 6px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px; }
.paid-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); animation: pulse-dot 1.4s infinite; }
.paid-title { font-size: 1.15rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; line-height: 1.25; }
.paid-desc { font-size: 0.78rem; color: #475569; line-height: 1.4; margin-bottom: 14px; }
.paid-desc strong { color: #0f172a; }

.paid-tracking-card { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; text-align: left; }
.paid-tracking-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.paid-tracking-label-wrap { display: flex; align-items: center; gap: 5px; font-size: 0.70rem; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; }
.paid-tracking-label-wrap svg { color: #0284c7; }
.paid-tracking-status-badge { font-size: 0.65rem; font-weight: 800; background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 6px; letter-spacing: 0.3px; }
.paid-tracking-code-row { display: flex; align-items: center; justify-content: center; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 14px; }
.paid-tracking-code { font-family: monospace, monospace; font-size: 1.05rem; font-weight: 800; color: #0f172a; letter-spacing: 0.8px; user-select: all; -webkit-user-select: all; }

.paid-recipient-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; text-align: left; }
.paid-recipient-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; padding-bottom: 5px; border-bottom: 1px solid #e2e8f0; }
.paid-recipient-header-title { display: flex; align-items: center; gap: 5px; font-size: 0.70rem; font-weight: 800; color: #334155; text-transform: uppercase; letter-spacing: 0.3px; }
.paid-recipient-header-title svg { color: #059669; }
.paid-recipient-badge { font-size: 0.60rem; font-weight: 800; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 1px 6px; border-radius: 6px; letter-spacing: 0.3px; }
.paid-recipient-list { display: flex; flex-direction: column; gap: 5px; }
.paid-recipient-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 0.73rem; }
.paid-r-label { color: #64748b; font-weight: 500; flex-shrink: 0; }
.paid-r-val { color: #0f172a; font-weight: 700; text-align: right; word-break: break-word; }

.paid-seal-card { background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%); border: 1px solid #bbf7d0; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; text-align: left; }
.paid-seal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.paid-seal-info { display: flex; flex-direction: column; gap: 1px; }
.paid-seal-title { font-size: 0.71rem; font-weight: 800; color: #15803d; letter-spacing: 0.2px; }
.paid-seal-sub { font-size: 0.65rem; color: #64748b; }
.paid-seal-sub strong { font-family: monospace, monospace; color: #0f172a; }
.paid-seal-badge { font-size: 0.62rem; font-weight: 900; background: #dcfce7; color: #166534; border: 1px solid #86efac; padding: 2px 6px; border-radius: 6px; letter-spacing: 0.3px; }

.paid-eta-card { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; text-align: left; font-size: 0.73rem; color: #1e40af; margin-bottom: 14px; }
.paid-eta-icon { color: #2563eb; flex-shrink: 0; display: flex; }

/* Rodapé institucional */
.institutional-footer { background: #ffffff; border-top: 1px solid var(--border); padding: 10px 16px 12px; margin-top: auto; display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; text-align: center; }
.footer-top-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; }
.footer-brand-badge { display: flex; align-items: center; justify-self: start; gap: 6px; }
.footer-brand-logo { height: 16px; max-width: 95px; width: auto; object-fit: contain; display: block; }
.footer-partner-badge { display: flex; align-items: center; justify-content: center; justify-self: center; }
.footer-partner-logo { height: 16px; max-width: 90px; width: auto; object-fit: contain; display: block; }
.footer-social-row { display: flex; align-items: center; justify-self: end; gap: 8px; padding: 0; border: none; }
.social-icon-static { color: #22315E; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: #f1f5f9; cursor: default; user-select: none; transition: background 0.15s; }
.social-icon-static svg { width: 13px; height: 13px; }
.footer-links-inline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; padding: 2px 0; border-top: 1px solid #f8fafc; border-bottom: 1px solid #f8fafc; }
.footer-compact-link { font-size: 0.63rem; font-weight: 600; color: #475569; cursor: default; user-select: none; white-space: nowrap; }
.footer-link-dot { font-size: 0.55rem; color: #cbd5e1; user-select: none; }
.footer-bottom-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 6px; }
.footer-copyright-text { font-size: 0.58rem; font-weight: 500; color: #94a3b8; text-align: left; user-select: none; white-space: nowrap; }
.footer-security-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.58rem; font-weight: 700; color: #059669; background: #ecfdf5; padding: 2px 7px; border-radius: 12px; border: 1px solid #a7f3d0; white-space: nowrap; user-select: none; }
.footer-security-pill svg { width: 10px; height: 10px; }

/* Overlay de loading */
.loading-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 999; display: none; align-items: center; justify-content: center; padding: 20px; }
.loading-card { background: #ffffff; border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 320px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2); }
.spinner-custom { width: 44px; height: 44px; border: 3.5px solid #e2e8f0; border-top-color: #E11F25; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 1rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.loading-subtitle { font-size: 0.8rem; color: #64748b; margin-bottom: 16px; }
.loading-progress-bar { height: 6px; width: 100%; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.loading-progress-fill { height: 100%; width: 0%; background: #E11F25; transition: width 0.4s ease; }

[hidden] { display: none !important; }

/* Responsividade fina */
@media (max-width: 360px) {
  .info-card { padding: 14px; }
  .data-grid { gap: 8px; padding: 10px; }
  .tracking-item-time { width: 56px; }
  .bottom-action-bar { padding: 10px 14px; }
}

/* Mapa Leaflet — classes usadas pelo JS */
.interactive-tracking-map-card { width: 100%; box-shadow: none; background: #fff; border: none; border-bottom: 1px solid #e5e5e5; border-radius: 0; flex-direction: column; margin: 0; display: flex; overflow: hidden; }
.interactive-tracking-map-card .map-viewport-container { background: #eef1f4; width: 100%; height: 280px; min-height: 280px; position: relative; }
.interactive-tracking-map-card .map-viewport-container .leaflet-map-canvas { z-index: 1; width: 100%; height: 100%; }
.interactive-tracking-map-card .map-viewport-container .map-recenter-btn { z-index: 500; color: #333; cursor: pointer; background: #fff; border: 1px solid #ddd; border-radius: 8px; justify-content: center; align-items: center; width: 36px; height: 36px; transition: all .2s; display: flex; position: absolute; bottom: 12px; right: 12px; box-shadow: 0 3px 10px #00000026; }
.interactive-tracking-map-card .map-viewport-container .map-recenter-btn:hover { background: #f5f5f5; transform: scale(1.05); }
.interactive-tracking-map-card .map-viewport-container .map-recenter-btn:active { transform: scale(.95); }

/* Marcadores customizados do mapa (fiel à referência) */
.map-custom-div-icon { background: 0 0 !important; border: none !important; }

.map-hub-marker {
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  display: flex;
  position: relative;
  transform: translate(-50%, -100%);
}
.map-hub-marker .hub-badge {
  color: #444;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 2px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px #0000002e;
}
.map-hub-marker .hub-dot {
  background: #555;
  border: 3px solid #fff;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  box-shadow: 0 2px 5px #00000040;
}

.map-dest-marker {
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  display: flex;
  position: relative;
  transform: translate(-50%, -100%);
}
.map-dest-marker .dest-badge {
  color: #111;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 2px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px #0003;
}
.map-dest-marker .dest-pin {
  background: var(--pin-color, #e11f25);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  width: 22px;
  height: 22px;
  position: relative;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px #0000004d;
}
.map-dest-marker .dest-pin i {
  background: #fff;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Caminhão retido no destino */
.truck-seized-wrapper {
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  width: 130px;
  display: flex;
  position: relative;
  transform: translate(-50%, -75%);
}
.truck-seized-wrapper .seized-status-card {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
  text-align: left;
  background: #fffffff7;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 2px;
  padding: 3px 6px;
  box-shadow: 0 2px 8px #0000002e;
}
.truck-seized-wrapper .seized-status-card .seized-tag { letter-spacing: .1px; align-items: center; gap: 4px; font-size: 8.5px; line-height: 1.1; display: flex; }
.truck-seized-wrapper .seized-status-card .seized-tag strong { font-size: 8.5px; }
.truck-seized-wrapper .seized-status-card .seized-loc { color: #555; white-space: nowrap; text-overflow: ellipsis; margin-top: 1px; font-size: 8px; font-weight: 600; line-height: 1.1; display: block; overflow: hidden; }
.truck-seized-wrapper .truck-img-container { justify-content: center; display: flex; position: relative; }
.truck-seized-wrapper .truck-img-container .truck-seized-image { filter: drop-shadow(0 4px 6px #0000004d); width: 52px !important; max-width: 52px !important; height: auto !important; }

.pulse-alert { background: #d32f2f; border-radius: 50%; width: 7px; height: 7px; animation: 1.2s infinite pulse-dot; display: inline-block; }

@keyframes pulse-dot { 0%, to { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }

/* Step 1 — Hero seção (fiel à referência) */
.hero-bg-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 24px 16px;
  overflow: hidden;
  background: #e2e8f0;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 2%;
  display: block;
  transform: scale(1.04);
  transform-origin: 55% 5%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.02) 0%,
    rgba(15, 23, 42, 0.08) 40%,
    rgba(15, 23, 42, 0.25) 100%
  );
}

.hero-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-radius: 24px;
  padding: 24px 22px 22px;
  margin: auto 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 1.5px rgba(255, 255, 255, 0.90);
  width: 100%;
  max-width: 395px;
  border: 1.5px solid rgba(255, 255, 255, 0.80);
  transform: translateZ(0);
  will-change: transform;
}

.hero-card-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

.hero-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.hero-card-divider {
  border: none;
  border-top: 1.5px solid rgba(226, 232, 240, 0.8);
  margin: 0 0 12px;
}

.hero-card-desc {
  font-size: 0.84rem;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 16px;
  text-align: center;
}

.hero-card .input-label {
  color: #0f172a;
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.hero-card .app-input {
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(203, 213, 225, 0.85);
  color: #0f172a;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  padding: 0 16px;
  letter-spacing: 0.6px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.03);
  border-radius: 12px;
}

.hero-card .app-input::placeholder {
  color: rgba(15, 23, 42, 0.45);
  font-weight: 600;
  letter-spacing: 0.6px;
}

.hero-card .app-input:focus {
  background: #ffffff;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(225, 31, 37, 0.16), inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (max-width: 360px) {
  .hero-card { padding: 18px 16px 16px; }
}
