/* Global Variables & Reset */
:root {
  --correios-blue: #00467f;
  --correios-blue-dark: #00335b;
  --correios-blue-button: #005696;
  --correios-yellow: #ffcc00;
  --correios-yellow-dark: #e6b800;
  --correios-card-bg: #eaeff4;
  --correios-text: #222222;
  --correios-text-muted: #555555;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #ffffff;
  color: var(--correios-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Minimalist Header with Yellow Line */
.header-minimal {
  background-color: #ffffff;
  border-bottom: 4px solid var(--correios-yellow);
  padding: 12px 20px;
}

.header-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.correios-logo-svg {
  height: 32px;
  width: auto;
}

/* Main Container */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 36px 16px;
}

/* Search Card Component */
.search-card {
  background-color: var(--correios-card-bg);
  border-radius: 8px;
  padding: 24px 20px;
  margin-bottom: 24px;
}

.search-prompt-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--correios-blue-button);
  margin-bottom: 18px;
}

/* Flex Row for Box Icon & Input */
.search-box-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.box-search-icon-left {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.box-search-icon-left svg {
  width: 100%;
  height: 100%;
}

.input-wrapper-rel {
  position: relative;
  flex: 1;
}

.input-wrapper-rel input {
  width: 100%;
  height: 48px;
  padding: 10px 40px 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid #767676;
  border-radius: 6px;
  background-color: #ffffff;
  font-family: inherit;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #222;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper-rel input::placeholder {
  color: #888888;
  font-weight: 400;
  font-size: 0.88rem;
  text-transform: none;
}

.input-wrapper-rel input:focus {
  outline: none;
  border-color: var(--correios-blue-button);
  box-shadow: 0 0 0 3px rgba(0, 86, 150, 0.18);
}

.input-search-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-search-icon-right svg {
  width: 100%;
  height: 100%;
}

.limit-hint {
  font-size: 0.8rem;
  color: var(--correios-text-muted);
  margin-top: 6px;
  margin-bottom: 18px;
}

.btn-consultar {
  width: 100%;
  height: 46px;
  background-color: var(--correios-blue-button);
  color: #ffffff;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-consultar:hover {
  background-color: var(--correios-blue-dark);
}

.btn-consultar:active {
  transform: scale(0.99);
}

/* Loading Spinner Container */
.loading-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  margin-bottom: 24px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #cbd5e1;
  border-top-color: var(--correios-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

.loading-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--correios-blue);
}

/* Result Section Container */
.result-section {
  display: none;
  margin-bottom: 24px;
  animation: slideUpFade 0.4s ease-out;
}

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

.tracking-result-card {
  background-color: var(--correios-card-bg);
  border-radius: 8px;
  padding: 24px 20px;
}

.result-header {
  text-align: center;
  margin-bottom: 24px;
}

.service-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--correios-blue);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.service-arrow {
  color: var(--correios-yellow-dark);
  font-weight: 900;
}

.estimate-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--correios-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estimate-value {
  font-size: 1.05rem;
  font-weight: 800;
  font-style: italic;
  color: #222222;
  margin-top: 2px;
}

/* Timeline Components */
.timeline {
  position: relative;
  margin: 0 0 24px 8px;
  padding-left: 10px;
}

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

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

/* Yellow Line Connector */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -4px;
  width: 3px;
  background-color: var(--correios-yellow);
}

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

.timeline-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--correios-blue);
  z-index: 2;
}

.timeline-icon svg {
  width: 18px;
  height: 18px;
}

.timeline-details {
  padding-top: 2px;
}

.timeline-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  line-height: 1.35;
}

.timeline-date {
  font-size: 0.82rem;
  color: #666666;
  font-weight: 500;
}

/* Action Button Inside Result Card */
.result-action-box {
  margin-top: 16px;
}

.btn-intermediacao {
  background-color: var(--correios-blue-button);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-intermediacao:hover {
  background-color: var(--correios-blue-dark);
}

/* Promo Banner Image */
.promo-banner {
  border-radius: 8px;
  overflow: hidden;
  margin-top: 24px;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Yellow Institutional Footer */
.footer-yellow {
  background-color: var(--correios-yellow);
  color: #000000;
  padding: 32px 20px 24px 20px;
  margin-top: auto;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-section {
  margin-bottom: 28px;
}

.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 14px;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

/* Black Icons Styling */
.icon-black {
  width: 18px;
  height: 18px;
  stroke: #000000;
  fill: none;
  flex-shrink: 0;
}

.footer-list a {
  color: #1a1a1a;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-list a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.copyright-bar {
  margin-top: 36px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333333;
}

/* Modal Popup Window */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background-color: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-window {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.modal-title-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #222222;
  width: 100%;
  text-align: center;
}

.modal-close-icon {
  position: absolute;
  right: 16px;
  top: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #666666;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-icon:hover {
  color: #000000;
}

.modal-body-content {
  padding: 10px 24px 24px 24px;
  font-size: 0.88rem;
  color: #333333;
  line-height: 1.55;
  overflow-y: auto;
  text-align: left;
}

.modal-body-content p {
  margin-bottom: 12px;
}

.modal-body-content strong {
  font-weight: 700;
  color: #111111;
}

/* Media Queries for Extra Small Devices */
@media (max-width: 480px) {
  .search-prompt-title {
    font-size: 1.25rem;
  }
  .box-search-icon-left {
    width: 38px;
    height: 38px;
  }
  .search-card, .tracking-result-card {
    padding: 20px 16px;
  }
  .footer-yellow {
    padding: 28px 16px 20px 16px;
  }
}
