/* =========================================================================
   MPF e-IFU portal - theme
   Clean clinical white: true-neutral grays (no warm cast), with the MPF
   copper (#7B4725, sampled from the official logo) reserved for actions,
   links, selection and focus. All text pairs verified ≥ 4.5:1 (WCAG AA).
   ========================================================================= */
:root {
  /* Accent - MPF copper. Actions, links, selection, focus; never decoration. */
  --brand:        #7B4725;
  --brand-600:    #693C1F;
  --brand-700:    #56321A;
  --brand-50:     #F3EAE2;   /* accent-derived tint: selection bg + focus wash */

  /* Neutrals - true grays (chroma 0) on clinical white */
  --ink:    #1A1A1A;
  --ink-2:  #404040;
  --muted:  #6B6B6B;
  --line:   #E4E4E4;
  --line-2: #EFEFEF;
  --bg:     #FFFFFF;
  --bg-2:   #F6F6F6;

  /* Status */
  --warn: #B45309;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 10px 28px rgba(16,24,40,.06);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 4px 12px rgba(16,24,40,.05);
  --maxw: 1080px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-2);
  line-height: 1.55;
  font-size: 16px;
  /* Sticky footer: main grows, footer sits at the viewport bottom on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { line-height: 1.2; color: var(--ink); margin: 0; }
p { margin: 0; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 50;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 34px; width: auto; }
.brand-sub {
  font-size: 12px; color: var(--muted); font-weight: 600;
  padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line); letter-spacing: .2px;
}
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav { display: flex; gap: 18px; }
.nav a {
  color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.is-active { color: var(--brand-700); border-bottom-color: var(--brand); }

/* Market segmented control */
.market-switch {
  display: inline-flex; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px;
}
.ms-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; transition: all .12s ease;
}
.ms-btn:hover { color: var(--ink); }
.ms-btn.is-active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* Language selector (custom dropdown with flags) */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 11px; cursor: pointer;
}
.lang-btn:hover { border-color: #C9C9C9; color: var(--ink); }
.lang-btn .lang-name { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-caret { color: var(--muted); }
.flag {
  width: 21px; height: 15px; border-radius: 2px; object-fit: cover; flex: none; display: block;
  box-shadow: 0 0 0 1px rgba(16,24,40,.10);
}
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 366px; overflow-y: auto; min-width: 206px;
}
.lang-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--ink); white-space: nowrap;
}
.lang-opt:hover, .lang-opt:focus-visible { background: var(--bg-2); }
.lang-opt.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

/* Document language-fallback note */
.doc-fallback { font-size: 12px; color: var(--warn); margin-top: 4px; }

/* ---------- Layout ---------- */
.view { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 64px; flex: 1; }
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); margin: 28px 0 12px;
}

/* ---------- Hero / search ---------- */
.hero { margin-bottom: 26px; }
.hero h1 { font-size: 30px; letter-spacing: -.4px; }
.hero p { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }
.searchbar {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); max-width: 560px;
}
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.searchbar .i { color: var(--muted); flex: none; }
.searchbar input {
  border: 0; outline: 0; font: inherit; font-size: 15px; width: 100%; background: transparent; color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px;
}
.chip:hover { border-color: #C9C9C9; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Product grid ---------- */
.result-count { color: var(--muted); font-size: 14px; margin: 22px 0 12px; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm); transition: box-shadow .14s ease, border-color .14s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #CFCFCF; text-decoration: none; }
.card-cat {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); background: var(--bg-2);
  padding: 4px 9px; border-radius: 999px;
}
.card h3 { font-size: 18px; margin-top: 12px; }
.card .aka { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card .summary {
  font-size: 14px; color: var(--ink-2); margin-top: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2);
}
.avail { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
}
.tag.muted-tag { color: var(--muted); background: transparent; }
.card .go { color: var(--muted); flex: none; }
.card:hover .go { color: var(--brand); }
.unavail { font-size: 12.5px; color: var(--warn); font-weight: 600; }

