/* ============================================================
   Дизайн-система Catalist (по фирменным макетам основного сайта)
   Крем + чёрный + белый · гротеск Archivo (self-hosted) ·
   CAPS-заголовки «лёгкое + жирное-расширенное» · кнопки-пилюли ·
   белые карточки и чёрные акцентные блоки · чёрная футер-лента.
   ============================================================ */

@font-face {
  font-family: "Archivo"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("/static/fonts/archivo-300.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/archivo-400.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/archivo-600.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo Expanded"; font-weight: 800; font-style: normal; font-display: swap;
  src: url("/static/fonts/archivo-exp-800.woff2") format("woff2");
}

:root {
  --page: #F2E0BE;               /* кремовый фон */
  --ink: #14120E;                /* почти чёрный */
  --panel: #FFFFFF;              /* белые карточки */
  --line: rgba(20, 18, 14, .16); /* тонкие линии */
  --steel: #6B6555;              /* приглушённый текст */
  --field: #FFFFFF;              /* фон полей ввода */
  --plate: #14120E; --plate-edge: #2A2620; --engrave: #F2E0BE;
  --brass: #8A6A1F;              /* тёплый акцент, точечно */
  --green: #2E6B46; --oxide: #A93A22;
  --sans: "Archivo", -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --display: "Archivo Expanded", "Archivo", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 18, 14, .06), 0 8px 24px -18px rgba(20, 18, 14, .35);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
::selection { background: var(--ink); color: var(--page); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 560px; width: 100%; margin: 0 auto; padding: 0 18px 64px; flex: 1; }

/* ---------- шапка ---------- */
header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(242, 224, 190, .62);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1.5px solid var(--ink); padding: 14px 18px 12px;
}
.head-inner { max-width: 560px; margin: 0 auto; }
/* Логотип — серифный знак: подпись и ссылки сидят на его базовой линии
   (flex-end + компенсация хвоста-росчерка), а не болтаются по центру. */
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.brand-left { display: flex; align-items: flex-end; gap: 12px; min-width: 0; margin-right: auto; }
.brand img { height: 32px; width: auto; display: block; }
.brand .sub {
  font-size: 11px; letter-spacing: 2.6px; text-transform: uppercase; line-height: 1;
  color: var(--steel); font-weight: 600;
  padding: 0 0 6px 12px; border-left: 1.5px solid var(--line); white-space: nowrap;
}
.head-links { display: flex; gap: 16px; padding-bottom: 6px; flex: none; }
.head-links a {
  font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; line-height: 1;
  font-weight: 600; color: var(--steel); text-decoration: none; white-space: nowrap;
  transition: color .15s ease;
}
.head-links a:hover { color: var(--ink); }
@media (max-width: 519px) { .brand .sub { display: none; } .brand-left { border: none; } }

