/* --brand and --brand-dark are set per Instance from config (see _Layout.cshtml). */
:root {
  --brand: #af1f2d;
  --brand-dark: #211e1f;
  --text: #211e1f;
  --muted: #55595c;
  --border: #d6d8da;
  --surface: #ffffff;
  --page: #f4f4f5;
  --warning-bg: #fff4e5;
  --warning-border: #b25e00;
  --focus: #1a5fb4;
  --radius: 6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 8px; top: -100px;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: var(--radius); z-index: 10;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.logo { display: block; height: 48px; width: auto; max-width: 60vw; }
.logo-link { display: inline-block; }
.lang-switch {
  font-weight: 600; text-decoration: none; color: var(--brand-dark);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px;
}
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }
.brand-bar { height: 4px; background: var(--brand); }

main { flex: 1; padding-top: 32px; padding-bottom: 48px; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; color: var(--brand-dark); }
h2 { font-size: 1.375rem; margin: 0 0 12px; color: var(--brand-dark); }
h2:focus { outline: none; }
.intro { margin: 0 0 24px; color: var(--muted); }

/* Search form */
.search, .shipment, .message {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.search { padding: 24px; }
.search-form { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr auto; gap: 16px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-captcha { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 0.9375rem; }
select, input[type="text"] {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid #8a8d90; border-radius: var(--radius); padding: 10px 12px; min-height: 46px; width: 100%;
}
select:focus-visible, input:focus-visible { border-color: var(--focus); }
button {
  font: inherit; font-weight: 700; color: #fff; background: var(--brand);
  border: 0; border-radius: var(--radius); padding: 0 28px; min-height: 46px; cursor: pointer;
}
button:hover { filter: brightness(0.9); }

.is-searching button { opacity: 0.7; cursor: progress; }
.search-status { margin: 12px 0 0; color: var(--muted); }
.search-status:empty { display: none; }
.search-status::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results { margin-top: 32px; }
.result-count { margin: 0 0 12px; color: var(--muted); }
.shipment { margin-bottom: 16px; overflow: hidden; }
.shipment-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); border-left: 6px solid var(--brand);
}
.status-label { margin: 0; font-size: 1.375rem; font-weight: 700; color: var(--brand-dark); }
dl { margin: 0; }
dt { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ids { display: flex; flex-wrap: wrap; gap: 8px 24px; }
/* Row 1: location | actual pickup | actual delivery. Row 2 (optional): expected dates under their actual ones. */
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; padding: 20px; }
.details .key dd { font-size: 1.125rem; }
.details .expected dd { font-weight: 400; }
.details .expected-pickup { grid-column: 2; }

.message { margin: 0; padding: 16px 20px; border-left: 6px solid var(--brand-dark); }
.message-warning { background: var(--warning-bg); border-color: var(--warning-border); }

/* Footer */
.site-footer { background: var(--brand-dark); color: #fff; padding: 24px 0; font-size: 0.9375rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 4px; }
.contact { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.copyright { color: #d6d8da; }

@media (max-width: 700px) {
  h1 { font-size: 1.625rem; }
  .search { padding: 16px; }
  .search-form { grid-template-columns: 1fr; }
  button { width: 100%; }
  .details { grid-template-columns: 1fr; }
  .details .expected-pickup { grid-column: auto; }
  .logo { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .search-status::before { animation: none; }
}
