/* ==========================================================================
   3dsolut — Central de Rastreamento de Encomendas (CSS Oficial - Light Mode)
   Aesthetic: Clean Modern Light, Slate & Emerald Highlights, Premium Typography
   ========================================================================== */

:root {
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F1F5F9;
  --bg-input: #FFFFFF;
  --border-color: #E2E8F0;
  --border-subtle: #EDF2F7;
  --border-focus: #10B981;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --accent-emerald: #10B981;
  --accent-emerald-dark: #059669;
  --accent-emerald-light: #ECFDF5;
  --accent-emerald-border: #A7F3D0;
  --accent-blue: #2563EB;
  --accent-blue-light: #EFF6FF;
  --accent-blue-border: #BFDBFE;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-float: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

input, button, select, textarea {
  touch-action: manipulation;
}

@media (max-width: 768px) {
  input, select, textarea, .track-input {
    font-size: 16px !important;
  }
}

.track-container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------------------------------------------------------------- */
/* HEADER                                                                     */
/* -------------------------------------------------------------------------- */
.track-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}

.track-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.track-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.track-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.track-brand-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.track-header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.track-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* -------------------------------------------------------------------------- */
/* MAIN CONTENT & HERO SEARCH                                                 */
/* -------------------------------------------------------------------------- */
.track-main {
  flex: 1;
  padding: 44px 0 64px 0;
}

.track-search-section {
  text-align: center;
  margin-bottom: 36px;
}

.track-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-emerald-light);
  border: 1px solid var(--accent-emerald-border);
  color: var(--accent-emerald-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.track-pill-tag svg {
  width: 16px;
  height: 16px;
}

.track-hero-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.track-hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px auto;
  line-height: 1.5;
}

.track-search-form {
  max-width: 580px;
  margin: 0 auto;
}

.track-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.track-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.track-input-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.track-input-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  margin-right: 12px;
  flex-shrink: 0;
}

.track-input {
  width: 100%;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  text-transform: uppercase;
  touch-action: manipulation;
}

.track-input::placeholder {
  color: #94A3B8;
  text-transform: none;
  font-weight: 400;
}

.track-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-emerald);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.track-search-btn:hover {
  background: var(--accent-emerald-dark);
  transform: translateY(-1px);
}

.track-search-btn:active {
  transform: translateY(0);
}

.track-search-btn .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------- */
/* LOADING STATE                                                              */
/* -------------------------------------------------------------------------- */
.track-loading-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}

.track-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.track-loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* -------------------------------------------------------------------------- */
/* STATUS BANNER & HEADER                                                     */
/* -------------------------------------------------------------------------- */
.track-result-section {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.track-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.track-status-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
}

.track-status-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.track-status-badge {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald-dark);
  border: 1px solid var(--accent-emerald-border);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.track-shipping-type {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.track-status-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.track-status-eta {
  font-size: 14px;
  color: var(--text-secondary);
}

.track-status-eta strong {
  color: var(--text-primary);
}

.track-code-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: right;
  flex-shrink: 0;
}

.track-code-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.track-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-code-display strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-emerald-dark);
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.06em;
}

.track-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.track-copy-btn:hover {
  color: var(--text-primary);
  background: #E2E8F0;
}

.track-copy-btn svg {
  width: 16px;
  height: 16px;
}

/* -------------------------------------------------------------------------- */
/* PROGRESS BAR & MILESTONES                                                  */
/* -------------------------------------------------------------------------- */
.track-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.track-progress-bar-bg {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.track-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.track-milestones-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  text-align: center;
}

.track-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.track-milestone-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  transition: all 0.3s;
}

.track-milestone.completed .track-milestone-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #FFFFFF;
}