/* ---------- бургер и стеклянное меню разделов ---------- */
.burger {
  flex: none; width: 44px; height: 44px; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .38);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  transition: border-color .18s ease, background .18s ease;
  align-self: center;
}
.burger:hover { border-color: var(--ink); background: rgba(255, 255, 255, .55); }
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay[hidden] { display: none; } /* класс с display:flex не должен перебивать hidden */
.menu-overlay {
  position: fixed; inset: 0; z-index: 4; /* под sticky-шапкой: бургер остаётся кликабельным */
  background: rgba(242, 224, 190, .78);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 164px 22px 32px; overflow-y: auto;
}
.menu-panel { width: 100%; max-width: 560px; display: flex; flex-direction: column; }
.menu-panel a {
  font-family: var(--sans); font-weight: 300; text-transform: uppercase;
  font-size: clamp(28px, 7.6vw, 38px); line-height: 1.12; letter-spacing: .4px;
  color: var(--ink); text-decoration: none; padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .18s ease, color .18s ease;
}
.menu-panel a b { font-family: var(--display); font-weight: 800; letter-spacing: .2px; }
.menu-panel a:hover { padding-left: 12px; }
.menu-panel a.current { color: var(--steel); pointer-events: none; }
.menu-copy { margin-top: 26px; font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; font-weight: 600; color: var(--steel); }
.menu-lock, .menu-lock body { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .menu-overlay { animation: menuFade .22s ease both; }
  .menu-panel a { animation: rise .34s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
  @keyframes menuFade { from { opacity: 0; } }
}

/* вкладки — стеклянная капсула (glass) поверх прокручиваемого контента */
nav.tabs {
  display: flex; gap: 4px; padding: 5px;
  background: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 28px;
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 24px -16px rgba(20, 18, 14, .45);
}
nav.tabs button {
  flex: 1; padding: 10px 6px; cursor: pointer; border-radius: 999px; text-align: center;
  font-family: var(--sans); border: none; background: transparent; color: var(--steel);
  transition: background .18s ease, color .18s ease;
}
nav.tabs button:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
nav.tabs button.active { background: var(--ink); color: #fff; }
nav.tabs button .t { font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; display: block; }
nav.tabs button .s { font-size: 10px; letter-spacing: .5px; margin-top: 2px; opacity: .75; display: block; }

/* ---------- заголовки: ЛЁГКОЕ + ЖИРНОЕ-РАСШИРЕННОЕ капсом ---------- */
.hero { margin: 40px 0 6px; }
.eyebrow {
  font-size: 11px; letter-spacing: 3.2px; text-transform: uppercase;
  font-weight: 600; color: var(--steel); margin-bottom: 10px;
}
h2 {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(28px, 7.5vw, 40px); line-height: 1.08;
  text-transform: uppercase; letter-spacing: .4px; color: var(--ink);
  margin: 34px 0 14px; text-wrap: balance;
}
.hero h2 { margin: 0 0 12px; }
h2 b, h2 strong { font-family: var(--display); font-weight: 800; letter-spacing: .2px; }
.spark { margin-left: 2px; vertical-align: super; color: var(--ink); }
.nowrap { white-space: nowrap; }
.lead { font-size: 16.5px; line-height: 1.6; color: var(--steel); margin: 0 0 8px; max-width: 46ch; }

/* ---------- карточки и формы ---------- */
.card {
  background: var(--panel); border: none; border-radius: var(--radius);
  padding: 24px 20px; margin-top: 16px; box-shadow: var(--shadow);
}
label {
  display: block; font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--steel); font-weight: 600; margin: 18px 0 8px;
}
.card > label:first-child { margin-top: 0; }
input, select {
  width: 100%; padding: 14px 20px; background: var(--field);
  border: 1.5px solid var(--line); border-radius: 999px;
  font-family: var(--sans); font-size: 16px; color: var(--ink); appearance: none;
  transition: border-color .18s ease;
}
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2314120E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; padding-right: 46px;
  text-overflow: ellipsis;
}
input::placeholder { color: rgba(20, 18, 14, .28); }
input:focus, select:focus { outline: none; border-color: var(--ink); }
input[type="date"] { border-radius: 22px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }

/* кнопки-«пилюли» */
button.btn, a.btn {
  display: block; width: 100%; padding: 16px 20px; margin-top: 14px; cursor: pointer;
  border-radius: 999px; text-align: center; text-decoration: none;
  background: var(--ink); color: #fff; border: 1.5px solid var(--ink);
  font-family: var(--sans); font-size: 16px; letter-spacing: .4px; font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease;
}
button.btn:hover, a.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(20,18,14,.5); }
button.btn:active, a.btn:active { transform: translateY(0) scale(.99); box-shadow: none; }
button.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: transparent; border-color: var(--oxide); color: var(--oxide); }
.btn.light { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------- серийный номер: чёрные гравированные клетки ---------- */
.plate { display: flex; gap: 6px; justify-content: center; margin: 16px 0 8px; }
.plate div {
  flex: 1 1 0; min-width: 0; aspect-ratio: .82; max-width: 56px;
  background: var(--plate); border: 1px solid var(--plate-edge); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--engrave); font-family: var(--mono); font-size: 27px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(242, 224, 190, .14);
}
.preview-frame { border: 1.5px dashed var(--ink); border-radius: var(--radius); padding: 12px 12px 4px; background: transparent; box-shadow: none; }
.preview-note { text-align: center; font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--steel); font-weight: 600; margin: 6px 0 10px; }

