/* Shared styles for frachty.html (client) and panel.html (forwarder). Tokens match index.html. */
:root {
  color-scheme: dark;
  --black: #0A0A0B;
  --panel: #141416;
  --panel-2: #1B1B1E;
  --field: #0F0F11;
  --line: #2A2A2F;
  --line-strong: #3A3A40;
  --cream: #F2EFEA;
  --body: #CFCBC4;
  --muted: #9A9AA0;
  --dim: #66666D;
  --red: #E30613;
  --red-deep: #B0000F;
  --red-text: #FF3B3B;
  --focus: #F2EFEA;
  --eu-blue: #003399;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 10px; --r: 20px; --pill: 999px;
  --wrap: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--cream); font-family: var(--font); font-size: 17px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg { display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 768px) { .wrap { padding: 0 var(--s6); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--cream); color: var(--black); padding: var(--s3) var(--s4); border-radius: var(--pill); font-weight: 600; }
.skip:focus { top: var(--s4); }

.caps { font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: .005em; }
.label { font-size: 13px; color: var(--muted); font-weight: 500; }

/* Wordmark */
.mark { display: inline-flex; flex-direction: column; align-items: flex-start; text-decoration: none; line-height: 1; }
.mark b { display: block; background: var(--red); color: #fff; font-style: italic; font-weight: 900; font-stretch: 112%; font-size: 18px; padding: 6px 20px 6px 10px; clip-path: polygon(0 0, 100% 0, 100% 62%, 88% 100%, 0 100%); }
.mark small { font-size: 10px; font-weight: 600; margin: 4px 0 0 4px; }

/* Top bar */
.pbar { border-bottom: 1px solid var(--line); }
.pbar .wrap { display: flex; align-items: center; gap: var(--s4); min-height: 72px; }
.pnav { display: none; gap: var(--s5); margin-left: var(--s6); font-size: 15px; }
.pnav a { text-decoration: none; color: var(--muted); padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.pnav a:hover { color: var(--cream); }
.pnav a[aria-current="page"] { color: var(--cream); border-bottom-color: var(--red); }
@media (min-width: 900px) { .pnav { display: flex; } }
.ptools { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.who { display: none; text-align: right; font-size: 13px; line-height: 1.3; }
.who b { display: block; font-weight: 600; }
.who span { color: var(--muted); }
@media (min-width: 1000px) { .who { display: block; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border-radius: var(--pill); border: 1.5px solid transparent; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease; }
.btn:active { transform: scale(.98); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); }
.btn-white { background: var(--cream); color: var(--black); }
.btn-white:hover { background: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--cream); background: transparent; }
.btn-ghost:hover { border-color: var(--cream); }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cream); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }

/* Language switcher */
.langs { display: none; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--pill); }
.langs button { min-width: 40px; min-height: 34px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.langs button:hover { color: var(--cream); }
.langs button[aria-pressed="true"] { background: var(--cream); color: var(--black); }
.lang-select { width: auto !important; min-height: 40px !important; padding: 0 36px 0 14px !important; border-radius: var(--pill) !important; font-size: 14px !important; font-weight: 600; }
@media (min-width: 1100px) { .langs { display: flex; } .lang-select { display: none; } }

/* Prototype banner */
.proto { background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.proto .wrap { display: flex; gap: var(--s2); align-items: center; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.proto b { color: var(--cream); font-weight: 600; }

/* Fields */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label { font-weight: 600; font-size: 15px; }
.help { font-size: 14px; color: var(--muted); margin: 0; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; background: var(--field); color: var(--cream);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 16px; line-height: 1.3;
}
select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F2EFEA' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
select option { background: var(--panel); color: var(--cream); }
input:hover, select:hover, textarea:hover { border-color: #55555C; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--cream); }
input::-webkit-calendar-picker-indicator { width: 20px; height: 20px; cursor: pointer; opacity: 1; filter: none; background: center / 20px no-repeat; }
input[type=date]::-webkit-calendar-picker-indicator { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
input[type=time]::-webkit-calendar-picker-indicator { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.field.invalid input { border-color: var(--red-text); box-shadow: inset 0 0 0 1px var(--red-text); }
.err { display: flex; gap: 8px; align-items: flex-start; color: var(--red-text); font-size: 15px; font-weight: 500; margin: 0; }
.err::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.err:empty { display: none; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); min-width: 0; }

/* Status pill */
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: var(--pill); font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--cream); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.new { color: var(--muted); }
.status.assigned { border-color: var(--cream); }
.status.transit { background: var(--red); border-color: var(--red); color: #fff; }
.status.delivered { background: var(--cream); border-color: var(--cream); color: var(--black); }

/* EU number plate */
.plate { display: inline-flex; align-items: stretch; height: 40px; border: 2px solid #111; border-radius: 6px; background: #fff; color: #111; overflow: hidden; font-weight: 700; font-size: 22px; letter-spacing: .06em; line-height: 1; white-space: nowrap; box-shadow: 0 0 0 1px var(--line-strong); }
.plate .eu { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 22px; background: var(--eu-blue); color: #fff; font-size: 10px; letter-spacing: 0; padding-bottom: 4px; }
.plate .eu::before { content: ""; width: 10px; height: 10px; margin-bottom: auto; margin-top: 4px; border-radius: 50%; border: 1.5px dotted #FFD500; }
.plate .no { display: flex; align-items: center; padding: 0 10px; font-variant-numeric: tabular-nums; }

/* Toast */
.toast { position: fixed; left: 50%; top: var(--s4); transform: translateX(-50%); z-index: 50; width: max-content; max-width: calc(100vw - 32px); background: var(--cream); color: var(--black); padding: var(--s3) var(--s5); border-radius: 14px; font-weight: 600; font-size: 15px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* Footer */
.pfoot { border-top: 1px solid var(--line); padding: var(--s5) 0; color: var(--muted); font-size: 14px; margin-top: var(--s8); }
.pfoot .wrap { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); justify-content: space-between; }
.pfoot a { color: var(--cream); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
