:root {
  --bg-image: url("bg.jpg");
  --text: #f2f2f2;
  --hint: #9a9aa1;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(8, 8, 10, 0.46);
  --glass-strong: rgba(10, 10, 12, 0.82);
  --field: rgba(255, 255, 255, 0.05);
  --accent: #f5f5f5;
  --accent-text: #0a0a0a;
  --danger: #ff5d5d;
  --ok: #7ee2a8;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #000; }
body { background: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }

/* фон: картинка + затемнение, закреплён и на iOS */
body::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background: var(--bg-image) center 30% / cover no-repeat, #000; filter: brightness(1.15) contrast(1.05); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(120% 60% at 50% 38%, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.7) 100%),
              linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.1) 35%, rgba(0,0,0,.6) 100%); }

#app { max-width: 640px; margin: 0 auto; padding: 14px 14px calc(100px + env(safe-area-inset-bottom)); }
.loading { padding: 80px 0; text-align: center; color: var(--hint); letter-spacing: .04em; }

/* шапка */
header.brand { display: flex; align-items: center; gap: 14px; padding: 18px 4px 22px; }
header.brand img, header.brand .logo-ph { width: 54px; height: 54px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.6); }
header.brand .logo-ph { background: #111; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; }
header.brand h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .02em; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
header.brand p { margin: 3px 0 0; color: #c9c9ce; font-size: 13px; text-shadow: 0 1px 10px rgba(0,0,0,.9); }

/* карточки-«стёкла» */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; backdrop-filter: blur(14px) saturate(110%); -webkit-backdrop-filter: blur(14px) saturate(110%);
  box-shadow: 0 10px 40px rgba(0,0,0,.35); animation: rise .35s ease both; }
.view .card:nth-child(2) { animation-delay: .04s; }
.view .card:nth-child(3) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.card h3 { margin: 18px 0 8px; font-size: 12px; color: var(--hint); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--hint); font-size: 13px; }
.pre { white-space: pre-wrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row h2 { margin: 0; }
ol.muted { padding-left: 18px; margin: 10px 0 0; }
ol.muted li { margin: 4px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 17px; font-weight: 700; }
.stat span { color: var(--hint); font-size: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); color: var(--hint); }
.badge.ok { color: var(--ok); border-color: rgba(126,226,168,.35); background: rgba(126,226,168,.08); }
.badge.bad { color: var(--danger); border-color: rgba(255,93,93,.35); background: rgba(255,93,93,.08); }

/* кнопки */
button, .btn { appearance: none; border: 0; border-radius: 13px; padding: 13px 16px; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--accent-text); cursor: pointer; width: 100%; letter-spacing: .01em;
  transition: transform .12s ease, opacity .2s ease, background .2s ease; }
button:active { transform: scale(.98); }
button.secondary { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--hint); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); }
button.small { width: auto; padding: 8px 13px; font-size: 13px; border-radius: 11px; }
button:disabled { opacity: .35; }
.btns { display: flex; gap: 8px; margin-top: 12px; }
.btns > * { flex: 1; }

/* документы */
button.doc { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(255,255,255,.04);
  color: var(--text); border: 1px solid var(--line); font-weight: 600; margin-top: 8px; }
button.doc b { flex: 1; font-weight: 600; }
button.doc i { font-style: normal; color: var(--hint); font-size: 20px; line-height: 1; }
.consent { padding: 20px 16px; }
.consent .check { align-items: flex-start; margin: 16px 0; font-size: 13px; color: #d4d4d8; }
.consent .check input { margin-top: 3px; }

/* поля */
label { display: block; margin: 12px 0 5px; font-size: 13px; color: var(--hint); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  font: inherit; background: var(--field); color: var(--text); outline: none; transition: border-color .2s; }
input:focus, textarea:focus, select:focus { border-color: rgba(255,255,255,.35); }
select option { background: #111; }
textarea { min-height: 96px; resize: vertical; }
textarea.big { min-height: 380px; font-size: 13px; line-height: 1.45; }
label.file { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 9px 13px;
  border-radius: 11px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; font-weight: 700; cursor: pointer; }
label.file input { display: none; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; flex: none; accent-color: #fff; }
.inline { display: flex; gap: 8px; }
.inline > * { flex: 1; min-width: 0; }

/* тарифы */
.plan { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 15px; padding: 14px; margin-bottom: 8px; }
.plan .price { font-size: 22px; font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 40px; padding: 8px; }
.stepper b { min-width: 24px; text-align: center; font-size: 18px; }
.seg { display: flex; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 3px; }
.seg button { background: transparent; color: var(--hint); padding: 9px; font-weight: 600; }
.seg button.on { background: rgba(255,255,255,.12); color: var(--text); }
#qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; margin: 12px auto; width: fit-content; }

/* админка */
.images { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.images > div { display: flex; flex-direction: column; gap: 6px; }
.thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.thumb.tall { width: 72px; height: 100px; }
.thumb.empty { display: grid; place-items: center; color: var(--hint); font-size: 12px; background: var(--field); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td { padding: 4px 2px; vertical-align: top; }
td input { padding: 8px; }
.user-row { border-top: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; color: var(--hint); font-size: 13px; }

/* нижнее меню */
nav.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(612px, calc(100% - 20px)); display: flex; gap: 4px; padding: 6px; z-index: 5;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 20px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
nav.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: transparent;
  color: var(--hint); font-size: 11px; font-weight: 600; padding: 7px 2px; border-radius: 14px; }
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button.on { color: #fff; background: rgba(255,255,255,.1); }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(255,255,255,.95); color: #0a0a0a; font-weight: 600; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; z-index: 10; }
#toast.show { opacity: 1; }
