/* BuildFlow — общие стили сайта, кабинета и админки. Цвета и размеры — из утверждённых макетов С01–С61. */
:root {
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --line: #EEF1F6;
  --line-strong: #DDE3EC;
  --primary: #1A5FD6;
  --primary-hover: #154FB5;
  --primary-soft: #EAF2FE;
  --text: #1B1E22;
  --muted: #5B6168;
  --muted-2: #7A8089;
  --error: #C62828;
  --error-soft: #FDECEC;
  --ok: #1D6234;
  --ok-soft: #E1F1E5;
  --warn: #6A4D00;
  --warn-soft: #FBEFC5;
  --kz: #0B4F94;
  --kz-soft: #E3EEF9;
  --overlay: rgba(27, 30, 34, .45);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --container: 1200px;
  --header-h: 72px;
  --font: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 40px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(26, 95, 214, .35); outline-offset: 2px; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo__mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, #2D7BF0, #1446B8); display: grid; place-items: center; color: #fff; }
.logo__text b { color: var(--primary); font-weight: 800; }
.logo__suffix { color: var(--muted); font-weight: 700; font-size: 20px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text); font-weight: 700; font-size: 15px; }
.nav a[aria-current="page"] { color: var(--primary); }
.header__search { flex: 1; max-width: 500px; }
.header__spacer { flex: 1; }
.city { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; color: var(--text); background: none; border: 0; padding: 8px 4px; cursor: default; }
.langs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.langs a { min-width: 40px; height: 38px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--text); }
.langs a:hover { text-decoration: none; background: var(--bg); }
.langs a[aria-current="true"] { background: var(--primary); color: #fff; }
.count-badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 12px; display: inline-grid; place-items: center; padding: 0 6px; }
.header__link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 15px; }

/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: #C5CEDA; }
.btn--danger { background: var(--card); border-color: #F2C4C4; color: var(--error); }
.btn--danger:hover { background: var(--error-soft); }
.btn--link { background: none; border: 0; color: var(--primary); padding: 0 4px; min-height: 44px; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > label, .field__label { font-weight: 700; font-size: 15px; }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.textarea { padding: 12px 16px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #8A9099; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 95, 214, .15); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 14px; color: var(--muted-2); pointer-events: none; }
.input-wrap > .icon ~ .input { padding-left: 44px; }
.input-wrap .input:has(+ .input-wrap__suffix) { padding-right: 48px; }
.input-wrap__suffix { position: absolute; right: 14px; color: var(--muted); font-size: 14px; }
.input-wrap__state { position: absolute; right: 14px; color: var(--ok); }
.field__help { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--error); font-weight: 600; display: none; }
.field__hint { font-size: 13px; color: var(--text); display: none; }
.field__hint button { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: underline; }
.field.is-invalid .input, .field.is-invalid .textarea, .field.is-invalid .select { border-color: var(--error); }
.field.is-invalid .field__error { display: block; }
.field.has-hint .field__hint { display: block; }
.field.is-valid .input { border-color: #8CC79F; }
.counter { font-size: 13px; color: var(--muted); align-self: flex-end; }
.counter.is-near { color: var(--warn); font-weight: 700; }
.counter.is-over { color: var(--error); font-weight: 700; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--primary); }

.search { position: relative; }
.search .input { padding-left: 44px; background: var(--bg); border-color: var(--line); }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

/* подсказки поиска */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow: auto; }
.suggest li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 15px; }
.suggest li a span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.suggest li a:hover, .suggest li a[aria-selected="true"] { background: var(--primary-soft); text-decoration: none; }
.search--hero { display: flex; gap: 10px; }
.search--hero .input { flex: 1; }
.search__btn { min-width: 110px; }

/* ---------- Карточки, плитки, метки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card--pad { padding: 24px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 800; line-height: 18px; }
.badge--kz { background: var(--kz-soft); color: var(--kz); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--ad { background: #ECEEF1; color: #4A4F57; }
.badge--muted { background: var(--line); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-size: 14px; font-weight: 700; color: var(--text); }
a.chip:hover { text-decoration: none; border-color: #C5CEDA; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-tile { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin: 22px 0 14px; padding: 0; list-style: none; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted-2); }
.breadcrumbs [aria-current] { color: var(--text); }

.page { padding-bottom: 64px; flex: 1 0 auto; }
.modal-page { flex: 1 0 auto; }
.tiles--6 { grid-template-columns: repeat(6, 1fr); }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page__lead { color: var(--muted); font-size: 17px; max-width: 720px; margin-top: 10px; }
.section { margin-top: 44px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section__more { font-weight: 800; font-size: 15px; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0; font-weight: 700; font-size: 15px; }
.flash--ok { background: var(--ok-soft); color: var(--ok); }
.flash--error { background: var(--error-soft); color: var(--error); }

.empty { text-align: center; padding: 56px 24px; }
.empty .icon-tile { margin: 0 auto 16px; width: 56px; height: 56px; }
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Таблицы ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #F1F4F9; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Подвал ---------- */
.footer { background: var(--card); border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; color: var(--muted); }
.footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: underline; }

/* ---------- Нижняя панель на телефоне ---------- */
.tabbar { display: none; }

/* ---------- Главная (С01) ---------- */
.hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; margin-top: 36px; }
.hero__main { padding: 36px 30px; }
.hero h1 { font-size: 38px; line-height: 1.15; max-width: 470px; }
.hero__lead { color: var(--muted); font-size: 17px; margin: 14px 0 24px; max-width: 460px; }
.hero__how { padding: 26px 24px; }
.how { list-style: none; margin: 16px 0 0; padding: 0; }
.how li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.how li:first-child { border-top: 0; padding-top: 4px; }
.how b { display: block; font-size: 15px; }
.how span { color: var(--muted); font-size: 13px; }
.how .icon-tile { width: 40px; height: 40px; }

.tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 14px; padding: 16px 14px; min-height: 102px; color: var(--text); font-weight: 800; font-size: 15px; line-height: 1.25; }
.tile:hover { text-decoration: none; border-color: #C9D6EA; }
.tile .icon-tile { width: 36px; height: 36px; border-radius: 10px; }
.tile--all { border-style: dashed; flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.tile--all .icon-tile { width: 36px; height: 36px; flex-basis: 100%; max-width: 36px; }

/* ---------- Окна и шторки ---------- */
.modal-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--overlay); }
.sheet { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px; position: relative; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet__head h1 { font-size: 26px; }
.sheet__close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--text); margin-right: -10px; }
.sheet__back { width: 44px; height: 44px; display: grid; place-items: center; margin-left: -12px; color: var(--text); }
.sheet__lead { color: var(--muted); margin-bottom: 18px; }
.sheet__foot { font-size: 13px; color: var(--muted); margin-top: 14px; }
.otp { display: flex; gap: 12px; justify-content: center; margin: 18px 0 12px; }
.otp input { width: 64px; height: 64px; text-align: center; font-size: 26px; font-weight: 800; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); }
.otp input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 95, 214, .15); }
.otp.is-invalid input { border-color: var(--error); }
.otp-error { text-align: center; color: var(--error); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.resend { text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Ошибки (С60, С61) ---------- */
.errpage { padding: 56px 0 72px; }
.errpage__num { font-size: 72px; font-weight: 800; color: #C9D3E2; line-height: 1; margin-bottom: 12px; }
.errpage h1 { font-size: 34px; margin-bottom: 10px; }
.errpage__lead { color: var(--muted); font-size: 17px; margin-bottom: 24px; }
.errpage .search { max-width: 560px; margin-bottom: 20px; }
.errpage__center { text-align: center; max-width: 520px; margin: 0 auto; }
.errpage__center .icon-tile { margin: 0 auto 18px; width: 64px; height: 64px; border-radius: 16px; }
.errpage__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }

/* ---------- Кабинет (покупатель) ---------- */
.account { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: 28px; }
.account-menu { padding: 10px; align-self: start; }
.account-menu a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.account-menu a:hover { background: var(--bg); text-decoration: none; }
.account-menu a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 12px 14px; font-weight: 800; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 18px; color: var(--text); font-weight: 700; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg); text-decoration: none; }
.menu-list .icon:last-child { margin-left: auto; color: var(--muted-2); }
.menu-list__value { margin-left: auto; color: var(--muted); font-weight: 600; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .nav { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  .container { padding: 0 16px; }
  .header__search, .header__link--desktop, .city--desktop { display: none; }
  .header__row { gap: 12px; }
  .logo { font-size: 20px; }
  .logo__mark { width: 32px; height: 32px; }
  .langs a { min-width: 38px; height: 36px; }
  .hero { grid-template-columns: 1fr; margin-top: 18px; }
  .hero__main { padding: 22px 16px; }
  .hero h1 { font-size: 27px; }
  .hero__lead { font-size: 15px; }
  .hero__how { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { min-height: 84px; }
  .tiles--6 { grid-template-columns: repeat(2, 1fr); }
  .tile--all { grid-column: 1 / -1; min-height: 52px; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 12px; }
  .tile--all .icon-tile { flex-basis: auto; }
  .tile--all span:not(.icon-tile) { flex: 1; }
  .tile--all br { display: none; }
  .page__head { flex-direction: column; align-items: stretch; }
  .section { margin-top: 32px; }
  .footer { padding-bottom: 92px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; font-size: 12px; font-weight: 700; color: var(--muted); border-top: 2px solid transparent; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--primary); border-top-color: var(--primary); }
  .modal-page { align-items: end; padding: 0; }
  .sheet { max-width: none; border-radius: 22px 22px 0 0; padding: 14px 16px 24px; }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 14px; }
  .otp input { width: 60px; height: 60px; }
  .account { grid-template-columns: 1fr; margin-top: 16px; }
  .account-menu { display: none; }
  .errpage { padding: 32px 0 48px; }
  .errpage h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
