@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  --track-charcoal: #1a1a2e;
  --track-slate: #4a4a5a;
  --track-emerald: #0d7c66;
  --track-emerald-light: #e8f5f1;
  --track-border: #e2e2e8;
  --track-bg: #fafafc;
}

.tracking-hero {
  background: linear-gradient(135deg, var(--track-charcoal) 0%, #16213e 100%);
  padding: 60px 0 50px;
  text-align: center;
}

.tracking-hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.tracking-hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
}

.tracking-section {
  padding: 50px 0 80px;
  background: var(--track-bg);
  min-height: 50vh;
}

.tracking-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ───── Form ───── */
.tracking-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(26, 26, 46, 0.06);
  padding: 40px;
}

.tracking-card h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  color: var(--track-charcoal);
  margin-bottom: 6px;
}

.tracking-card .subtitle {
  color: var(--track-slate);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.tracking-form .form-group {
  margin-bottom: 20px;
}

.tracking-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--track-charcoal);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tracking-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-size: 1rem;
  font-family: "Rubik", sans-serif;
  color: var(--track-charcoal);
  background: #fff;
  border: 1.5px solid var(--track-border);
  border-radius: 8px;
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
}

.tracking-input:focus {
  border-color: var(--track-emerald);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.12);
}

.tracking-input::placeholder {
  color: #b0b0bc;
}

.tracking-submit {
  width: 100%;
  height: 54px;
  font-family: "Rubik", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--track-emerald);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s;
  margin-top: 8px;
}

.tracking-submit:hover {
  background: #0a6a56;
}

.tracking-submit:active {
  transform: scale(0.98);
}

.tracking-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  color: #b91c1c;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.tracking-error ul {
  margin: 0;
  padding-left: 20px;
}

/* ───── Progress Bar ───── */
.progress-area {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--track-border);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.progress-label span:first-child {
  font-weight: 600;
  color: var(--track-charcoal);
  font-size: 0.95rem;
}

.progress-pct {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--track-emerald);
  font-family: "Playfair Display", serif;
}

.progress-track {
  position: relative;
  height: 6px;
  background: #e8e8ee;
  border-radius: 3px;
  overflow: visible;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--track-emerald), #14a085);
  border-radius: 3px;
  transition: width 0.6s ease;
  position: relative;
}

.progress-dots {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: -14px;
  padding: 0 2px;
}

.progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8e8ee;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e8e8ee;
  position: relative;
  z-index: 2;
  transition: background 0.4s, box-shadow 0.4s;
}

.progress-dot.active {
  background: var(--track-emerald);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.2);
}

.progress-dot-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--track-slate);
  white-space: nowrap;
  font-weight: 500;
  text-align: center;
}

/* ───── Timeline ───── */
.timeline-area {
  margin-top: 40px;
}

.timeline-area h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  color: var(--track-charcoal);
  margin-bottom: 20px;
}

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

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--track-border) 0,
    var(--track-border) 6px,
    transparent 6px,
    transparent 12px
  );
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
  opacity: 0;
  animation: tl-fade-in 0.5s ease forwards;
}

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

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes tl-fade-in {
  to { opacity: 1; }
}

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8e8ee;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #d0d0d8;
  z-index: 2;
}

.timeline-dot.completed {
  background: var(--track-emerald);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.2);
}

.timeline-dot.current {
  background: var(--track-emerald);
  box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.25);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(13, 124, 102, 0.08); }
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--track-charcoal);
  margin: 0 0 2px;
}

.timeline-content .tl-date {
  font-size: 0.8rem;
  color: var(--track-slate);
}

.timeline-content .tl-note {
  font-size: 0.85rem;
  color: var(--track-emerald);
  margin-top: 4px;
  font-weight: 500;
}

/* ───── Order details summary (below form on success) ───── */
.order-summary-card {
  background: var(--track-emerald-light);
  border: 1px solid rgba(13, 124, 102, 0.15);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-summary-card strong {
  color: var(--track-charcoal);
}

.order-summary-card .badge-em {
  display: inline-block;
  background: var(--track-emerald);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

/* ───── Auth-aware ───── */
.tracking-authenticated-info {
  background: var(--track-emerald-light);
  border: 1px solid rgba(13, 124, 102, 0.15);
  border-radius: 8px;
  padding: 16px;
}

.tracking-authenticated-info label {
  margin-bottom: 4px;
}

.tracking-auth-email {
  font-size: 0.95rem;
  color: var(--track-charcoal);
  margin: 0;
}

.tracking-auth-email strong {
  color: var(--track-emerald);
}

/* ───── Messages ───── */
.tracking-messages {
  margin-bottom: 20px;
}
