/* ═══════════════════════════════════════════════════════════════════════════
   RASTREAMENTO GUIAN EXPRESS — style.css
   Design System / CSS Variables / Components
   Mobile First — CSS moderno sem frameworks
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts & Reset ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

/* ─── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Identidade da transportadora — Guian Express (Tema Claro, Premium) */
  --primary-color: #005696;
  --primary-dark: #003B68;
  --primary-light: #0077CE;
  --primary-glow: rgba(0, 86, 150, 0.1);

  --secondary-color: #005696;
  --secondary-mid: #003B68;
  --secondary-light: #F0F4F8;

  --accent-color: #005696;
  --accent-dark: #003B68;
  --accent-glow: rgba(0, 86, 150, 0.1);
  --footer-bg: #F7FAFC;

  --background-color: #FFFFFF;
  --surface-color: #FFFFFF;
  --surface-elevated: #F7FAFC;
  --surface-card: #FFFFFF;

  --text-color: #1A202C;
  --text-muted: #4A5568;
  --text-subtle: #718096;

  --success-color: #2F855A;
  --success-bg: rgba(48, 180, 100, 0.1);
  --warning-color: #D69E2E;
  --warning-bg: rgba(214, 158, 46, 0.1);
  --error-color: #C53030;
  --error-bg: rgba(197, 48, 48, 0.1);
  --info-color: #2B6CB0;

  --border-color: #E2E8F0;
  --border-focus: #005696;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px rgba(0, 86, 150, 0.08);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 720px;
  --container-padding: 1.25rem;
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.main {
  flex: 1;
  padding: 0 0 4rem;
  position: relative;
  z-index: 1;
}

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 3.5rem 0 8rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 86, 150, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #F0F4F8 0%, var(--background-color) 100%);
}

/* Partículas decorativas */
.hero__particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  opacity: 0;
}

.hero__particles span:nth-child(1)  { width: 6px;  height: 6px;  background: var(--primary-color); top: 20%; left: 10%; animation-delay: 0s;    animation-duration: 7s;  opacity: 0.4; }
.hero__particles span:nth-child(2)  { width: 4px;  height: 4px;  background: var(--primary-light);  top: 35%; left: 25%; animation-delay: 1s;    animation-duration: 5s;  opacity: 0.3; }
.hero__particles span:nth-child(3)  { width: 8px;  height: 8px;  background: var(--primary-dark);   top: 15%; left: 75%; animation-delay: 2s;    animation-duration: 8s;  opacity: 0.35;}
.hero__particles span:nth-child(4)  { width: 3px;  height: 3px;  background: var(--primary-color); top: 60%; left: 85%; animation-delay: 0.5s;  animation-duration: 6s;  opacity: 0.3; }
.hero__particles span:nth-child(5)  { width: 5px;  height: 5px;  background: var(--primary-light);  top: 70%; left: 55%; animation-delay: 3s;    animation-duration: 7s;  opacity: 0.25;}
.hero__particles span:nth-child(6)  { width: 4px;  height: 4px;  background: var(--primary-color); top: 45%; left: 5%;  animation-delay: 1.5s;  animation-duration: 9s;  opacity: 0.35;}
.hero__particles span:nth-child(7)  { width: 6px;  height: 6px;  background: var(--primary-dark);   top: 80%; left: 15%; animation-delay: 4s;    animation-duration: 6s;  opacity: 0.3; }
.hero__particles span:nth-child(8)  { width: 5px;  height: 5px;  background: var(--primary-light);  top: 25%; left: 90%; animation-delay: 2.5s;  animation-duration: 8s;  opacity: 0.4; }
.hero__particles span:nth-child(9)  { width: 3px;  height: 3px;  background: var(--primary-color); top: 55%; left: 40%; animation-delay: 3.5s;  animation-duration: 5s;  opacity: 0.3; }
.hero__particles span:nth-child(10) { width: 7px;  height: 7px;  background: var(--primary-dark);   top: 10%; left: 50%; animation-delay: 0.8s;  animation-duration: 7.5s;opacity: 0.25;}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50%       { transform: translateY(-20px) scale(1.1); opacity: 0.6; }
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* ─── Logo ──────────────────────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 2.5rem;
  text-decoration: none;
}

.logo__img {
  height: 52px;
  width: auto;
  transition: filter var(--transition-base), transform var(--transition-base);
}

.logo:hover .logo__img {
  filter: drop-shadow(0 4px 12px var(--primary-glow));
  transform: scale(1.03);
}

/* ─── Hero typography ───────────────────────────────────────────────────────── */
.hero__title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.hero__highlight {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 36ch;
  margin: 0 auto;
}

/* ─── Search Card ───────────────────────────────────────────────────────────── */
.search-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  margin-top: -5rem;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  animation: slideUp 0.5s ease-out both;
}

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

