/* Parcelo customer frontend.
   One bold element: the delivery journey timeline. Everything else stays quiet.
   Palette is a cool "in-transit" pine/paper, deliberately unlike real carriers.
   System fonts only; no build step, no CDN. Readable in a couple of minutes. */

:root {
  --ink: #15232e;          /* deep slate-teal, not pure black */
  --muted: #5d6f73;
  --paper: #eef3f1;        /* cool green-grey, not cream */
  --surface: #ffffff;
  --line: #d4ded9;
  --pine: #126e63;         /* brand */
  --pine-deep: #0c4f47;
  --sun: #d98b2b;          /* in transit */
  --coral: #e05640;        /* attention / something's off */
  --ok: #1f8a53;           /* delivered */
  --radius: 10px;
  --shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(12,79,71,.45);
  --wrap: 60rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
a { color: var(--pine-deep); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: 2.3rem; }
p { max-width: 58ch; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

/* ---- header ---- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { display: block; }
.brand b { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; gap: 1.2rem; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--ink); }

/* ---- buttons / inputs ---- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--pine); color: #fff; padding: .7rem 1.2rem; border-radius: var(--radius);
}
.btn:hover { background: var(--pine-deep); }
input[type=text], input[type=password], input[type=number] {
  font: inherit; padding: .7rem .8rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%;
}
input:focus-visible, .btn:focus-visible { outline: 3px solid #9ad1c9; outline-offset: 1px; }

/* ---- hero + tracking slip ---- */
.hero { padding: 3rem 0 1.5rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); }

/* the tracking box is styled like a shipping slip with a torn (perforated) edge */
.slip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem; margin-top: 1.2rem;
}
.slip form { display: flex; gap: .6rem; flex-wrap: wrap; }
.slip .grow { flex: 1 1 16rem; }
.tear {
  height: 0; border-top: 2px dashed var(--line); margin: 1.1rem -1.1rem 0;
}
.hint { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }

/* ---- result card ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem; margin: 1.2rem 0;
}
.card .row { display: flex; flex-wrap: wrap; gap: 1.4rem 2.2rem; color: var(--muted); }
.card .row b { display: block; color: var(--ink); font-weight: 700; }
.card h2 { font-size: 1.1rem; margin: 0 0 .9rem; }

/* "Your parcels" list on the account page */
ul.mine { list-style: none; margin: 0; padding: 0; }
ul.mine li {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .6rem 0; border-top: 1px solid var(--line);
}
ul.mine li:first-child { border-top: 0; }
ul.mine .pid { font-weight: 700; text-decoration: none; }
ul.mine .pid:hover { text-decoration: underline; }
ul.mine .to { color: var(--muted); margin-left: auto; }

/* ---- account self-service dashboard ---- */
.btn.small { padding: .35rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn.secondary { background: var(--surface); color: var(--pine-deep); border: 1px solid var(--line); }
.btn.secondary:hover { background: #eef3f1; }
.hidden { display: none; }

form.stack { margin-top: 1rem; }
form.stack label { display: block; margin: 0 0 .7rem; font-weight: 600; }
form.stack label span { display: block; margin-bottom: .25rem; color: var(--muted); }
form.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
form.inline input { width: auto; flex: 1; min-width: 12rem; }

ul.parcels { list-style: none; margin: 0; padding: 0; }
ul.parcels li { padding: .75rem 0; border-top: 1px solid var(--line); }
ul.parcels li:first-child { border-top: 0; }
.mine-top { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.mine-top .to { color: var(--muted); margin-left: auto; }
.mine-actions { display: flex; align-items: center; gap: .5rem; margin-top: .55rem; flex-wrap: wrap; }
.mine-actions .reroute { display: flex; gap: .4rem; }
.mine-actions input { width: auto; }
.pid { font-weight: 700; text-decoration: none; color: var(--pine-deep); }
.pid:hover { text-decoration: underline; }
.row-msg { color: var(--coral); font-size: .85rem; }

#search-results { margin-top: .9rem; }
.flash-msg { padding: .6rem .85rem; border-radius: var(--radius); margin: 0 0 1rem; font-weight: 600; }
.flash-msg:empty { display: none; }
.flash-msg.ok { background: #e7f3ec; color: #1f6b45; border: 1px solid #bfe0cc; }
.flash-msg.err { background: #fff2ee; color: #7a2516; border: 1px solid #f1c9bd; }

.badge {
  display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .82rem;
  font-weight: 700; color: #fff; background: var(--muted);
}
.badge.created { background: var(--muted); }
.badge.shipped { background: var(--pine); }
.badge.in_transit { background: var(--sun); }
.badge.delivered { background: var(--ok); }

.warn {
  display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0 0;
  border-left: 4px solid var(--coral); background: #fff2ee; color: #7a2516;
  padding: .7rem .9rem; border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- the journey timeline (the one bold element) ---- */
.journey { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0; }
.leg { display: grid; grid-template-columns: 1.6rem 1fr; gap: .9rem; }
.leg .track { display: flex; flex-direction: column; align-items: center; }
.leg .dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--pine);
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--pine); margin-top: .25rem;
}
.leg.is-odd .dot { background: var(--coral); box-shadow: 0 0 0 2px var(--coral); }
.leg .line { flex: 1; width: 2px; background: var(--line); margin: 4px 0; }
.leg:last-child .line { display: none; }
.leg .body { padding-bottom: 1.1rem; }
.leg .when { color: var(--muted); font-size: .9rem; }
.leg .stage { font-weight: 700; text-transform: capitalize; }

/* ---- centered auth card ---- */
.auth { max-width: 26rem; margin: 3rem auto; }
.auth .card label { display: block; margin: 0 0 .9rem; font-weight: 600; }
.auth .card label span { display: block; margin-bottom: .3rem; color: var(--muted); }
.msg { color: var(--coral); font-weight: 600; margin: .4rem 0 0; min-height: 1.2em; }

footer { color: var(--muted); font-size: .9rem; padding: 2.5rem 0; }
footer .tear { border-color: var(--line); margin: 0 0 1rem; }

@media (max-width: 34rem) {
  h1 { font-size: 1.9rem; }
  .top .wrap { height: 58px; }
}
