/* ── MaltaPost Tracker — Frontend Styles ── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --mpt-red:        #c8102e;
  --mpt-red-dark:   #a00d24;
  --mpt-red-light:  #fdf0f2;
  --mpt-ink:        #111827;
  --mpt-muted:      #6b7280;
  --mpt-border:     #e5e7eb;
  --mpt-bg:         #ffffff;
  --mpt-surface:    #f9fafb;
  --mpt-green:      #16a34a;
  --mpt-green-bg:   #f0fdf4;
  --mpt-radius:     12px;
  --mpt-shadow:     0 4px 24px rgba(0,0,0,.08);
}

.mpt-wrap {
  font-family: 'DM Sans', sans-serif;
  max-width: 680px;
  margin: 0 auto 3rem;
  color: var(--mpt-ink);
}

/* ── Hero ── */
.mpt-hero {
  background: var(--mpt-red);
  border-radius: var(--mpt-radius) var(--mpt-radius) 0 0;
  padding: 28px 32px 24px;
  color: #fff;
}

.mpt-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mpt-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
}

.mpt-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mpt-subtitle {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ── Form Row ── */
.mpt-form-row {
  display: flex;
  gap: 10px;
  padding: 20px 24px;
  background: var(--mpt-surface);
  border: 1px solid var(--mpt-border);
  border-top: none;
}

.mpt-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  border: 1.5px solid var(--mpt-border);
  border-radius: 8px;
  background: #fff;
  color: var(--mpt-ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: none;
}

.mpt-input:focus {
  border-color: var(--mpt-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}

.mpt-input::placeholder { color: #b0b7c3; }

.mpt-btn {
  height: 48px;
  padding: 0 28px;
  background: var(--mpt-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}

.mpt-btn:hover  { background: var(--mpt-red-dark); }
.mpt-btn:active { transform: scale(.97); }
.mpt-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Error ── */
.mpt-error {
  margin: 0;
  padding: 12px 24px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-top: none;
  color: #b91c1c;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0 0 var(--mpt-radius) var(--mpt-radius);
}

/* ── Result Card ── */
.mpt-result {
  background: var(--mpt-bg);
  border: 1px solid var(--mpt-border);
  border-top: none;
  border-radius: 0 0 var(--mpt-radius) var(--mpt-radius);
  overflow: hidden;
  box-shadow: var(--mpt-shadow);
}

.mpt-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--mpt-border);
  background: var(--mpt-surface);
}

.mpt-result-barcode {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mpt-ink);
}

.mpt-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.mpt-pill-active  { background: var(--mpt-green-bg); color: var(--mpt-green); }
.mpt-pill-pending { background: #fef9c3; color: #a16207; }
.mpt-pill-none    { background: #f3f4f6; color: var(--mpt-muted); }

.mpt-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--mpt-border);
}

.mpt-flag-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--mpt-red-light);
  color: var(--mpt-red);
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* ── Timeline ── */
.mpt-timeline-wrap {
  padding: 20px 24px;
}

.mpt-timeline-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mpt-muted);
  margin: 0 0 16px;
}

.mpt-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.mpt-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--mpt-border);
}

.mpt-tl-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}

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

.mpt-tl-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--mpt-red);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.mpt-tl-item:first-child .mpt-tl-dot,
.mpt-tl-dot-filled { background: var(--mpt-red); }

.mpt-tl-body { flex: 1; }

.mpt-tl-event {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--mpt-ink);
  margin-bottom: 2px;
}

.mpt-tl-meta {
  font-size: 0.8rem;
  color: var(--mpt-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Progress Bar ── */
.mpt-progress-wrap {
  padding: 28px 32px 24px;
  background: var(--mpt-bg);
  border-bottom: 1px solid var(--mpt-border);
}
.mpt-progress-track {
  position: relative;
  margin-bottom: 14px;
}
.mpt-progress-line {
  height: 3px;
  background: #e5e7eb;
  border-radius: 99px;
  position: relative;
  margin: 10px 10px;
}
.mpt-progress-fill {
  height: 100%;
  background: var(--mpt-ink);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.mpt-progress-dots {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
}
.mpt-progress-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.mpt-dot-done    { background: var(--mpt-ink);    border: 2.5px solid var(--mpt-ink); }
.mpt-dot-active  { background: var(--mpt-red);    border: 3px solid var(--mpt-red); box-shadow: 0 0 0 4px rgba(200,16,46,.15); }
.mpt-dot-pending { background: #fff;              border: 2px solid #d1d5db; }
.mpt-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.mpt-progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
}
.mpt-progress-label:first-child { text-align: left; }
.mpt-progress-label:last-child  { text-align: right; }
.mpt-label-done    { color: var(--mpt-ink); }
.mpt-label-active  { color: var(--mpt-red); }
.mpt-label-pending { color: #9ca3af; }
@media (max-width: 480px) {
  .mpt-progress-wrap { padding: 20px 14px 18px; }
  .mpt-progress-label { font-size: 0.6rem; }
}

/* ── Recipient row ── */
.mpt-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--mpt-border);
  background: var(--mpt-surface);
  font-size: 0.85rem;
}
.mpt-recipient-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: .06em;
  color: var(--mpt-muted);
  flex-shrink: 0;
}
.mpt-recipient-value {
  font-family: 'Space Mono', monospace;
  font-size: 0.88rem;
  color: var(--mpt-ink);
  font-weight: 700;
}

/* ── Event code badge ── */
.mpt-event-code {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--mpt-surface);
  color: var(--mpt-muted);
  border: 1px solid var(--mpt-border);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: .04em;
}

/* ── International badge ── */
.mpt-foreign-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── Meta items refinement ── */
.mpt-meta-dt   { color: var(--mpt-muted); }
.mpt-meta-loc  { color: var(--mpt-ink2); font-weight: 500; }
.mpt-meta-type {
  font-size: 0.72rem;
  background: var(--mpt-surface);
  border: 1px solid var(--mpt-border);
  color: var(--mpt-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Foreign movement row tint */
.mpt-tl-foreign .mpt-tl-dot {
  border-color: #3b82f6;
}
.mpt-tl-foreign.mpt-tl-item:first-child .mpt-tl-dot,
.mpt-tl-dot-filled {
  background: var(--mpt-red) !important;
}
.mpt-tl-foreign .mpt-tl-dot-filled {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* ── No movements ── */
.mpt-no-movements {
  padding: 32px 24px;
  text-align: center;
  color: var(--mpt-muted);
}

.mpt-no-movements svg {
  display: block;
  margin: 0 auto 12px;
  opacity: .3;
}

.mpt-no-movements p {
  margin: 0;
  font-size: 0.92rem;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .mpt-hero     { padding: 20px 18px 16px; }
  .mpt-form-row { padding: 14px 14px; flex-wrap: wrap; }
  .mpt-btn      { width: 100%; justify-content: center; }
}
