/* Раскладка и компоненты. Цвета, шрифт и скругления берутся из brand/brand.css. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ---------- шапка с логотипом ---------- */

.brandbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
}
.brandlink {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brandlogo { height: var(--logo-height); width: auto; display: block; }
.brandname { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brandname:empty { display: none; }

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px calc(16px + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

.screen { display: flex; flex-direction: column; gap: 14px; }
[hidden] { display: none !important; }

h1 { font-size: 28px; line-height: 1.18; margin: 4px 0 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0; }
.hero { display: flex; flex-direction: column; gap: 10px; }
.lead { color: var(--muted); font-size: 17px; }
.fine { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* ---------- шаги на главной ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}
.step-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.step-text { display: flex; flex-direction: column; }
.step-text small { color: var(--muted); font-size: 14px; line-height: 1.35; }

/* ---------- карточки и кнопки ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  min-height: 52px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  width: 100%;
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-contrast);
  box-shadow: 0 8px 20px var(--brand-shadow);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }

.btn.secondary {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn.secondary:hover:not(:disabled) { background: var(--brand-soft); }

.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }

.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .tab:focus-visible, .brandlink:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.row { display: flex; gap: 8px; }
.row .btn { width: auto; flex: 0 0 auto; }
.grid { display: grid; gap: 8px; }

input[type="text"], textarea {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit; /* 16px: iOS не приближает страницу при фокусе */
}
input[type="text"]:focus, textarea:focus { border-color: var(--brand); }
textarea { resize: vertical; margin-bottom: 8px; }

.qr {
  width: min(78vw, 300px);
  aspect-ratio: 1;
  margin: 4px auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}
.qr svg { display: block; width: 100%; height: 100%; }

.summary { font-weight: 600; }
.summary.ok { color: var(--ok); }
.error { color: var(--danger); }

details { color: var(--muted); font-size: 14px; }
details summary { cursor: pointer; color: var(--brand); margin: 4px 0; font-weight: 600; }
details p { margin-top: 8px; }
.safe ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

progress { width: 100%; height: 10px; accent-color: var(--brand); }

/* ---------- галочка «Показать все контакты» ---------- */

.check { flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.check-text { display: flex; flex-direction: column; gap: 4px; }
.check-text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.check input:disabled + .check-text { opacity: .6; }

/* ---------- вкладки результата ---------- */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.tab {
  appearance: none;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-contrast); }
.panel { display: flex; flex-direction: column; gap: 10px; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.people li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.people .row2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: 999px;
  padding: 1px 8px;
}
.people .name { font-weight: 700; }
.people .phone { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- подвал ---------- */

.footer { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 24px; text-align: center; }
.footer-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
