/* Tender-document delivery: the request dialog and the tracking page. */

/* --- request dialog --------------------------------------------------------- */

.dlv-root { position: fixed; inset: 0; z-index: 150; }

.dlv-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 60, 0.38);
  backdrop-filter: blur(2px);
}

.dlv-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dlv-in var(--dur-med) var(--ease-out);
}
@keyframes dlv-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) { .dlv-panel { animation: none; } }

.dlv-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--stage-border);
  flex: none;
}

.dlv-head-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ebid-accent), var(--ebid-primary-darkest));
}
.dlv-head-icon svg { width: 18px; height: 18px; }

.dlv-title { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.dlv-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

.dlv-x {
  margin-left: auto;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--stage-border);
  background: var(--stage-3);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dlv-body { padding: 15px 17px 18px; overflow-y: auto; }

/* The office fee, stated up front. The courier pays it on the customer's
   behalf, so asking someone to commit without seeing it would be unfair. */
.dlv-price {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border-radius: var(--r-sm);
  background: var(--ebid-bg-tint);
  border: 1px solid var(--ebid-primary-tint);
}
.dlv-price-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ebid-primary);
  opacity: 0.8;
}
.dlv-price-value { font-size: 17px; font-weight: 800; color: var(--ebid-primary-darkest); }
.dlv-price-note { font-size: 10.5px; color: var(--text-tertiary); }

.dlv-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.dlv-field > span { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.dlv-opt { font-weight: 500; color: var(--text-tertiary); }

.dlv-field input {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stage-border);
  background: var(--surface-solid);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}
.dlv-field input:focus {
  border-color: var(--ebid-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.dlv-addr-row { display: flex; gap: 7px; }
.dlv-addr-row input { flex: 1; }
.dlv-locate { flex: none; padding: 0 13px; }
.dlv-locate svg { width: 17px; height: 17px; }

.dlv-hint { font-size: 10.5px; color: var(--text-tertiary); }

/* --- address matches --------------------------------------------------------- */

.dlv-matches { display: flex; flex-direction: column; gap: 5px; margin: -6px 0 13px; }

.dlv-match {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stage-border);
  background: var(--stage-0);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.dlv-match svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--ebid-primary); }
.dlv-match:hover { border-color: var(--ebid-accent); }
.dlv-match.is-active {
  border-color: var(--ebid-accent);
  background: var(--ebid-bg-tint);
  color: var(--ebid-primary-darkest);
}
.dlv-match.is-plain { justify-content: center; color: var(--ebid-accent); font-weight: 700; }

.dlv-match-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-tertiary);
  padding: 4px 2px;
}

.dlv-error {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ebid-orange-strong);
  background: var(--ebid-orange-soft);
  border: 1px solid var(--ebid-orange-border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  margin-bottom: 11px;
}

.dlv-submit { margin-top: 4px; }

.dlv-legal {
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 9px 0 0;
  line-height: 1.5;
}

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

/* --- confirmation ------------------------------------------------------------ */

.dlv-done { text-align: center; padding: 12px 4px 4px; }

.dlv-done-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: rgba(5, 150, 105, 0.12);
}
.dlv-done-icon svg { width: 23px; height: 23px; }

.dlv-done-title { font-size: 15px; font-weight: 800; margin-bottom: 5px; }

/* The reference is what a customer reads out on the phone, so it gets the
   prominence of the thing they actually need. */
.dlv-done-ref {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ebid-primary);
  margin-bottom: 10px;
}

.dlv-done-note { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 16px; }

/* --- page --------------------------------------------------------------------- */

.dlv-intro { padding: 20px 22px; margin-bottom: 20px; }
.dlv-intro-title { font-size: 18px; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 8px; }
.dlv-intro-text { font-size: 13px; line-height: 1.65; color: var(--text-secondary); margin: 0 0 10px; }
.dlv-intro-note { font-size: 12px; line-height: 1.6; color: var(--text-tertiary); margin: 0; }

.dlv-section { font-size: 14px; font-weight: 800; margin: 0 0 12px; padding: 0 2px; }

.dlv-card { padding: 16px 18px; margin-bottom: 12px; }

.dlv-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dlv-card-ref { font-size: 12px; font-weight: 800; letter-spacing: 0.05em; color: var(--ebid-primary); }
.dlv-card-title { font-size: 13.5px; font-weight: 650; line-height: 1.45; margin-top: 2px; }

.dlv-card-price {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--ebid-bg-tint);
  color: var(--ebid-primary-darkest);
  border: 1px solid var(--ebid-primary-tint);
}

/* Progress rail: where the errand has got to, and what is still to come. A
   bare status label says the first but not the second. */
.dlv-rail { display: flex; gap: 4px; margin-bottom: 14px; }
.dlv-stage { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.dlv-dot { height: 4px; border-radius: var(--r-pill); background: var(--stage-border); display: block; }
.dlv-stage.is-done .dlv-dot { background: var(--ebid-primary); }
.dlv-stage.is-current .dlv-dot { background: var(--ebid-accent); }
.dlv-stage-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.dlv-stage.is-current .dlv-stage-label { color: var(--ebid-accent); font-weight: 800; }

.dlv-cancelled {
  font-size: 12px;
  font-weight: 700;
  color: var(--ebid-orange-strong);
  background: var(--ebid-orange-soft);
  border: 1px solid var(--ebid-orange-border);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  margin-bottom: 14px;
}

.dlv-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 14px;
}
.dlv-card-meta > div {
  font-size: 12.5px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dlv-card-meta span {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}
.dlv-card-addr { grid-column: 1 / -1; }

.dlv-card-op {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--stage-0);
  border: 1px solid var(--stage-border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.dlv-card-link { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--ebid-accent); }
.dlv-card-link:hover { text-decoration: underline; }

.dlv-empty { padding: 26px 22px; text-align: center; font-size: 13px; line-height: 1.65; color: var(--text-tertiary); }

.dlv-skel {
  height: 120px;
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--stage-0) 25%, var(--stage-border) 37%, var(--stage-0) 63%);
  background-size: 400% 100%;
  animation: dlv-shimmer 1.4s ease infinite;
}
@keyframes dlv-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) { .dlv-skel { animation: none; } }

/* Shown in place of the button when a tender cannot be delivered. Explaining
   the absence is the point: most tenders are outside Addis, and silence read
   as a broken feature. */
.dlv-unavailable {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--stage-0);
  border: 1px solid var(--stage-border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.dlv-unavailable svg { width: 15px; height: 15px; flex: none; margin-top: 1px; opacity: 0.7; }

/* The card chip. Sits beside Ask AI and matches its shape, but takes the warm
   accent so the two actions stay distinguishable at a glance. */
.bc-deliver {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ebid-orange-border);
  background: var(--ebid-orange-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ebid-orange-strong);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.bc-deliver:hover { border-color: var(--ebid-accent); background: var(--surface-solid); }
