/* doimi — интерфейсы приложения: вход, карта клиента, админка бизнеса, панель платформы */

:root {
  --ink: #0C0C14; --paper: #F4F4F1; --line: #E2E1DC; --text: #3D3C39; --muted: #6B6A66;
  --yellow: #FFC83D; --ok: #1E7A4E; --err: #B42318;
  --fd: 'Wix Madefor Display', system-ui, sans-serif; --ft: 'Wix Madefor Text', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
/* Страница не уезжает вбок на телефоне; касания без задержки и серой вспышки */
html, body { overflow-x: clip; overscroll-behavior-x: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { margin: 0; }
img { max-width: 100%; }
.app-body { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--ft); -webkit-font-smoothing: antialiased; }
.bp-body { background: #E6E5E0; margin: 0; }
.app-body a { color: inherit; }
.app-body h1, .app-body h2 { font-family: var(--fd); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.app-body h2 { font-size: 19px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Базовые элементы ---------- */
.panel { background: #FFF; border-radius: 20px; padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.center { align-items: center; }

input, select, textarea { font: 16px var(--ft); color: var(--ink); background: #FAFAF7; border: 1px solid #D9D7CF; border-radius: 12px; padding: 0 14px; min-height: 48px; width: 100%; }
textarea { padding: 12px 14px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent, #3550FF); outline-offset: 1px; border-color: transparent; }
label, legend { font-size: 14px; font-weight: 600; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }

button, .btn-ink, .btn-accent, .btn-ghost, .btn-big { font: 600 15px/1 var(--ft); cursor: pointer; border: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-ink { background: var(--ink); color: #FFF !important; border-radius: 12px; min-height: 48px; padding: 0 18px; }
.btn-accent { background: var(--accent, #3550FF); color: #FFF !important; border-radius: 12px; min-height: 48px; padding: 0 18px; }
.btn-ghost { background: #FFF; color: var(--ink); border: 1px solid #D6D5CF; border-radius: 12px; min-height: 44px; padding: 0 16px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-big { width: 100%; min-height: 60px; border-radius: 16px; font-size: 17px; padding: 0 20px; }
.btn-big.btn-accent { box-shadow: 0 4px 0 color-mix(in srgb, var(--accent, #3550FF) 60%, #000); }
.btn-gold { background: linear-gradient(180deg, #FFDA70, #FFC23A); color: var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 #B8860B; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }

.flash { border-radius: 14px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.flash--ok { background: #E3F4EA; color: var(--ok); }
.flash--err { background: #FDECEA; color: var(--err); }
.bp-body > .flash { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 5; max-width: 456px; margin: 0 auto; }

.tile-logo { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--accent, #3550FF); color: #FFF; display: inline-grid; place-items: center; font: 800 18px/1 var(--fd); }
.tile-logo--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }
.logo-dot { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE59A, #FFC83D 50%, #E9A814); box-shadow: 0 3px 0 #B27806; display: inline-grid; place-items: center; }
.logo-dot::after { content: ''; width: 15px; height: 15px; border-radius: 50%; background: #1C2BB8; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #D6D5CF; background: #FFF; display: grid; place-items: center; flex: 0 0 auto; }
.avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: #E6E5E0; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }

/* ---------- Сообщения и вход ---------- */
.msg { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.msg > .panel { width: 100%; max-width: 420px; padding: 32px 24px; text-align: center; }
.msg h1 { font-size: 26px; }
.auth { gap: 16px; }
.btn-tg { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 320px; min-height: 52px; padding: 0 20px; border-radius: 14px; background: #2AABEE; color: #FFF !important; font-weight: 600; font-size: 16px; text-decoration: none; }
.btn-tg:hover { background: #229ED9; }
.auth__or { font-size: 13px; color: var(--muted); }
.auth__dev { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px dashed var(--line); }
.auth__fine { font-size: 13px; color: var(--muted); margin: 0; }
.code-form__row { display: flex; gap: 8px; }
.code-form__row input { flex: 1; min-width: 0; }

/* ---------- Карта клиента ---------- */
.cc { max-width: 480px; margin: 0 auto; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.cc__head { display: flex; align-items: center; gap: 12px; }
.cc__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cc__who span { font-size: 14px; color: var(--muted); }
.cc__welcome { display: flex; gap: 10px; align-items: center; background: var(--yellow); border-radius: 16px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.cc__card { background: var(--accent); color: #FFF; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 color-mix(in srgb, var(--accent) 65%, #000); }
.cc__stamps { display: grid; gap: 10px; max-width: 320px; }
.cc__stamps span { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255,255,255,.55); }
.cc__stamps span.on { border: 0; background: radial-gradient(circle at 35% 30%, #FFE08A, #FFC83D 55%, #E9A814); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.cc__note { font-size: 15px; color: rgba(255,255,255,.95); }
.cc__big { font: 800 48px/1 var(--fd); letter-spacing: -0.03em; display: flex; align-items: baseline; gap: 10px; }
.cc__big small { font: 600 16px/1 var(--ft); letter-spacing: 0; opacity: .9; }
.cc__tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; font-size: 12px; }
.cc__tiers i { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin-bottom: 6px; }
.cc__tiers .on i { background: #FFF; }
.cc__qr { background: #FFF; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cc__qr-label { color: var(--text); font-size: 15px; }
.cc__qr-img { width: min(260px, 70vw); }
.cc__qr-img svg { display: block; width: 100%; height: auto; }
.cc__code { font: 700 22px/1 var(--fd); letter-spacing: .12em; }
.cc__home { border: 1px dashed #A3A29C; border-radius: 16px; padding: 12px 14px; }
.cc__home summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cc__home summary::-webkit-details-marker { display: none; }
.cc__home summary > svg { width: 36px; height: 36px; padding: 9px; border-radius: 10px; background: var(--ink); flex: 0 0 auto; }
.cc__home summary span { display: flex; flex-direction: column; line-height: 1.3; }
.cc__home small { color: var(--muted); font-size: 13px; }
.cc__home p { font-size: 14px; color: var(--text); margin: 12px 0 0; }
.cc__history { display: flex; flex-direction: column; }
.cc__history h2 { margin-bottom: 6px; }
.cc__history div, .hist { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cc__history time, .hist time { color: var(--muted); white-space: nowrap; }
.cc__foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding-top: 8px; }

/* ---------- Админка ---------- */
.adm { min-height: 100vh; }
.adm__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: #FFF; border-bottom: 1px solid var(--line); }
.adm__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.adm__brand > span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.adm__brand small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm__open { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--ft); text-decoration: none; white-space: nowrap; color: var(--ink); }
.adm__nav { display: flex; gap: 4px; padding: 8px 12px; background: #FFF; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 4; }
.adm__nav a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; }
.adm__nav a[aria-current="page"] { background: #F0EFEA; color: var(--ink); font-weight: 700; }
.adm__nav a[aria-current="page"] svg { color: var(--accent); }
.adm__main { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.adm__h1 { font-size: 28px; }

@media (max-width: 720px) {
  .adm__nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); border-bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .adm__nav a { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; flex: 1 1 0; min-width: 0; justify-content: center; }
  .adm__nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .adm__nav a[aria-current="page"] { background: none; }
  .adm__main { padding-bottom: 110px; }
}

.stats { display: flex; flex-direction: column; gap: 14px; }
.stats__main { display: flex; align-items: baseline; gap: 10px; }
.stats__main b { font: 800 56px/0.9 var(--fd); letter-spacing: -0.04em; }
.stats__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats__row div { padding-top: 12px; display: flex; flex-direction: column; }
.stats__row div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.stats__row b { font: 800 22px/1.2 var(--fd); }
.stats__row span { font-size: 13px; color: var(--muted); }

.scan-cta { display: flex; align-items: center; gap: 16px; background: var(--accent); color: #FFF !important; text-decoration: none; border-radius: 20px; min-height: 80px; padding: 0 22px; font: 700 18px/1.2 var(--ft); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.scan-cta span { flex: 1; }

.list { display: flex; flex-direction: column; }
.list__head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0 6px; }
.list__head a { font-size: 14px; color: var(--text); }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.row-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.row-item__text small { color: var(--muted); font-size: 13px; }
.notice { display: flex; align-items: center; gap: 12px; border: 1px dashed #A3A29C; border-radius: 16px; padding: 14px 14px 14px 16px; }
.notice > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.notice small { color: var(--muted); font-size: 13px; }
.empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.link-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; border-top: 1px solid var(--line); text-decoration: none; font-weight: 500; }

.scanner { position: relative; background: #161615; border-radius: 22px; aspect-ratio: 1; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; color: #C9C8D6; text-align: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.scanner.is-on video { opacity: 1; }
.scanner__frame { position: relative; width: 62%; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 999px rgba(0,0,0,.35); }
.scanner__hint { position: relative; margin: 0; font-size: 14px; }
.scanner .btn-ink { position: relative; background: #FFF; color: var(--ink) !important; }

.mp { display: flex; flex-direction: column; gap: 16px; }
.mp__who { display: flex; align-items: center; gap: 14px; }
.mp__who > div { display: flex; flex-direction: column; line-height: 1.3; }
.mp__who b { font: 800 22px/1.2 var(--fd); }
.mp__who small { color: var(--muted); font-size: 13px; }
.mp__stamps { display: grid; gap: 6px; }
.mp__stamps span { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #A3A29C; }
.mp__stamps span.on { border: 0; background: var(--accent); }
.mp__note { font-size: 14px; color: var(--text); }
.mp__big { font: 800 44px/1 var(--fd); display: flex; align-items: baseline; gap: 10px; }
.mp__big small { font: 600 15px var(--ft); color: var(--muted); }
.mp__actions { display: flex; flex-direction: column; gap: 10px; }
.mp__tip { margin: 0; font-size: 16px; }
.form-inline { display: flex; flex-direction: column; gap: 8px; }

.search { display: flex; gap: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.choice input { width: 20px; min-height: 0; accent-color: var(--accent); }
.choice span { display: flex; flex-direction: column; line-height: 1.3; }
.choice small { color: var(--muted); font-size: 13px; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; font-size: 14px; }

/* «Внешний вид» */
.adm:has(.look) .adm__main { max-width: 1120px; }
.look { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.look__form { flex: 1 1 420px; min-width: 0; }
.look__preview { flex: 0 0 auto; margin: 0 auto; position: sticky; top: 76px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.look__url { background: #FFF; border-radius: 999px; padding: 8px 14px; font-size: 13px; }
.look__phone { width: 312px; height: 675px; border-radius: 34px; overflow: hidden; box-shadow: 0 0 0 7px var(--ink), 0 24px 48px rgba(0,0,0,.15); }
.look__phone > div { width: 390px; height: 844px; transform: scale(.8); transform-origin: 0 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.photo-opt { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: pointer; }
.photo-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.photo-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-opt:has(input:checked) { box-shadow: 0 0 0 2px #FFF, 0 0 0 4px var(--ink); }
.photo-opt:has(input:focus-visible) { outline: 2px solid var(--accent); }
.photo-opt--upload { border: 1.5px dashed #A3A29C; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 500; background: #FAFAF7; }
.photo-opt--upload input { inset: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-opt--upload.is-loading { opacity: .5; }
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; background: #F0EFEA; border-radius: 12px; }
.seg label { cursor: pointer; font-weight: 500; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; font-size: 14px; text-align: center; }
.seg input:checked + span { background: #FFF; box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.font-wide { font-family: 'Unbounded', sans-serif; } .font-serif { font-family: 'Cormorant', serif; font-size: 17px !important; } .font-grotesk { font-family: 'Golos Text', sans-serif; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches label { cursor: pointer; }
.swatches input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.swatches span { display: block; width: 40px; height: 40px; border-radius: 50%; }
.swatches input:checked + span { box-shadow: 0 0 0 2px #FFF, 0 0 0 4px var(--ink); }
.swatch-custom input { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; border: 1.5px dashed #A3A29C; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; min-height: 0; accent-color: var(--accent); }
.domain { display: flex; border: 1px solid #D9D7CF; border-radius: 12px; overflow: hidden; background: #FAFAF7; }
.domain input { border: 0; border-radius: 0; background: transparent; }
.domain span { display: flex; align-items: center; padding: 0 14px; background: #EEECE5; color: var(--text); border-left: 1px solid #D9D7CF; white-space: nowrap; }

/* Панель платформы */
.app-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.app-row__main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.app-row__main small { color: var(--text); font-size: 13px; }
.app-row__actions { display: flex; gap: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #F0EFEA; }
.badge--new { background: var(--yellow); }
.badge--done { background: #E3F4EA; color: var(--ok); }
.adm:not(:has(.look)) .adm__main:has(.app-row) { max-width: 860px; }

/* Наклейка для печати */
.sticker-page { max-width: 640px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.sticker-page__bar { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.print-sticker { width: 105mm; min-height: 148mm; background: #FFF; border-radius: 6mm; padding: 9mm 8mm; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4mm; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.print-sticker header { display: flex; align-items: center; gap: 3mm; font: 800 6mm/1 var(--fd); }
.print-sticker h1 { font-size: 7.5mm !important; line-height: 1.1; color: var(--accent); }
.print-sticker__offer { margin: 0; font-size: 4.2mm; color: var(--text); }
.print-sticker__qr { width: 62mm; }
.print-sticker__qr svg { width: 100%; height: auto; display: block; }
.print-sticker__how { margin: 0; font-size: 3.8mm; font-weight: 600; }
.print-sticker footer { margin-top: auto; font-size: 3.4mm; color: var(--muted); }
@media print {
  @page { size: A6; margin: 0; }
  body { background: #FFF !important; }
  .no-print { display: none !important; }
  .sticker-page { padding: 0; }
  .print-sticker { box-shadow: none; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
