/* Диалог и контейнер */
.modal__dialog {
  width: min(92vw, 600px);
  border-radius: 14px;
  padding: 18px 18px 16px;
  background: var(--clr-surface);
}

/* Базовая сетка */
.fos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 14px;
}
.fos__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fos__row--full {
  grid-column: 1 / -1;
} /* textarea – на всю строку */

/* Поля */
.modal__dialog,
.modal__dialog * {
  box-sizing: border-box;
}
.fos__row input,
.fos__row textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--clr-border, #e5e5e5);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  background: var(--clr-surface);
  color: var(--clr-text);
}
.fos__row input {
  height: 44px;
}
.fos__row textarea {
  min-height: 120px;
  resize: vertical;
}

/* Ряд действий под полями */
.fos__actions {
  grid-column: 1 / -1; /* всегда на всю ширину */
  display: flex;
  align-items: center;
  justify-content: space-between; /* кнопка слева, иконки справа */
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.fos__actions .btn {
  height: 44px;
  border-radius: 10px;
  padding: 0 16px;
}

/* Кнопки мессенджеров с круглыми PNG-иконками */
.fos__im {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* брендовые цвета (как есть), но вынесены в токены */
:root {
  --im-tg: #229ed9;
  --im-wa: #25d366;
}

.im {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--btn-fg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.im:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}
.im--tg {
  background: var(--im-tg);
}
.im--wa {
  background: var(--im-wa);
}

.im__ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--btn-fg) 18%, transparent 82%);
  display: grid;
  place-items: center;
  flex: 0 0 28px;
}
.im__ico img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}

/* Две колонки на широкой ширине */
@media (min-width: 640px) {
  .fos {
    grid-template-columns: 1fr 1fr;
  }
  .fos__row--half {
    grid-column: span 1;
  }
  .fos__row--full {
    grid-column: 1 / -1;
  }
}

/* Центровка кнопок в модалке на мобильных */
@media (max-width: 639.98px) {
  .fos__actions {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }

  .fos__actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .fos__im {
    justify-content: center;
  }

  .im {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

.fos__success {
  margin-top: 20px;
}