.track-milestone.active .track-milestone-circle {
  background: #FFFFFF;
  border-color: var(--accent-emerald);
  color: var(--accent-emerald-dark);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.track-milestone-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.track-milestone.completed .track-milestone-name,
.track-milestone.active .track-milestone-name {
  color: var(--text-primary);
  font-weight: 700;
}

/* -------------------------------------------------------------------------- */
/* DETAILS GRID                                                               */
/* -------------------------------------------------------------------------- */
.track-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.track-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.track-info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.track-info-card-header svg {
  width: 20px;
  height: 20px;
  color: var(--accent-emerald);
}

.track-info-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.track-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}

.track-info-k {
  color: var(--text-muted);
  flex-shrink: 0;
}

.track-info-v {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* -------------------------------------------------------------------------- */
/* TIMELINE DE EVENTOS                                                        */
/* -------------------------------------------------------------------------- */
.track-timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.track-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.track-timeline-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.track-timeline-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.track-timeline-events {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.track-timeline-item {
  display: flex;
  gap: 18px;
  position: relative;
  padding-bottom: 28px;
}

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

.track-item-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.track-item-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #CBD5E1;
  border: 2px solid #FFFFFF;
  z-index: 2;
  margin-top: 2px;
}

.track-timeline-item.latest .track-item-dot {
  background: var(--accent-emerald);
  border-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.track-item-line {
  position: absolute;
  top: 22px;
  bottom: -6px;
  width: 2px;
  background: #E2E8F0;
}

.track-timeline-item:last-child .track-item-line {
  display: none;
}

.track-item-content {
  flex: 1;
}

.track-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.track-item-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.track-timeline-item.latest .track-item-time {
  color: var(--accent-emerald-dark);
}

.track-item-location {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.track-item-status {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.track-item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* SUPPORT CARD                                                               */
/* -------------------------------------------------------------------------- */
.track-support-card {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.3);
}

.track-support-text h4 {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.track-support-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.track-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: #065F46 !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 10px;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.track-support-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.track-support-btn svg {
  width: 18px;
  height: 18px;
}

/* -------------------------------------------------------------------------- */
/* ERROR CARD                                                                 */
/* -------------------------------------------------------------------------- */
.track-error-card {
  background: var(--bg-card);
  border: 1px solid #FECACA;
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  max-width: 580px;
  margin: 24px auto 0 auto;
  box-shadow: var(--shadow-card);
}

.track-error-icon {
  margin-bottom: 16px;
}

.track-error-icon svg {
  width: 44px;
  height: 44px;
}

.track-error-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.track-error-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.track-error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.track-retry-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.track-retry-btn:hover {
  background: #E2E8F0;
}

.track-help-btn {
  background: var(--accent-emerald);
  color: #FFFFFF !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  transition: all 0.2s;
}

.track-help-btn:hover {
  background: var(--accent-emerald-dark);
}

/* -------------------------------------------------------------------------- */
/* FOOTER & TOAST                                                             */
/* -------------------------------------------------------------------------- */
.track-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: auto;
}

.track-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.track-footer-links {
  display: flex;
  gap: 16px;
}

.track-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.track-footer-links a:hover {
  color: var(--accent-emerald-dark);
}

.track-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
}

.track-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE DESIGN                                                          */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .track-main {
    padding: 28px 0 54px 0;
  }

  .track-header-inner {
    padding: 0 16px;
  }

  .track-header-badge {
    font-size: 11px;
    padding: 5px 10px;
    white-space: nowrap;
  }

  .track-hero-title {
    font-size: 24px;
    line-height: 1.25;
  }

  .track-hero-desc {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .track-input-wrap {
    flex-direction: column;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 10px;
  }

  .track-input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 16px;
    box-shadow: var(--shadow-card);
  }

  .track-input-wrap:focus-within .track-input-field {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  }

  .track-input {
    font-size: 15px;
  }

  .track-search-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    height: 48px;
  }

  .track-status-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-code-box {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .track-milestones-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .track-milestone-name {
    font-size: 10px;
  }

  .track-details-grid {
    grid-template-columns: 1fr;
  }

  .track-support-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-support-btn {
    width: 100%;
    justify-content: center;
  }

  .track-footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
