/* «Заявка принята»: макеты 5 и 10, анимация — раздел 5 DESIGN_HANDOFF.md. */

.success {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: view-in .2s ease-out both;
}

/* Прокручиваются только зона и текст: подъём нижней панели в анимации не должен давать полосу прокрутки. */
.success__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@keyframes view-in {
  from { opacity: 0; }
}

.success__zone {
  position: relative;
  flex-shrink: 0;
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--emerald-wash);
  overflow: hidden;
}

.success__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(11, 171, 132, .16);
}

.success__close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1;
}

.is-sheet .success__close {
  top: 24px;
  right: 20px;
}

.success__medal {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 38px;
  background: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 14px 30px -12px rgba(16, 63, 69, .45);
}

.success__halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--emerald);
  opacity: 0;
}

.success__check {
  stroke-dasharray: 34;
  stroke-dashoffset: 0;
}

.success__particle {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.success__body {
  padding: 28px 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.success__title {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -.028em;
  outline: none;
}

.success__text {
  margin-top: 8px;
  max-width: 420px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink2);
}

.success__pill {
  margin-top: 20px;
  height: 36px;
  padding: 0 14px 0 6px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink2);
}

.success__badge {
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--acc);
  color: var(--on-acc);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.receipt {
  margin-top: 28px;
  width: 100%;
  border-radius: 18px;
  background: var(--panel);
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.receipt__row {
  min-height: 52px;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.receipt__row + .receipt__row {
  border-top: 1px solid var(--line);
}

.receipt dt {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--ink3);
}

.receipt__number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}

.copy-button {
  width: 24px;
  height: 24px;
  /* Зона нажатия 24 px, а в раскладке — как иконка 16 px из макета. */
  margin: -4px;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt__value {
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.success__foot {
  flex-shrink: 0;
  padding: 20px 40px;
  background: var(--foot);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Телефон */
.is-sheet .success__body {
  padding: 28px 20px 24px;
}

.is-sheet .success__text {
  max-width: 300px;
}

.success__foot.is-compact {
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-again {
  height: 48px;
}

/* ---------- Анимация (~1,5 с), запуск классом .play ---------- */
.play .success__zone { animation: wash .7s ease-out both; }
.play .success__ring { animation: ring .62s var(--d) cubic-bezier(.2, .8, .2, 1) both; }
.play .success__medal { animation: pop .55s .1s cubic-bezier(.2, .9, .25, 1.15) both; }
.play .success__check { animation: draw .45s .32s cubic-bezier(.65, 0, .35, 1) both; }
.play .success__halo { animation: halo 1.1s .42s ease-out both; }
.play .success__particle { animation: drift .85s var(--d) cubic-bezier(.2, .7, .3, 1) both; }
.play .fx { animation: rise .55s var(--d) cubic-bezier(.2, .8, .2, 1) both; }
.play .success__badge { animation: tick .5s .78s cubic-bezier(.2, .9, .25, 1.2) both; }

@keyframes wash {
  from { background-color: #FFFFFF; }
  to { background-color: var(--emerald-wash); }
}

@keyframes ring {
  from { transform: translate(-50%, -50%) scale(.82); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes pop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes draw {
  from { stroke-dashoffset: 34; }
  to { stroke-dashoffset: 0; }
}

@keyframes halo {
  from { transform: scale(1); opacity: .7; }
  to { transform: scale(1.75); opacity: 0; }
}

@keyframes drift {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1); opacity: 0; }
}

@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes tick {
  from { transform: translateY(6px) scale(.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Невысокий горизонтальный экран: зона с галочкой ниже, чтобы анимация и заголовок были видны вместе. */
@media (orientation: landscape) and (max-height: 500px) {
  .success__zone {
    height: 168px;
  }

  .success__ring:nth-of-type(2) {
    display: none;
  }

  .success__medal {
    width: 64px;
    height: 64px;
  }

  .success__body {
    padding: 18px 28px 20px;
  }

  .success__foot {
    padding: 10px 24px;
  }
}

/* Уменьшенное движение: без анимации, но экран сразу в завершённом виде (галочка нарисована, текст виден). */
@media (prefers-reduced-motion: reduce) {
  .success,
  .play .success__zone,
  .play .success__ring,
  .play .success__medal,
  .play .success__check,
  .play .success__halo,
  .play .success__particle,
  .play .fx,
  .play .success__badge {
    animation: none;
  }
}