/* ---------- Product detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 18px; }
.back:hover { color: var(--ink); text-decoration: none; }
.prod-head { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: flex-start; justify-content: space-between; }
.prod-head h1 { font-size: 28px; letter-spacing: -.3px; }
.prod-head .aka { color: var(--muted); margin-top: 6px; font-size: 14px; }
.prod-summary { color: var(--ink-2); margin-top: 12px; max-width: 65ch; }
.shades { display: flex; flex-wrap: wrap; gap: 6px; }
.shade { font-size: 12px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; background: var(--bg-2); }

/* Parsed product information */
.spec-note { color: var(--ink-2); margin: 0 0 14px; max-width: 74ch; }
.spec-grid { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.spec-row { display: grid; grid-template-columns: 210px 1fr; gap: 18px; padding: 12px 16px; }
.spec-row + .spec-row { border-top: 1px solid var(--line-2); }
.spec-row dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.spec-row dd { margin: 0; font-size: 14.5px; color: var(--ink); }
.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.bullets li { position: relative; padding-left: 24px; color: var(--ink-2); font-size: 14.5px; }
.bullets li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.callout { margin-top: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; color: var(--ink-2); }
.callout-lbl { font-weight: 700; color: var(--ink); text-transform: uppercase; font-size: 11.5px; letter-spacing: .5px; margin-right: 6px; }

/* Product media (images gallery + video players) */
.media-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.media-item {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.media-item img { display: block; width: 100%; height: 140px; object-fit: cover; }
.media-item:hover { border-color: #C9C9C9; }
.media-embed {
  width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin-top: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #000;
}
.media-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.media-grid + .media-embed { margin-top: 14px; }
.media-link {
  display: inline-flex; align-items: center; gap: 7px; margin: 12px 10px 0 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px;
}
.media-link:hover { border-color: #C9C9C9; color: var(--ink); text-decoration: none; }

/* Document list */
.doc-group { margin-top: 26px; }
.doc {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px;
}
.doc + .doc { margin-top: 10px; }
.doc-ic {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--bg-2); border-radius: 10px; color: var(--brand-700);
}
.doc-main { flex: 1 1 auto; min-width: 0; }
.doc-title { font-weight: 700; font-size: 15px; }
.doc-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.doc-actions { flex: none; display: flex; gap: 8px; }

.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  border-radius: 9px; padding: 8px 14px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #C9C9C9; color: var(--ink); }

/* Compliance / notice panels */
.notice {
  margin-top: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.notice p { color: var(--ink-2); font-size: 14.5px; }
.notice .section-title { margin-top: 0; }
.notice-meta { color: var(--muted); font-size: 13px; margin-top: 10px; }

.warnbox {
  margin-top: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; color: var(--ink-2); font-size: 13.5px;
}
.warnbox strong { color: var(--ink); }

/* About / prose */
.prose { max-width: 72ch; }
.prose h1 { font-size: 28px; letter-spacing: -.3px; }
.prose h2 { font-size: 18px; margin-top: 30px; }
.prose p { color: var(--ink-2); margin-top: 12px; }
.prose ul { color: var(--ink-2); margin-top: 12px; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose .lead { font-size: 17px; color: var(--ink); }

/* Empty state */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .i { width: 28px; height: 28px; color: var(--line); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 20px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 40px; display: grid; gap: 10px; }
.footer-inner .disclaimer { margin-top: 8px; max-width: 90ch; }

/* ---------- Request form ---------- */
.reqwrap { max-width: 660px; margin: 0 auto; }
.req-title { font-size: 26px; letter-spacing: -.3px; margin-top: 14px; }
.req-lead { color: var(--ink-2); margin-top: 10px; max-width: 60ch; }
.reqform { display: grid; gap: 16px; margin-top: 22px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--brand); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.field textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-weight: 400; color: var(--muted); }

/* Icons */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.i-sm { width: 16px; height: 16px; }

/* ---------- Motion: quiet, functional choreography ----------
   Entrance reveals orient the eye on navigation (never while typing);
   hovers give tactile feedback without lifting or decorating.
   Everything here is disabled under prefers-reduced-motion. */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* view children cascade in on navigation (route() toggles .anim) */
.view.anim > * { animation: rise .32s cubic-bezier(.2, .7, .3, 1) both; }
.view.anim > *:nth-child(2) { animation-delay: .05s; }
.view.anim > *:nth-child(3) { animation-delay: .10s; }
.view.anim > *:nth-child(4) { animation-delay: .15s; }
.view.anim > *:nth-child(5) { animation-delay: .20s; }
.view.anim > *:nth-child(6) { animation-delay: .24s; }
.view.anim > *:nth-child(7) { animation-delay: .28s; }
.view.anim > *:nth-child(n+8) { animation-delay: .32s; }

/* product cards stagger inside the grid */
.view.anim .grid > * { animation: rise .34s cubic-bezier(.2, .7, .3, 1) both; }
.view.anim .grid > *:nth-child(1) { animation-delay: .10s; }
.view.anim .grid > *:nth-child(2) { animation-delay: .14s; }
.view.anim .grid > *:nth-child(3) { animation-delay: .18s; }
.view.anim .grid > *:nth-child(4) { animation-delay: .22s; }
.view.anim .grid > *:nth-child(5) { animation-delay: .26s; }
.view.anim .grid > *:nth-child(6) { animation-delay: .30s; }
.view.anim .grid > *:nth-child(7) { animation-delay: .34s; }
.view.anim .grid > *:nth-child(n+8) { animation-delay: .38s; }

/* hero: a short copper rule draws in under the title (print-style signature) */
.hero h1 { position: relative; padding-bottom: 14px; }
.hero h1::after {
  content: ""; position: absolute; left: 1px; bottom: 0;
  width: 44px; height: 3px; border-radius: 2px; background: var(--brand);
  animation: rule-in .5s cubic-bezier(.2, .7, .3, 1) both .18s;
}
@keyframes rule-in { from { width: 0; opacity: 0; } }

/* cards: the arrow answers the hover; the category label warms to copper */
.card .go { transition: transform .16s ease, color .16s ease; }
.card:hover .go { transform: translateX(3px); }
.card .card-cat { transition: color .16s ease, background .16s ease; }
.card:hover .card-cat { color: var(--brand-700); background: var(--brand-50); }

/* document rows: the icon tile answers the hover */
.doc { transition: border-color .16s ease; }
.doc:hover { border-color: #CFCFCF; }
.doc-ic { transition: background .16s ease, color .16s ease; }
.doc:hover .doc-ic { background: var(--brand-50); }

/* tactile press feedback on all buttons and chips */
.btn { transition: background .13s ease, border-color .13s ease, color .13s ease, transform .09s ease; }
.btn:active { transform: scale(.97); }
.chip { transition: background .13s ease, border-color .13s ease, color .13s ease, transform .09s ease; }
.chip:active { transform: scale(.96); }
.ms-btn:active { transform: scale(.96); }

/* language menu opens with a small, quick pop from its corner */
.lang-menu { transform-origin: top right; }
.lang-menu:not([hidden]) { animation: menu-pop .14s cubic-bezier(.2, .7, .3, 1); }
@keyframes menu-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* header separates from the page once scrolled */
.site-header { transition: box-shadow .22s ease; }
.site-header.scrolled { box-shadow: 0 2px 14px rgba(16, 24, 40, .07); }

/* the switch that turns it all off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .brand-sub { display: none; }
  .header-right { width: 100%; justify-content: space-between; gap: 12px; }
  .hero h1 { font-size: 25px; }
  .prod-head { flex-direction: column; }
  .doc { flex-wrap: wrap; }
  .doc-actions { width: 100%; }
  .doc-actions .btn { flex: 1; justify-content: center; }
  .spec-row { grid-template-columns: 1fr; gap: 3px; }
  .field-row { grid-template-columns: 1fr; }
}