.msg { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--steel); }
.msg.err { color: var(--oxide); }
.msg.okk { color: var(--green); }

/* ---------- результат проверки ---------- */
.status-card { border-radius: var(--radius); padding: 26px 20px; margin-top: 16px; border: 2px solid; background: var(--panel); box-shadow: var(--shadow); }
.status-card.genuine { border-color: var(--green); }
.status-card.bad { border-color: var(--oxide); }
.status-card.warn { border-color: var(--brass); }
.status-title {
  font-family: var(--display); font-size: 24px; letter-spacing: .6px; text-transform: uppercase;
  font-weight: 800; display: flex; align-items: center; gap: 12px; line-height: 1.1;
}
.status-card.genuine .status-title { color: var(--green); }
.status-card.bad .status-title { color: var(--oxide); }
.status-card.warn .status-title { color: var(--brass); }
.seal { flex: 0 0 auto; display: inline-flex; }
.status-sub { font-size: 15.5px; color: var(--ink); margin-top: 10px; line-height: 1.6; }

.kv { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; font-size: 15.5px; }
.kv:first-of-type { border-top: none; margin-top: 12px; }
.kv .k { color: var(--steel); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; padding-top: 3px; white-space: nowrap; }
.kv .v { text-align: right; word-break: break-word; }
.kv .v.mono { font-family: var(--mono); letter-spacing: 1.5px; }
.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; margin-right: 7px; }
.product-photo { width: 100%; border-radius: 12px; margin-top: 12px; }

/* чёрная карточка скидки */
.discount-card {
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: 28px 22px; margin-top: 16px; text-align: center;
}
.discount-card .dc-title { font-family: var(--display); font-size: 38px; font-weight: 800; letter-spacing: .5px; }
.discount-card .dc-sub { font-size: 15px; line-height: 1.6; margin-top: 10px; opacity: .92; }
.discount-card .dc-note { font-size: 13px; margin-top: 12px; opacity: .65; }
.discount-card .btn { margin-top: 20px; }

/* ---------- таблицы (журнал) ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; color: var(--steel); padding: 10px 8px; border-bottom: 2px solid var(--ink); }
td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td .code { font-family: var(--mono); font-weight: 700; letter-spacing: 1px; }
td .dim { color: var(--steel); font-size: 12px; }
.tbl-wrap td { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius); padding: 8px 16px 12px; margin-top: 16px; box-shadow: var(--shadow); }
.del { cursor: pointer; border: none; background: none; color: var(--oxide); font-size: 16px; padding: 4px 8px; }

.pin-box { max-width: 380px; margin: 44px auto 0; }
.or-sep { text-align: center; font-size: 11px; letter-spacing: 2.6px; text-transform: uppercase; color: var(--steel); font-weight: 600; margin: 16px 0 2px; }

/* ---------- чёрная футер-лента (как на основном сайте) ---------- */
footer.site-foot { background: var(--ink); color: #fff; margin-top: 64px; }
.foot-inner { max-width: 560px; margin: 0 auto; padding: 36px 18px 30px; }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.foot-mark { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: 1.5px; }
.foot-logo { height: 36px; width: auto; filter: brightness(0) invert(1); opacity: .96; }
.foot-cat { color: var(--page); opacity: .9; flex: 0 0 auto; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(242, 224, 190, .22); }
.foot-links a { color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: .3px; opacity: .92; }
.foot-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.foot-links span#foot-session { display: contents; }
.foot-links #foot-who { color: var(--page); opacity: .65; font-size: 13px; }
.foot-copy { margin-top: 18px; font-size: 12px; letter-spacing: .4px; color: rgba(242, 224, 190, .55); }
.hidden { display: none !important; }

/* ---------- движение: деликатно и с уважением к reduce-motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card, .status-card, .discount-card, .tbl-wrap { animation: rise .38s cubic-bezier(.2, .7, .3, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}

/* ---------- планшет и шире ---------- */
@media (min-width: 640px) {
  .wrap, .head-inner, .foot-inner { max-width: 620px; }
  .card, .status-card { padding: 28px 26px; }
  .plate { gap: 8px; }
  .plate div { font-size: 30px; border-radius: 14px; }
  .foot-mark { font-size: 28px; }
}
