/* Кабинет ПМ Групп. Сначала телефон: заказчик правит контент с объекта,
   а не сидя за столом. Крупные цели нажатия, шторка снизу, ничего мелкого. */

:root {
  --blue: #2563eb;
  --ink: #0d0d0d;
  --grey: #7e7e7e;
  --line: #e6e6e6;
  --bg: #f6f6f7;
  --red: #b3261e;
  --ease: cubic-bezier(.19,1,.22,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

img { display: block; max-width: 100%; }

/* ── вход ───────────────────────────────────────────────────────────────── */
.login {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: #fff;
}
.login__logo { width: 76px; height: auto; }
.login h1 { margin: 4px 0 12px; font-size: 22px; font-weight: 600; }
.login input { width: 100%; max-width: 320px; }
.login .btn { width: 100%; max-width: 320px; }

/* ── общее ──────────────────────────────────────────────────────────────── */
input, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
textarea { resize: vertical; }

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 0;
  border-radius: 40px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .2s, background-color .2s;
}
.btn:disabled { opacity: .5; }
.btn--main, .btn--pub { background: var(--ink); color: #fff; }
.btn--pub { background: var(--blue); }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--add { background: #fff; color: var(--blue); border: 1px dashed #c9d6f5; margin-top: 12px; }
.btn--del { background: none; color: var(--red); margin-top: 24px; }

.err { color: var(--red); font-size: 14px; margin: 4px 0 0; min-height: 18px; }

/* ── шапка и шаги ───────────────────────────────────────────────────────── */
.app { padding: 16px 16px 40px; max-width: 720px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.top__title { font-size: 24px; font-weight: 600; }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.hint { margin: 12px 0 18px; font-size: 14px; line-height: 1.45; color: var(--grey); }
.hint--back { margin-top: -8px; }

.lnk {
  border: 0; background: none; padding: 0;
  font: inherit; color: var(--blue); cursor: pointer;
}
.lnk--go { font-weight: 600; }
.lnk--warn { color: var(--red); text-decoration: underline; }

/* ── карточки объектов ──────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 10px; }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.card:active { background: #f0f1f3; }
.card__img { width: 64px; height: 80px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--bg); }
.card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.card__type { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue); }
.card__name { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__city { font-size: 13px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__go { color: #c4c4c6; font-size: 24px; flex: 0 0 auto; padding-right: 6px; }

.foot { margin-top: 26px; font-size: 13px; line-height: 1.5; color: var(--grey); }

/* ── шторка правки ──────────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(13,13,13,.4); }
.sheet[hidden] { display: none; }

.sheet__box {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 94svh;
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  background: #fff;
  animation: up .38s var(--ease);
}
@keyframes up { from { transform: translateY(100%); } }

.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.sheet__bar strong { font-size: 16px; font-weight: 600; }

.sheet__body {
  overflow-y: auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shot {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}
.shot img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.shot__hint {
  display: block;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--blue);
  background: #fff;
  border: 1px dashed #c9d6f5;
  border-radius: 0 0 14px 14px;
}

/* ── точки на фото ──────────────────────────────────────────────────────── */
.shot__wrap { position: relative; }
.shot--placing .shot__wrap { cursor: crosshair; outline: 2px solid var(--blue); outline-offset: -2px; }

.dots { position: absolute; inset: 0; }

.dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px; height: 30px;
  padding: 0; border: 0; background: none;
  cursor: pointer;
}
.dot span {
  display: block;
  width: 14px; height: 14px; margin: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 2px 8px rgba(0,0,0,.45);
}
.dot--on span { background: var(--blue); }

.pins { display: flex; flex-direction: column; gap: 10px; }
.pins__head { display: flex; align-items: center; justify-content: space-between; }
.pins__head > span { font-size: 13px; color: var(--grey); }
.pins__hint { margin: 0; font-size: 13px; color: var(--blue); }
.pins__hint[hidden] { display: none; }

.pins__list { display: flex; flex-direction: column; gap: 8px; }

.pin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.pin-row:active { background: #f0f1f3; }
.pin-row__n {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 13px;
}
.pin-row__t { display: flex; flex-direction: column; min-width: 0; }
.pin-row__t b { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-row__t small { color: var(--grey); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.warn {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6e5;
  color: #8a5a00;
  font-size: 13.5px;
  line-height: 1.45;
}
.warn[hidden] { display: none; }

.f { display: flex; flex-direction: column; gap: 7px; }
.f > span { font-size: 13px; color: var(--grey); }

.check { display: flex; align-items: center; gap: 11px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); flex: 0 0 auto; }

/* ── уведомление ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
  animation: up .35s var(--ease);
}
.toast[hidden] { display: none; }
.toast--bad { background: var(--red); }

/* ── экран пошире ───────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .app { padding-top: 32px; }
  .sheet { display: grid; place-items: center; padding: 24px; }
  .sheet__box { position: static; width: 100%; max-width: 520px; border-radius: 18px; max-height: 88svh; }
  @keyframes up { from { transform: translateY(16px); opacity: 0; } }
  .toast { left: auto; right: 24px; max-width: 420px; }
}
