:root {
  --bg: #EAF2FD;
  --card: #fff;
  --ink: #2E3A59;
  --btn: #3E63C7;
  --btn-deep: #33509E;
  --line: #C1C8E4;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--btn) var(--bg); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--btn); border-radius: 8px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -80px, #F4F8FE 0%, transparent 70%),
    linear-gradient(180deg, #E9F1FD 0%, #EAF2FD 38%, #D3E2F7 100%);
  color: var(--ink);
  font: 17px/1.4 "Segoe UI", sans-serif;
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(120deg, #FFFFFF 0%, #DFEAFC 100%);
  box-shadow: 0 1px 0 rgba(46, 58, 89, 0.06);
}

.mark {
  width: 42px;
  height: 42px;
  color: var(--btn);
  flex: none;
  animation: breathe 2.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(62, 99, 199, 0.35));
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.city {
  margin: 0;
  color: #5B678C;
}

.filters {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-row {
  display: grid;
  gap: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.filter-label svg { width: 18px; height: 18px; color: var(--btn); }

select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:hover, input:hover, textarea:hover {
  border-color: #A8B4D8;
}

select:focus, input:focus, textarea:focus {
  outline: 0;
  border-color: var(--btn);
  box-shadow: 0 0 0 3px rgba(62, 99, 199, 0.22);
}

.list {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.list .hint { grid-column: 1 / -1; }

.card {
  background: linear-gradient(180deg, #fff 0%, #FAFCFF 100%);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 0 rgba(46, 58, 89, 0.06);
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  animation: popin 0.55s cubic-bezier(.22, 1, .36, 1) both;
  transition: transform 0.25s, box-shadow 0.25s;
}

.tile .ghost { margin-top: auto; }

.tile:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 14px 30px rgba(46, 58, 89, 0.16);
}

.card img, .photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #E7EFFB;
  display: block;
  transition: transform 0.4s ease;
}

.tile:hover img { transform: scale(1.06); }

@keyframes popin {
  from { opacity: 0; transform: translateY(28px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.card h2 { margin: 10px 0 4px; font-size: 22px; }

.tile h2,
.tile .facts {
  text-align: center;
}

.tile .about {
  font-size: 15px;
  line-height: 1.45;
  text-align: justify;
}

.facts, .about, .hint { margin: 0 0 8px; }

.facts { color: #5B678C; }

button, .back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--btn);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.ghost {
  width: 100%;
  background: linear-gradient(180deg, #5680E9 0%, var(--btn) 55%, var(--btn-deep) 100%);
  box-shadow: 0 2px 0 rgba(51, 80, 158, 0.35);
  transition: filter 0.2s, transform 0.15s;
}

.ghost:hover { filter: brightness(1.06); }

.ghost:active { transform: translateY(1px); }

.back {
  background: transparent;
  color: var(--ink);
  padding: 0 0 12px;
  box-shadow: none;
}

.back svg { width: 20px; height: 20px; }

form { display: grid; gap: 8px; margin-top: 8px; }

form.rise { animation: rise 0.35s ease both; }

.form-title {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ink);
}

label { display: grid; gap: 4px; font-size: 14px; }

.field-hint {
  font-size: 13px;
  line-height: 1.35;
  color: #5B678C;
  font-weight: 400;
}

.err { min-height: 1.2em; margin: 0; color: #B42318; font-size: 14px; }

.sent {
  margin: 8px 0 0;
  font-weight: 700;
}

.sent.glow {
  animation: warm 1.1s ease;
}

@keyframes warm {
  0% { text-shadow: 0 0 0 rgba(62, 99, 199, 0); }
  40% { text-shadow: 0 0 18px rgba(62, 99, 199, 0.7); }
  100% { text-shadow: 0 0 0 rgba(62, 99, 199, 0); }
}

#card:not(.hidden) .story {
  animation: popin 0.55s cubic-bezier(.22, 1, .36, 1) both;
}

#browser:not(.hidden) {
  animation: fade 0.35s ease;
}

.hidden { display: none !important; }

.sheet h2 { margin-top: 0; }

.sheet {
  animation: rise 0.45s ease both;
}

/* Экран "заявка уходит в приют" перед переходом. */
.send-cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(46, 58, 89, 0.42);
  backdrop-filter: blur(4px);
  animation: fade 0.25s ease both;
}

.send-card {
  width: min(420px, 100%);
  padding: 28px 22px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #FAFCFF 100%);
  box-shadow: 0 18px 40px rgba(34, 54, 110, 0.28);
  text-align: center;
}

.send-spin {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #C1C8E4;
  border-top-color: var(--btn);
  animation: sendspin 0.85s linear infinite;
}

@keyframes sendspin {
  to { transform: rotate(360deg); }
}

.send-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.send-about {
  margin: 0 0 18px;
  color: #5B678C;
  font-size: 15px;
  line-height: 1.45;
}

.send-bar {
  height: 6px;
  border-radius: 999px;
  background: #E7EFFB;
  overflow: hidden;
}

.send-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5680E9, var(--btn-deep));
  animation: sendbar 3s linear forwards;
}

@keyframes sendbar {
  to { width: 100%; }
}

/* Всплывающее окно заявки: шапка и подвал закрыты затемнением. */
.desk-cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: rgba(46, 58, 89, 0.58);
  backdrop-filter: blur(7px);
  animation: fade 0.25s ease both;
}

body.desk-open {
  overflow: hidden;
}

/* Экран приюта: как будто открыли входящую заявку. */
.desk {
  position: relative;
  width: min(440px, 100%);
  margin: auto;
  border-left: 5px solid var(--btn);
  padding: 22px 18px 18px;
  box-shadow: 0 18px 40px rgba(34, 54, 110, 0.3);
}

.desk-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #E7EFFB;
  color: var(--btn-deep);
  cursor: pointer;
}

.desk-close svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
}

.desk-close:hover {
  background: #D3E2F7;
}

.desk-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #E7EFFB;
  color: var(--btn-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.desk-meta {
  margin: 0 0 14px;
  color: #5B678C;
  font-size: 14px;
}

.desk-fields {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: #F4F8FE;
}

.desk-fields .row {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #C1C8E4;
}

.desk-fields .row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.desk-note {
  margin: 0;
  color: #5B678C;
  font-size: 15px;
}

.made {
  position: relative;
  overflow: hidden;
  margin: 36px 0 0;
  padding: 26px 24px 24px;
  border-radius: 22px;
  font-size: 17px;
  color: #fff;
  text-align: left;
  line-height: 1.5;
  background: linear-gradient(150deg, #33509E 0%, #2B458A 52%, #22366E 100%);
  box-shadow: 0 14px 30px rgba(34, 54, 110, 0.34);
  animation: popin 0.7s ease both;
}

/* Мягкий блик в углу, без постоянной анимации. */
.made::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.14), transparent 48%);
  pointer-events: none;
}

.made p {
  position: relative;
  margin: 0;
}

/* Шапка подвала: знак приюта и название. */
.made-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

/* Знак приюта убран из шапки подвала: заголовок и город занимают
   всю ширину, лишний знак слева был пустым местом. */
.made-lead { min-width: 0; }

.made-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
}

/* Подзаголовок шапки подвала: город с иконкой. */
.made-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.made-sub-city {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.made-pin {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.85;
}

/* Три блока контактов, на узком экране в столбик. */
.made-cols {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 20px;
  padding-top: 20px;
}

.made-cell { min-width: 0; }

/* Подпись блока обычным регистром, читается легче капслока. */
.made-cap {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

/* Телефоны: подпись роли и крупный номер. */
.made-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.made-role {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.made-tel {
  display: inline-block;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.made-tel:hover {
  text-decoration-color: #fff;
}

/* Соцсеть с иконкой, чтобы её не спутать с текстом. */
.made-soc {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.made-soc:hover {
  border-color: #fff;
}

.made-soc-icon {
  width: 30px;
  height: 30px;
  flex: none;
  color: #fff;
}

/* Список под ФИО отделяется от него, чтобы не слипался. */
.made-list-dev {
  margin-top: 12px;
}

.made-dev {
  font-size: 18px;
  font-weight: 600;
}

.made-dev-city {
  margin-top: 2px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.78);
}

/* Слоган под именем разработчика. Знака здесь больше нет - он стоит
   в подписи блока, - поэтому это просто строка девиза, а не плашка. */
.made-dev-about {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

/* Подпись "Разработчик МамбаДог" с домиком перед текстом: знак встаёт
   вровень с первой строкой, а не по центру всей подписи. */
.made-cap-dev {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Домик с лапкой чуть крупнее текста: на 15px знак сливался в точку
   и читался как плюс. */
.made-dev-house {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.92;
}

/* На узком экране блоки подвала выстраиваются в одну колонку. */
@media (max-width: 620px) {
  .made-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

/* На самом узком экране знак мешает заголовку, уменьшаем его. */
@media (max-width: 359px) {
  .made { padding: 22px 16px 20px; }
  .made-top { gap: 10px; }
  .made-title { font-size: 18px; }
  .made-tel, .made-soc, .made-dev { font-size: 17px; }
}

.row { margin: 0 0 10px; }
.row b { display: block; font-size: 14px; color: #5B678C; font-weight: 600; }

.story {
  display: grid;
  gap: 12px;
}

.story-text { display: grid; gap: 8px; min-width: 0; }

.page {
  width: min(640px, 100%);
}

.top-text { flex: 1; min-width: 0; }

.go {
  margin-left: auto;
  color: var(--btn);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}

.go:hover { text-decoration: underline; }

.plus {
  margin: 0;
  padding-left: 18px;
}

.plus li { margin: 0 0 8px; }

.shots {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 16px 0 0;
}

.shot-photo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.shot-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #E7EFFB;
  display: block;
}

.bone {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(46, 58, 89, 0.62);
  color: #FFFFFF;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background 0.2s, transform 0.2s;
}

.bone svg { width: 22px; height: 22px; flex: none; }

.bone:hover { background: var(--btn); transform: translateY(-1px); }

.bone:active { transform: translateY(1px); }

.bone-small {
  padding: 7px 11px 7px 8px;
  font-size: 12px;
}

.bone-small svg { width: 24px; height: 24px; }

.shot-photo.donating .bone { opacity: 0; pointer-events: none; }

.donate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  color: #FFFFFF;
  background: linear-gradient(180deg, rgba(46, 58, 89, 0.88), rgba(43, 69, 138, 0.9));
  animation: fade 0.25s ease both;
}

.donate p { margin: 0; }

.donate-lead { font-weight: 700; font-size: 15px; }

.donate-about { font-size: 13px; opacity: 0.9; }

.donate-sums {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.donate-sums:empty { margin: 0; }

.donate-sum {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--btn);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}

.donate-sum:hover { transform: translateY(-2px); filter: brightness(1.04); }

.donate .sent { color: #FFFFFF; }

.donate-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.donate-close:hover { background: rgba(255, 255, 255, 0.32); }

/* Плашка психолога - обычная карточка, тег живёт внутри неё. */
.helper {
  margin: 24px 0 0;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 34px rgba(46, 58, 89, 0.18);
  overflow: hidden;
}

.helper > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}

.helper > summary::-webkit-details-marker { display: none; }

.helper > summary:hover { background: #EFF5FE; }

.helper-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #5680E9, var(--btn-deep));
  color: #FFFFFF;
  font-weight: 700;
}

.helper-face svg {
  width: 24px;
  height: 24px;
  display: block;
}

.helper-tag {
  font-weight: 600;
  white-space: nowrap;
}

/* Стрелка показывает, что карточка раскрывается. */
.helper-arrow {
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex: none;
  color: var(--btn);
  transition: transform 0.2s;
}

.helper[open] .helper-arrow { transform: rotate(180deg); }

/* Внутри карточки - воздух по всему периметру. */
.helper-body {
  padding: 4px 18px 20px;
  border-top: 1px solid var(--line);
  animation: rise 0.3s ease both;
}

.helper-body h2 {
  margin: 16px 0 10px;
  font-size: 18px;
  line-height: 1.3;
}

.helper-body p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.5;
}

/* Проблемы списком, чтобы читались с одного взгляда. */
.helper-list {
  margin: 0 0 12px;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.5;
}

.helper-list li { margin-bottom: 4px; }

/* Запись: заголовок, заметная кнопка-телефон, подсказка под ней.
   На узком экране прижимаем к левому краю, на широком - по центру,
   иначе полоса растягивается и справа остается пустое место. */
.helper-call {
  margin-top: 16px;
  padding: 18px 16px;
  border-radius: 14px;
  background: #EFF5FE;
  text-align: left;
}

@media (min-width: 620px) {
  .helper-call { text-align: center; }
}

.helper-call-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.helper-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--btn);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.helper-call-btn:hover {
  background: var(--btn-deep);
  transform: translateY(-1px);
}

.helper-call-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.helper-call-hint {
  margin: 10px 0 0;
  font-size: 14px;
  color: #5B678C;
}

.shot {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  animation: popin 0.5s cubic-bezier(.22, 1, .36, 1) both;
}

.shot:nth-child(1) { animation-delay: 0.05s; }
.shot:nth-child(2) { animation-delay: 0.1s; }
.shot:nth-child(3) { animation-delay: 0.15s; }
.shot:nth-child(4) { animation-delay: 0.2s; }
.shot:nth-child(5) { animation-delay: 0.25s; }
.shot:nth-child(6) { animation-delay: 0.3s; }
.shot:nth-child(7) { animation-delay: 0.35s; }
.shot:nth-child(8) { animation-delay: 0.4s; }
.shot:nth-child(9) { animation-delay: 0.45s; }
.shot:nth-child(10) { animation-delay: 0.5s; }

.shot img {
  transition: transform 0.4s ease;
}

.shot:hover img { transform: scale(1.05); }

.block {
  margin-bottom: 16px;
  animation: popin 0.5s ease both;
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.shot figcaption {
  margin: 8px 4px 0;
  font-size: 14px;
  color: #5B678C;
}

.block h2 { margin: 0 0 10px; font-size: 22px; }

/* Узкий экран: длинное имя приюта не давит на "О приюте".
   Заголовок мельче, ссылка уходит на свою строку справа. */
@media (max-width: 560px) {
  .top {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .top .mark {
    width: 34px;
    height: 34px;
  }
  .top h1 {
    font-size: 18px;
    line-height: 1.2;
  }
  .top .city { font-size: 13px; }
  .go {
    flex: 0 0 100%;
    margin-left: 0;
    margin-top: 2px;
    text-align: right;
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .top h1 { font-size: 16px; }
}

@media (min-width: 700px) {
  .wrap { padding: 24px 28px 48px; }
  .filter-row { grid-template-columns: repeat(3, 1fr); }
  .list { grid-template-columns: repeat(2, 1fr); }
  .shots { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .list { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .shots { grid-template-columns: repeat(3, 1fr); }
  .story {
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: start;
    padding: 16px;
  }
  .story img {
    aspect-ratio: 4 / 3;
  }
}
