/* Kef client portal.
   Most customers open this on a phone, often mid-move with one hand free, so
   the phone layout is the design and the desktop one is the widened version
   of it. Nothing loads from another host — see the CSP the server sends.

   Colours and type are taken from kefintl.com, not invented: the navy and
   teal below are the site’s own values, and Fira Sans is its typeface,
   self-hosted here so a page about somebody’s passport makes no request to
   a font CDN. */

/* Latin only, two weights. Hebrew in the checklist falls back to the system
   font on purpose — Fira Sans has no Hebrew, and a missing-glyph box is worse
   than a different face. */
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fira-400.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fira-600.woff2") format("woff2");
}

:root {
  /* From kefintl.com */
  --navy: #1e4388;
  --navy-dark: #163266;
  --teal: #38a692;
  --teal-dark: #2b8574;
  --teal-wash: #eaf5f2;

  --ink: #12243f;
  --muted: #5c6b7f;
  --line: #dde4ec;
  --bg: #f5f7fa;
  --card: #ffffff;

  --brand: var(--navy);
  --ok: var(--teal-dark);
  --warn: #9a5b00;
  --alert: #a52222;
  --ok-bg: var(--teal-wash);
  --warn-bg: #fdf3e2;
  --alert-bg: #fbeaea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 36, 63, .06), 0 4px 16px rgba(18, 36, 63, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  /* The teal underline is the one flourish. It is the brand pairing, and it
     stops the navy bar reading as a generic app chrome. */
  border-bottom: 3px solid var(--teal);
}
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
/* The wordmark is dark-on-transparent, so it needs a light plate to sit on
   rather than being inverted with a filter, which greys the teal in the mark. */
.brand { background: #fff; padding: 5px 10px; border-radius: 6px; }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.centred { max-width: 420px; margin: 48px auto; }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.foot { text-align: center; }

.head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }

.counter {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}
.counter.clear { background: var(--ok-bg); color: var(--ok); }
.counter b { display: block; font-size: 22px; line-height: 1.1; }

/* --- tracker ------------------------------------------------------------ */

.steps { list-style: none; margin: 18px 0 0; padding: 0; }
.steps li {
  position: relative;
  padding: 0 0 18px 30px;
  border-left: 2px solid var(--line);
}
.steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.steps li::before {
  content: "";
  position: absolute;
  left: -8px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line);
}
.steps li.done { border-left-color: var(--teal); }
.steps li.done::before { background: var(--teal); border-color: var(--teal); }
.steps li.current::before {
  background: var(--navy);
  border-color: var(--navy);
  /* The one place the eye should land first. */
  box-shadow: 0 0 0 4px rgba(30, 67, 136, .15);
}
.steps .label { font-weight: 600; }
.steps li.upcoming .label { color: var(--muted); font-weight: 500; }
.steps .when { font-size: 13px; color: var(--muted); }
.steps li.current .blurb { font-size: 14px; color: var(--muted); }

.banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--warn-bg);
  color: var(--warn);
}
.banner.alert { background: var(--alert-bg); color: var(--alert); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0 0 6px; }

/* --- checklist ---------------------------------------------------------- */

.items { list-style: none; margin: 0; padding: 0; }
.items li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.items li:first-child { border-top: 0; }

.tick {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
}
.tick.approved { background: var(--teal); border-color: var(--teal); }
.tick.uploaded { background: var(--warn); border-color: var(--warn); }
.tick.available { background: var(--navy); border-color: var(--navy); }

.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; }
.item-title .optional { font-weight: 400; color: var(--muted); font-size: 13px; }
.item-hint { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.item-note { font-size: 13px; margin: 6px 0 0; }
.item-note.ok { color: var(--ok); }
.item-note.warn { color: var(--warn); }
.item-note.alert { color: var(--alert); font-weight: 600; }

.files { font-size: 13px; color: var(--muted); margin: 6px 0 0; padding: 0; list-style: none; }
.files li { border: 0; padding: 2px 0; display: block; }

/* --- controls ----------------------------------------------------------- */

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

input[type="email"] {
  width: 100%;
  padding: 12px;
  font-size: 16px; /* under 16px, iOS zooms the whole page on focus */
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

button { font: inherit; cursor: pointer; }

.primary {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background .12s;
}
.primary:hover:not([disabled]) { background: var(--navy-dark); }
.primary:active:not([disabled]) { transform: translateY(1px); }
.primary[disabled] { opacity: .6; cursor: default; }

.upload {
  margin-top: 10px;
  padding: 9px 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-wash);
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 600;
  transition: background .12s;
}
.upload:hover:not([disabled]) { background: #dcede8; }
.upload[disabled] { opacity: .6; cursor: default; }

.link {
  background: none;
  border: 0;
  color: #fff;
  text-decoration: underline;
  font-size: 14px;
}

.notice {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 14px;
}
.notice.bad { background: var(--alert-bg); color: var(--alert); }

.picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.picker button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
}
.picker button[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

a { color: var(--navy); }
a:hover { color: var(--navy-dark); }

input[type="email"]:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* --- legal pages -------------------------------------------------------- */

.doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
}
.doc h1 { font-size: 26px; margin: 0 0 10px; }
.doc h2 {
  font-size: 18px;
  margin: 32px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc h3 { font-size: 15px; margin: 20px 0 4px; }
.doc p, .doc li { font-size: 15px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc .lede { font-size: 17px; color: var(--ink); }
.doc code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0;
}
.doc th, .doc td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.doc .foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }

/* The pre-launch reminder. Loud on purpose — it must not survive to a real
   customer, so it should be impossible to skim past. */
.review {
  background: var(--warn-bg);
  color: var(--warn);
  border-left: 4px solid var(--warn);
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin: 0 0 24px;
}

.barlink { color: #fff; font-size: 14px; }

.legal {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* Sign in with Google. Deliberately secondary to the email field: it works for
   78% of customers and the other 22% must not feel they are on the wrong page. */
.google {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.google:hover { background: var(--bg); }

.or {
  position: relative;
  text-align: center;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
}
.or::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--line);
}
.or span { position: relative; background: var(--card); padding: 0 10px; }

/* --- ops desk ----------------------------------------------------------- */

body.staff main { max-width: 940px; }

.barright { display: flex; align-items: center; gap: 14px; }
.barwho { font-size: 13px; opacity: .85; }

.deskhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.ghost {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.ghost:hover { background: var(--bg); }

.primary.block { display: block; text-align: center; text-decoration: none; }
.primary.compact { width: auto; padding: 10px 18px; flex: 0 0 auto; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.plain li:first-child { border-top: 0; }

.alertcard { border-left: 4px solid var(--alert); }
.alertcard h2 { color: var(--alert); }

/* The pipeline strip: how the book is distributed across the journey, and a
   filter. Counts are the point — the labels are there to read them by. */
.pipeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.pstep {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color .12s, background .12s;
}
.pstep .pn { display: block; font-size: 20px; font-weight: 600; color: var(--navy); }
.pstep .pl { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.pstep:hover { border-color: var(--teal); }
.pstep.on { background: var(--navy); border-color: var(--navy); }
.pstep.on .pn, .pstep.on .pl { color: #fff; }
.pstep.zero .pn { color: var(--line); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
#search {
  flex: 1 1 220px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.chip:hover { border-color: var(--teal); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chipn { opacity: .65; font-weight: 400; }

/* One shipment per row, whole row clickable. A table would be tidier on a
   desktop and unusable on the phone this is read on half the time. The left
   edge carries the urgency, so a column of rows scans in one pass. */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  margin-bottom: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .12s, transform .06s;
}
.row:hover { border-color: var(--teal); }
.row:active { transform: translateY(1px); }
.row.alert { border-left-color: var(--alert); }
.row.warn { border-left-color: var(--warn); }
.row.ok { border-left-color: var(--teal); }

.rowmain { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rowtop { display: flex; align-items: baseline; gap: 8px; }
.rowname { font-weight: 600; font-size: 15px; }
.rowsub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rowhead { font-size: 13px; color: var(--muted); }
.rowhead.alert { color: var(--alert); font-weight: 600; }
.rowhead.warn { color: var(--warn); }
.rowhead.ok { color: var(--teal-dark); }

.rowmeta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
  font-size: 13px;
}
.chased { color: var(--muted); font-size: 12px; }
.chased .never { color: var(--warn); }
.chased .recent { color: var(--teal-dark); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.alert { background: var(--alert-bg); color: var(--alert); }
.pill.ok { background: var(--teal-wash); color: var(--teal-dark); }
.pill.step { background: var(--navy); color: #fff; }

.small { font-size: 12px; }

@media (max-width: 560px) {
  .row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .rowmissing { white-space: normal; }
}

@media (max-width: 720px) {
  .pipeline { grid-template-columns: repeat(4, 1fr); }
}

/* --- customs declaration card / messages --------------------------------- */

.declstatus {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
}
.declstatus.warn { background: var(--warn-bg); color: var(--warn); }
.declstatus.ok { background: var(--teal-wash); color: var(--teal-dark); }

.blockers li { color: var(--warn); font-weight: 600; border: 0; padding: 2px 0; }

.actions { margin: 12px 0 6px; display: flex; gap: 10px; flex-wrap: wrap; }

textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Customer-side: what Kef has told them. */
.msgs li { border-top: 1px solid var(--line); padding: 10px 0; display: block; }
.msgs li:first-child { border-top: 0; }
.msgs .when { font-size: 12px; color: var(--muted); }
.msgs .text { margin: 2px 0 0; font-size: 15px; }