.search-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.search-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.search-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
}

.search-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ─── Form ──────────────────────────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.01em;
}

.form__required {
  color: var(--primary-color);
  margin-left: 0.125rem;
}

.form__input-wrapper {
  position: relative;
}

.form__input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.form__input {
  width: 100%;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem 0.875rem 2.875rem;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-color);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
  outline: none;
  letter-spacing: 0.02em;
}

.form__input::placeholder {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.form__input:hover {
  border-color: var(--primary-light);
  background: #FFFFFF;
}

.form__input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #FFFFFF;
}

.form__input:focus + .form__input-icon,
.form__input-wrapper:focus-within .form__input-icon {
  color: var(--primary-color);
}

/* Estado de erro no input */
.form__group--error .form__input {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.form__error {
  font-size: 0.8125rem;
  color: var(--error-color);
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.form__error:not(:empty)::before {
  content: '⚠';
  font-size: 0.75rem;
}

/* Erro geral */
.form__general-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--error-bg);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  color: var(--error-color);
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.form__general-error-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* ─── Botões ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.btn:active::after { opacity: 1; }

.btn--primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #FFFFFF;
  padding: 1rem 1.75rem;
  box-shadow: 0 4px 20px var(--primary-glow), 0 2px 8px rgba(0,0,0,0.15);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow), 0 4px 12px rgba(0,0,0,0.2);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: transparent;
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
}

.btn--secondary:hover {
  background: var(--primary-glow);
  transform: translateY(-1px);
}

.btn--full { width: 100%; }

/* Loading state no botão */
.btn--loading .btn__text { opacity: 0; }
.btn--loading .btn__icon { opacity: 0; }
.btn--loading::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Loading State ─────────────────────────────────────────────────────────── */
.loading-state {
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.loading-state__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.5rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 16px var(--primary-glow);
}

.loading-state__text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* ─── Result Card ───────────────────────────────────────────────────────────── */
.result-card {
  margin-top: 1.5rem;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
  box-shadow: var(--shadow-md);
}

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

.result-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(0, 86, 150, 0.05), transparent);
}

/* Status badge */
.result-card__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.result-card__status-badge.in-transit {
  background: var(--warning-bg);
  color: var(--warning-color);
  border-color: rgba(251, 191, 36, 0.2);
}

.result-card__status-badge.error {
  background: var(--error-bg);
  color: var(--error-color);
  border-color: rgba(248, 113, 113, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 2s ease-in-out infinite;
}

.result-card__status-badge:not(.in-transit) .status-dot {
  animation: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.result-card__new-search {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 0.375rem 0.875rem;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.result-card__new-search:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-glow);
}

/* ─── Info Grid ─────────────────────────────────────────────────────────────── */
.result-card__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.info-item {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.info-item:nth-child(even) { border-right: none; }
.info-item:nth-last-child(-n+2) { border-bottom: none; }

.info-item__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}

.info-item__value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
  word-break: break-word;
}

.info-item__value--muted {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.info-item__value--highlight {
  color: var(--primary-color);
}

/* ─── Proof Section ─────────────────────────────────────────────────────────── */
.proof-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.proof-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--success-color);
}

/* ─── Timeline ──────────────────────────────────────────────────────────────── */
.timeline-section {
  padding: 1.5rem;
}

.timeline-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4375rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-color), transparent);
  border-radius: 2px;
}

.timeline__item {
  position: relative;
  padding: 0 0 1.5rem 1.25rem;
  animation: fadeInLeft 0.4s ease-out both;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  background: var(--background-color);
  transition: all var(--transition-fast);
  z-index: 1;
}

.timeline__item:first-child::before {
  background: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
}

.timeline__item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--primary-glow);
}

.timeline__date {
  font-size: 0.8125rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}

.timeline__description {
  font-size: 0.9375rem;
  color: var(--text-color);
  font-weight: 500;
  line-height: 1.4;
}

.timeline__obs {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  background: var(--footer-bg);
  margin-top: auto;
}

.footer__text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer__privacy {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.375rem;
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
  :root { --container-padding: 1.5rem; }
  .search-card { padding: 2.5rem 2rem; }
  .result-card__info-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 640px) {
  :root { --container-padding: 2rem; }
  .hero { padding: 4rem 0 9rem; }
  .search-card { padding: 2.5rem; }
}

@media (max-width: 479px) {
  .result-card__info-grid { grid-template-columns: 1fr; }
  .info-item { border-right: none; }
  .info-item:last-child { border-bottom: none; }
  .info-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--border-color); }
  .info-item:last-child { border-bottom: none; }
  .result-card__header { flex-wrap: wrap; gap: 0.75rem; }
}

/* ─── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Scrollbar customizada ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--background-color); }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }
