/* Новый вид шага привязки WhatsApp (макет demotest/enter2).
   Используется мобильной витриной (views/mobile/menu.php) в панели
   #am-link-panel и админкой (admin-src, свой скопированный вариант). */

.wal {
  --wal-green: #08a845;
  --wal-green-line: #d7f0de;
  --wal-orange: #fb7a09;
  --wal-shadow: 0 0.38rem 1.5rem rgba(28, 39, 49, 0.055);
}

.wal * { box-sizing: border-box; }

/* Хиро-заголовок/подзаголовок для WhatsApp-шага крупнее, чем общий .am-title/
   .am-subtitle модалки (21px/11px — расчёт на короткие заголовки других шагов).
   Активируется классом .wal-hero-active на общем .am-hero, чтобы не задеть
   вид шага телефона/кода, которые используют те же общие DOM-элементы. */
.am-hero.wal-hero-active .am-title {
  font-size: clamp(1.6rem, 6.2vw, 2.1rem);
  font-weight: 600;
}
.am-hero.wal-hero-active .am-subtitle {
  font-size: clamp(0.86rem, 2.9vw, 1rem);
  line-height: 1.43;
}
/* Иконка крупная (как в макете) сама по себе растягивает строку .am-hero —
   убираем нижний отступ блока (был рассчитан на маленький 90×90 кружок),
   чтобы после иконки не было лишнего пустого поля перед кнопкой «Открыть». */
.am-hero.wal-hero-active {
  padding-bottom: 0;
}

/* Иконка-хиро WhatsApp (hero.png): полупрозрачный блик-подложка позади иконки +
   мягкая тень + сама иконка немного крупнее (бликует за края) своего блока —
   как в макете demotest/enter2 (.enter-hero-art/.enter-hero-image). Класс
   .wal-hero-art переопределяет базовые .am-hero-art (витрина: 160×110px,
   top:-50px, left:10px) / .acm-hero-icon (профиль: 90×90px) из style-main.css —
   составной селектор даёт больший вес, чтобы победить независимо от порядка
   подключения стилей. */
.am-hero-art.wal-hero-art,
.acm-hero-icon.wal-hero-art {
  position: relative;
  width: 10.3rem;
  height: auto;
  min-height: 8.5rem;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wal-hero-art::before {
  content: "";
  position: absolute;
  width: 82%;
  aspect-ratio: 1;
  right: 6%;
  top: 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 44%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.34) 51%, transparent 72%),
    linear-gradient(135deg, rgba(236, 47, 131, 0.1), rgba(251, 122, 9, 0.045));
  filter: blur(0.1px);
}

.wal-hero-art img {
  position: relative;
  z-index: 1;
  width: min(128%, 15.25rem);
  max-width: none;
  height: auto;
  margin: -0.4rem -0.45rem 0 0;
  filter: drop-shadow(0 1.15rem 1.6rem rgba(30, 120, 68, 0.14));
}

/* ── Кнопка «Открыть WhatsApp» ───────────────────────────────────────────── */
.wal-open {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 3rem;
  grid-template-columns: 2.05rem minmax(0, auto) 0.95rem;
  align-items: center;
  justify-content: center;
  column-gap: 0.58rem;
  border: 0;
  border-radius: 0.72rem;
  background: linear-gradient(180deg, #10b553 0%, var(--wal-green) 56%, #04903a 100%);
  color: #fff;
  box-shadow: 0 0.7rem 1.55rem rgba(8, 168, 69, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.wal-open:active {
  transform: translateY(1px) scale(0.992);
  box-shadow: 0 0.45rem 1.1rem rgba(8, 168, 69, 0.16);
}

.wal-open[disabled] { cursor: default; opacity: 0.72; }

.wal-open-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wal-open-icon img { width: 1.48rem; height: 1.48rem; }

.wal-open-text {
  font-size: clamp(1rem, 3.45vw, 1.14rem);
  line-height: 1.15;
  font-weight: 500;
  white-space: nowrap;
}

.wal-open-arrow i { font-size: 1.05rem; line-height: 1; }

.wal-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  margin-top: 0.86rem;
  color: #8d9299;
  font-size: 0.72rem;
  line-height: 1.28;
  font-weight: 400;
}

.wal-trust i { font-size: 0.95rem; line-height: 1; }

/* ── Общая карточка ──────────────────────────────────────────────────────── */
.wal-card {
  border: 1px solid rgba(20, 25, 35, 0.045);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--wal-shadow);
}

/* ── «Проверяем подтверждение» ───────────────────────────────────────────── */
.wal-pending {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-color: var(--wal-green-line);
  background: linear-gradient(135deg, #f3fff6, #fff);
}

.wal-pending.is-visible {
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr);
  gap: 0.72rem;
  align-items: center;
}

.wal-pending-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(8, 168, 69, 0.09);
}

.wal-pending-icon img { width: 1.55rem; height: 1.55rem; }

.wal-pending-title {
  margin: 0;
  color: #232323;
  font-size: 1rem;
  line-height: 1.18;
  font-weight: 600;
}

.wal-pending-text {
  margin: 0.32rem 0 0;
  color: #707783;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 400;
}

.wal-pending-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem 0.7rem;
  margin-top: 0.16rem;
}

.wal-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--wal-green);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

/* «Выбрать другой способ входа» — второй пункт из макета, в исходнике вёл на
   выбор мессенджера заново (см. demotest/enter2: .enter-change-link). */
.wal-change-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #8b929c;
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.wal-timer {
  color: #8b929c;
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 400;
  white-space: nowrap;
}

.wal-timer.is-expired { color: #e05252; }

/* Таймер — отдельной строкой под кнопками (в макете таймера не было вообще,
   это наша функциональная добавка для реального обратного отсчёта заявки). */
.wal-timer-row {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

/* ── Видео-инструкция ────────────────────────────────────────────────────── */
.wal-next {
  display: block;
  margin-top: 1.36rem;
  padding: 0;
  border-color: var(--wal-green-line);
  background:
    radial-gradient(circle at 0% 8%, rgba(8, 168, 69, 0.075), transparent 38%),
    linear-gradient(135deg, rgba(245, 255, 248, 0.98), rgba(255, 255, 255, 0.98));
  overflow: hidden;
}

.wal-next-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  background: #f4fbf6;
}

/* ── «Как это работает» ──────────────────────────────────────────────────── */
.wal-work { margin-top: 1.22rem; }

.wal-work-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.82rem;
  align-items: center;
  color: #20242c;
  font-size: 0.92rem;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.wal-work-title::before,
.wal-work-title::after {
  content: "";
  height: 1px;
  background: rgba(20, 25, 35, 0.08);
}

.wal-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.72rem;
  margin-top: 1.18rem;
}

.wal-step {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.wal-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.58rem;
  left: calc(50% + 2.04rem);
  width: calc(100% - 2.46rem);
  border-top: 1px dotted #d3d9e2;
}

.wal-step-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.52rem;
  min-height: 3.04rem;
}

.wal-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #eef6f0;
  color: #5f6772;
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 500;
}

.wal-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(8, 168, 69, 0.08);
  box-shadow: 0 0.3rem 0.9rem rgba(8, 168, 69, 0.06);
}

.wal-step-icon img { width: 1.72rem; height: 1.72rem; object-fit: contain; }

.wal-step-text {
  margin: 0.62rem 0 0;
  color: #444951;
  font-size: 0.76rem;
  line-height: 1.42;
  font-weight: 400;
}

/* ── Блок безопасности ───────────────────────────────────────────────────── */
.wal-security {
  display: grid;
  grid-template-columns: 2.72rem minmax(0, 1fr);
  gap: 0.68rem;
  align-items: center;
  margin-top: 1.34rem;
  padding: 0.88rem 1rem;
  border: 1px solid rgba(251, 122, 9, 0.08);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 92% 18%, rgba(251, 122, 9, 0.08), transparent 34%),
    linear-gradient(110deg, #fff8ef 0%, #fffaf4 58%, #fff 100%);
}

.wal-security-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.08rem;
  aspect-ratio: 1;
  color: var(--wal-orange);
}

.wal-security-icon i { font-size: 1.85rem; line-height: 1; }

.wal-security-title {
  margin: 0;
  color: #8b4500;
  font-size: 0.86rem;
  line-height: 1.2;
  font-weight: 600;
}

.wal-security-text {
  margin: 0.42rem 0 0;
  color: #6f7785;
  font-size: 0.76rem;
  line-height: 1.42;
  font-weight: 400;
}

@media (max-width: 390px) {
  .wal-steps { gap: 0.42rem; }
  .wal-step:not(:last-child)::after {
    left: calc(50% + 1.78rem);
    width: calc(100% - 2.12rem);
  }
  .wal-step-icon { width: 2.42rem; }
  .wal-step-icon img { width: 1.54rem; height: 1.54rem; }
  .wal-step-text { font-size: 0.68rem; }
}

@media (max-width: 340px) {
  .wal-open {
    min-height: 3.08rem;
    grid-template-columns: 1.9rem minmax(0, auto) 0.8rem;
    column-gap: 0.54rem;
  }
  .wal-open-text { font-size: 0.96rem; }
  .wal-steps { grid-template-columns: 1fr; gap: 1.15rem; }
  .wal-step:not(:last-child)::after { display: none; }
  .wal-step-text { max-width: 13rem; }
  .wal-security { grid-template-columns: 2.5rem minmax(0, 1fr); padding: 0.92rem; }
}
