/* Дизайн «А. Светлый магазин»: белые карточки, синий акцент, Manrope. */
:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-muted: #F0F1F4;
  --border: #E4E6EB;
  --border-strong: #C9CDD6;
  --text: #15171C;
  --text-muted: #5B606B;
  --accent: #1F4FE0;
  --accent-hover: #163BA8;
  --accent-soft: #EEF2FE;
  --danger: #B42318;
  --success: #067647;
  --radius: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* Шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; height: 46px; }
.search input { border: 0; background: transparent; font: inherit; flex: 1; outline: none; min-width: 0; }
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nav-link { font-weight: 600; padding: 12px 14px; color: var(--text); }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; }
.inline-form { margin: 0; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; padding: 12px 18px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; min-height: 44px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); }
.btn-dark { background: var(--text); color: #fff; font-weight: 700; }
.btn-dark:hover { color: #fff; background: #000; }
.btn-block { width: 100%; }

.main { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 32px; }

/* Баннеры */
.banners { display: flex; flex-wrap: wrap; gap: 16px; }
.banner { min-height: 240px; border-radius: var(--radius-lg); display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.banner-main { flex: 2 1 420px; background: #1F2A55; color: #fff; padding: 32px; }
.banner-main:hover { color: #fff; }
.banner-side { flex: 1 1 280px; background: #FFE7D1; color: #4A2410; padding: 28px; }
.banner-side:hover { color: #4A2410; }
.banner-tag { align-self: flex-start; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px; }
.banner-side .banner-tag { background: rgba(74,36,16,.1); }
.banner-body { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.banner-title { font-size: 34px; font-weight: 800; line-height: 1.15; }
.banner-title-sm { font-size: 24px; font-weight: 800; line-height: 1.2; }
.banner-text { font-size: 16px; color: #D5DAEE; }
.banner-cta { align-self: flex-start; background: #fff; color: #1F2A55; font-weight: 700; padding: 12px 20px; border-radius: var(--radius); }
.banner-link { font-weight: 700; }
/* Цвета оплаченных баннеров продавцов. */
.banner.banner-navy { --b-bg: #1F2A55; --b-fg: #fff; --b-text: #D5DAEE; --b-tag: rgba(255,255,255,.16); --b-cta-bg: #fff; --b-cta-fg: #1F2A55; }
.banner.banner-peach { --b-bg: #FFE7D1; --b-fg: #4A2410; --b-text: #6B3A1E; --b-tag: rgba(74,36,16,.1); --b-cta-bg: #4A2410; --b-cta-fg: #fff; }
.banner.banner-mint { --b-bg: #D8F1E8; --b-fg: #0B3D2E; --b-text: #245C49; --b-tag: rgba(11,61,46,.1); --b-cta-bg: #0B3D2E; --b-cta-fg: #fff; }
.banner.banner-lilac { --b-bg: #EADFFC; --b-fg: #34175F; --b-text: #4F2D85; --b-tag: rgba(52,23,95,.1); --b-cta-bg: #34175F; --b-cta-fg: #fff; }
.banner-themed, .banner-themed:hover { background: var(--b-bg); color: var(--b-fg); }
.banner-themed .banner-text { color: var(--b-text); }
.banner-themed .banner-tag { background: var(--b-tag); }
.banner-themed .banner-cta { background: var(--b-cta-bg); color: var(--b-cta-fg); }
.banner-preview { pointer-events: none; }
.banner-order { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.banner-preview-box { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.banner-preview-box .banner { flex: 1 1 auto; width: 100%; }
.order-total { font-size: 18px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Категории (тип продукта) и разделы (тема) */
.filters { display: flex; flex-direction: column; gap: 14px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.category-tab { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 12px 18px; min-height: 44px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.category-tab:hover { color: var(--text); border-color: var(--border-strong); }
.category-tab-active, .category-tab-active:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-blue { background: #1F4FE0; } .dot-teal { background: #0E7C66; } .dot-orange { background: #C2410C; }
.dot-purple { background: #6D28D9; } .dot-pink { background: #BE185D; } .dot-gray { background: #5B606B; }
.badge { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; color: #fff; }
.badge-blue { background: #1F4FE0; } .badge-teal { background: #0E7C66; } .badge-orange { background: #C2410C; }
.badge-purple { background: #6D28D9; } .badge-pink { background: #BE185D; } .badge-gray { background: #5B606B; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-active, .chip-active:hover { background: var(--text); border-color: var(--text); color: #fff; }

/* Карточки приложений */
.apps-section { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.app-card:hover { color: var(--text); border-color: var(--border-strong); }
.app-shot { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.app-shot img { width: 100%; height: 100%; object-fit: cover; }
.app-shot-placeholder { font-size: 48px; font-weight: 800; color: rgba(21,23,28,.35); }
.tint-a { background: #DCE5FF; } .tint-b { background: #D8F1E8; } .tint-c { background: #FFE7D1; } .tint-d { background: #EADFFC; }
.app-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.app-seller { font-size: 13px; color: var(--text-muted); }
.app-section { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.app-name { font-size: 17px; font-weight: 700; line-height: 1.3; }
.app-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-price { font-size: 16px; font-weight: 800; }
.pill { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px; }
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; color: var(--text-muted); }
.empty h3 { color: var(--text); }

/* Блок для продавцов */
.seller-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.seller-cta > div { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.seller-cta p { font-size: 16px; color: var(--text-muted); }

/* Страницы кабинета и форм */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.panel-title { font-size: 20px; }
.cabinet-grid, .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.balance { font-size: 36px; font-weight: 800; }
.step-num { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.pos { color: var(--success); } .neg { color: var(--danger); }

.auth-card { max-width: 440px; width: 100%; margin: 24px auto; gap: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .radio-group legend { font-weight: 600; font-size: 14px; }
.field input[type=text], .field input[type=email], .field input[type=password] { font: inherit; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); min-height: 44px; }
.field input[type=url], .field input[type=number], .field select, .field textarea { font: inherit; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); min-height: 44px; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.radio-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.radio-group legend { margin-bottom: 6px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.radio-group ul, .radio-group li { list-style: none; margin: 0; padding: 0; }
.help { font-size: 12px; color: var(--text-muted); }
.help ul { margin: 4px 0 0; padding-left: 18px; }
.form-error { color: var(--danger); font-size: 13px; }
.field-invalid input { border-color: var(--danger); }

/* Кабинет продавца */
.form-grid { display: flex; flex-direction: column; gap: 16px; }
fieldset.panel { margin: 0; min-width: 0; }
fieldset.panel > h2 { padding: 0; }
.btn[disabled], fieldset[disabled] .btn { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.shot-item { display: flex; flex-direction: column; gap: 8px; }
.shot-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.setting-fields { display: flex; flex-direction: column; gap: 12px; }
.setting-field { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.setting-field-grid .field[hidden] { display: none; }
.setting-field-new { border-style: dashed; }
.setting-field-title { font-weight: 700; }
.setting-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.setting-field-grid .field-choices, .setting-field-grid .field-help_text { grid-column: 1 / -1; }
.setting-field-grid .field-required { align-self: end; min-height: 44px; justify-content: center; }
.field input[type=text] { width: 100%; }
.plain-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); white-space: nowrap; }
.status-moderation { background: #FFF4E5; color: #B54708; }
.status-published { background: #E7F6EE; color: var(--success); }
.status-build-queued, .status-build-running { background: #FFF4E5; color: #B54708; }
.status-build-success { background: #E7F6EE; color: var(--success); }
.status-build-failed { background: #FDECEA; color: var(--danger); }
.build-log { margin: 0; max-height: 70vh; overflow: auto; background: #15171C; color: #E4E6EB; padding: 16px; border-radius: var(--radius); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.hint summary { cursor: pointer; font-weight: 600; }
.hint[open] { display: flex; flex-direction: column; gap: 8px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 600; font-size: 14px; }
.kv dd { margin: 0; word-break: break-all; }
.status-rejected { background: #FDECEA; color: var(--danger); }
.status-purchase-active { background: #E7F6EE; color: var(--success); }
.status-purchase-expired { background: #FDECEA; color: var(--danger); }
.checkout { max-width: 720px; }

/* Страница приложения */
.app-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.app-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.app-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge-inline { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; color: #fff; }
.lead { font-size: 18px; }
.gallery { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery img { height: 260px; max-width: none; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.description p + p { margin-top: 10px; }
.app-buy { position: sticky; top: 16px; gap: 14px; }
.plan { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.app-price-lg { font-size: 28px; font-weight: 800; }

.messages { display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.message-success { background: #E7F6EE; color: var(--success); }
.message-error { background: #FDECEA; color: var(--danger); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0; color: var(--text-muted); font-size: 13px; }

@media (max-width: 900px) {
  .banner-order { grid-template-columns: 1fr; }
  .banner-preview-box { position: static; order: -1; }
  .app-page { grid-template-columns: 1fr; }
  .app-buy { position: static; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .banner-title { font-size: 26px; }
  .banner-main, .banner-side, .seller-cta { padding: 24px; }
  h1 { font-size: 26px; }
  .gallery img { height: 180px; }
}
