/* =====================================================================
   Shanghai Group — дизайн-система (без сборки, чистый CSS).
   Бренд меняется в одном месте: токены в :root.
   Классы-компоненты (использовать во всех шаблонах):
     Раскладка:   .container .section .section--muted .grid .grid-2 .grid-3 .grid-4 .stack .row .spacer
     Текст:       .eyebrow .lead .muted .small .mono .h1 .h2 .h3 .price .price--big
     Кнопки:      .btn .btn--primary .btn--accent .btn--ghost .btn--sm .btn--block
     Карточки:    .card .card--hover .card__title .card__meta
     Бейджи:      .badge .badge--ok .badge--warn .badge--soon .badge--info .badge--muted
     Формы:       .form .field .field__label .field__hint .field__error input/select/textarea .check
     Таблицы:     .table .table--compact
     Таймлайн:    .timeline .timeline__item(.is-done|.is-current) .timeline__dot .timeline__body
     Прогресс:    .progress .progress__bar
     Места LCL:   .seatmap .seat(.is-free|.is-taken|.is-mine|.is-selected|.is-held) .seat__label (мини-схема;
                  схема контейнера в масштабе — templates/logistics/_container.html + static/css/container.css)
     Галерея:     .gallery .gallery__item
     Уведомления: .alert .alert--ok .alert--warn .alert--error
     Шаги:        .steps .steps__item(.is-done|.is-current)
   ===================================================================== */

:root {
  /* Брендбук Shanghai Group: тёмно-синий #061548, белый, голубой #5d99f8, синий #2b53ae, чёрный #0d0d0d.
     Основной логотип — голубой (#416eb4) на тёмно-синем. */
  --brand: #061548;          /* тёмно-синий: шапка, заголовки, тёмные секции */
  --brand-2: #0d2366;        /* hover для тёмно-синего */
  --brand-deep: #040f35;     /* подвал */
  --accent: #2b53ae;         /* синий: главные действия на светлом фоне */
  --accent-hover: #234691;
  --accent-ink: #ffffff;
  --sky: #5d99f8;            /* голубой: акценты и кнопки на тёмном фоне */
  --sky-ink: #061548;
  --logo-blue: #416eb4;      /* цвет основного логотипа */
  --ink: #0d0d0d;
  --ink-2: #3f4a5c;
  --muted: #667085;
  --line: #dde3ee;
  --bg: #ffffff;
  --bg-2: #f3f6fc;
  --ok: #1f8a4c;
  --ok-bg: #e6f4ec;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --err: #b42318;
  --err-bg: #fdecea;
  --info: #2b53ae;
  --info-bg: #e9f0fe;
  --focus: rgba(93, 153, 248, .45);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(6, 21, 72, .06), 0 4px 16px rgba(6, 21, 72, .07);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .h1, .h2, .h3 { color: var(--brand); line-height: 1.2; margin: 0 0 .5em; }
h1, .h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.02em; }
h2, .h2 { font-size: clamp(22px, 2.8vw, 32px); font-weight: 750; letter-spacing: -.01em; }
h3, .h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.price { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.price--big { font-size: clamp(32px, 5vw, 52px); }

/* Раскладка */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.section--muted { background: var(--bg-2); }
.section--brand { background: var(--brand); color: #dfe7f1; }
.section--brand h1, .section--brand h2, .section--brand h3 { color: #fff; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .section { padding: 40px 0; } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Шапка и подвал */
.site-header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { color: #fff; font-weight: 800; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.logo__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 14px; }
.logo__img { height: 44px; width: auto; display: block; }
@media (max-width: 640px) { .logo__img { height: 36px; } }
.footer-logo { height: 64px; width: auto; margin-bottom: 12px; }
.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav a { color: #d6e0ec; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a.is-active { color: #fff; text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }
/* Бургер — пока меню не помещается в одну строку: логотип + 7 пунктов (с «Место под авто LCL», «Шорингами»
   и «Кабинетом») ≈ 946px, плюс классическая полоса прокрутки Windows */
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--brand); flex-direction: column; align-items: stretch; padding: 12px 16px 20px; gap: 12px; }
  .nav.is-open { display: flex; }
}
.site-footer { background: var(--brand-deep); color: #aab8c8; padding: 40px 0 28px; font-size: 14px; }
.site-footer a { color: #d6e0ec; }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; font: 600 15px/1.2 var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; background: var(--bg-2); color: var(--ink); }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-2); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); }
.section--brand .btn--accent, .site-header .btn--accent { background: var(--sky); color: var(--sky-ink); }
.section--brand .btn--accent:hover, .site-header .btn--accent:hover { background: #7cadfa; }
.section--brand .eyebrow { color: var(--sky); }
.section--brand a:not(.btn) { color: var(--sky); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-2); }
.section--brand .btn--ghost, .site-header .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.btn--sm { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* Карточки */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card--hover:hover { border-color: #b9c4d0; }
.card__title { font-weight: 700; font-size: 18px; color: var(--brand); margin: 0 0 6px; }
.card__meta { color: var(--muted); font-size: 14px; }

/* Бейджи */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--soon { background: #efe9fb; color: #5b3aa8; }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--err { background: var(--err-bg); color: var(--err); }
.badge--muted { background: var(--bg-2); color: var(--muted); }

/* Формы */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 600; font-size: 14px; }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error, .errorlist { color: var(--err); font-size: 13px; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=url], input[type=password], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #c9d2dc; border-radius: var(--radius-sm); font: 16px/1.3 var(--font); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); border-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }

/* Таблицы */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table--compact th, .table--compact td { padding: 6px 8px; }
.table-wrap { overflow-x: auto; }

/* Таймлайн маршрута */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline__item { position: relative; padding: 0 0 18px 34px; }
.timeline__item::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { position: absolute; left: 3px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #c1cad5; }
.timeline__item.is-done .timeline__dot { background: var(--ok); border-color: var(--ok); }
.timeline__item.is-done::before { background: var(--ok); }
.timeline__item.is-current .timeline__dot { background: var(--sky); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(93, 153, 248, .25); }
.timeline__body { font-size: 15px; }
.timeline__body strong { color: var(--brand); }
.timeline__item:not(.is-done):not(.is-current) .timeline__body { color: var(--muted); }

/* Прогресс */
.progress { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--sky)); border-radius: 999px; }

/* Схема мест LCL */
.seatmap { display: grid; gap: 10px; background: #e9eef4; border: 2px solid #b8c4d1; border-radius: 10px; padding: 14px; position: relative; }
.seatmap__legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.seat { border: 2px dashed #9fb0c3; border-radius: 10px; background: #fff; min-height: 86px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; cursor: default; text-align: left; font: inherit; color: inherit; }
.seat.is-free { border-style: solid; border-color: var(--ok); cursor: pointer; }
.seat.is-free:hover { background: var(--ok-bg); }
.seat.is-selected { border-color: var(--accent); background: var(--info-bg); box-shadow: 0 0 0 3px rgba(93, 153, 248, .3); }
.seat.is-taken { border-style: solid; border-color: #c1cad5; background: #f1f4f7; color: var(--muted); }
.seat.is-held { border-style: solid; border-color: #e0b54a; background: var(--warn-bg); color: var(--warn); }
.seat.is-mine { border-style: solid; border-color: var(--info); background: var(--info-bg); }
.seat__label { font-weight: 700; font-size: 14px; }
.seat__meta { font-size: 12px; color: var(--muted); }

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery__item { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 4 / 3; }
.gallery__item img, .gallery__item video { width: 100%; height: 100%; object-fit: cover; }

/* Сообщения */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-size: 15px; }
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--warn { background: var(--warn-bg); color: var(--warn); }
.alert--error { background: var(--err-bg); color: var(--err); }
.messages { display: grid; gap: 8px; margin: 16px 0; }

/* Шаги мастера */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.steps__item { font-size: 14px; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--bg-2); }
.steps__item.is-current { background: var(--accent); color: #fff; }
.steps__item.is-done { background: var(--ok-bg); color: var(--ok); }

/* Кабинет (мобильный — «приложение») */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); }
.app-main { flex: 1; padding: 20px 0 88px; }
.app-tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.app-tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--muted); padding: 4px 10px; }
.app-tabbar a.is-active { color: var(--brand); font-weight: 700; }
.app-tabbar svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .app-tabbar { display: none; } .app-main { padding-bottom: 32px; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
