/* ============================================================
   /purchase/ — страница отдела закупок (только RU).
   Дополняет styles.css: шапка, подвал, .container, .btn, .field,
   .field-consent, .form-note берутся оттуда, здесь только то,
   чего на остальном сайте нет — hero страницы, карточка формы,
   зоны загрузки файлов и экран «отправлено».
   ============================================================ */

/* ---------- hero ----------
   Компактная секция под шапкой, высота по содержимому. Единственное, что взято
   с hero главной, — цвета: та же радиальная зелёная подложка и золотой блик
   из .hero-decor. Фон-фото и растяжку на весь экран пробовали и откатили:
   на странице с формой первый экран должен подводить к форме, а не занимать
   его целиком. */
.purchase-hero {
  position: relative;
  padding: 54px 0 60px;
  background: radial-gradient(120% 130% at 80% 10%, #1c4735 0%, #12352a 55%, #0f2c23 100%);
  color: #fff;
  overflow: hidden
}

/* золотой блик — тот же приём, что в .hero-decor на главной */
.purchase-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(214, 171, 99, .16), transparent 70%) 88% 18%/420px 420px no-repeat
}

.purchase-hero > .container {
  position: relative;
  z-index: 1
}

.ph-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold)
}

.ph-eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--gold-2)
}

.purchase-hero h1 {
  font-family: 'Montserrat', 'Montserrat-fb', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.08;
  margin-top: 18px
}

.purchase-hero h1 em {
  color: var(--gold);
  font-style: normal
}

.ph-lead {
  max-width: 62ch;
  margin-top: 20px;
  font-size: clamp(15px, 1.7vw, 17px);
  color: #d5ddd6;
  line-height: 1.7
}

/* Полоса «01 — 02 — 03». Разделители — border, а не отдельные элементы:
   на мобильном grid схлопывается в колонку и они сами становятся
   горизонтальными (см. медиазапрос ниже). */
.ph-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 38px;
  border-top: 1px solid rgba(233, 213, 168, .2);
  list-style: none
}

.ph-steps li {
  padding: 20px 22px 0;
  border-inline-end: 1px solid rgba(233, 213, 168, .2)
}

.ph-steps li:first-child {
  padding-inline-start: 0
}

.ph-steps li:last-child {
  border-inline-end: 0
}

.phs-n {
  display: block;
  font-family: 'Montserrat', 'Montserrat-fb', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .06em;
  color: var(--gold)
}

.ph-steps p {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #c3cec4
}

/* ---------- карточка формы ---------- */
.offer-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px;
  box-shadow: var(--shadow)
}

.offer-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0
}

/* Правило класса перебивает браузерное [hidden]{display:none}, и после
   успешной отправки форма осталась бы на экране рядом с «Спасибо».
   Скрываем явно — JS переключает именно атрибут. */
.offer-form[hidden] {
  display: none
}

.offer-head {
  grid-column: 1/-1
}

.offer-head h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--green-900)
}

.offer-head p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2)
}

.req {
  color: var(--gold-2)
}

.field-wide {
  grid-column: 1/-1
}

.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  background: #fff;
  resize: vertical
}

.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 171, 99, .25)
}

.field-hint {
  font-size: 12px;
  color: #6f7d75
}

/* Поле, не прошедшее проверку: подсвечиваем только после попытки отправки,
   поэтому класс вешает JS, а не :invalid — иначе пустая форма красная сразу. */
.field .is-bad {
  border-color: #b03a2e;
  box-shadow: 0 0 0 3px rgba(176, 58, 46, .14)
}

.offer-form .btn-full {
  grid-column: 1/-1;
  margin-top: 4px
}

.offer-legal {
  grid-column: 1/-1;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6f7d75
}

.offer-form .form-note {
  grid-column: 1/-1
}

/* Базовая .form-note в styles.css рассчитана на тёмную карточку главной
   (зелёный фон, светлое золото на нём), а форма закупок стоит на белой —
   там тот же стиль читался как коричневое инородное пятно. Переопределяем
   под светлый фон: мягкая розовая плашка, красная полоса слева и тёмно-красный
   текст (контраст 7.87 к фону плашки). Красный здесь уместен — это
   единственное место на странице, где что-то пошло не так. */
.offer-form .form-note.form-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fdecea;
  border: 1px solid #f2bab2;
  border-inline-start: 3px solid #c0392b;
  color: #8a2318;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55
}

/* ОБЯЗАТЕЛЬНО: display:flex выше перебивает браузерное [hidden]{display:none},
   и пустая плашка висела бы на форме всегда. На этих же граблях проект уже
   стоял с .offer-form{display:grid} — тогда форма оставалась на экране рядом
   с экраном «Предложение отправлено». Любое новое правило display на
   скрываемом узле требует такой же строки. */
.offer-form .form-note.form-error[hidden] {
  display: none
}

/* Восклицательный знак в кружке — чтобы плашка читалась как ошибка ещё до
   того, как текст прочитан. Рисуем через ::before, разметку не трогаем. */
.offer-form .form-note.form-error::before {
  content: "!";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center
}

/* ---------- зоны загрузки ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 20px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fcfaf5;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--gold);
  background: #fbf6ea;
  outline: none
}

.dropzone.is-drag {
  border-color: var(--gold);
  border-style: solid;
  background: #f7edd8
}

.dropzone svg {
  width: 26px;
  height: 26px;
  color: var(--gold-2)
}

.dz-main {
  font-size: 14px;
  color: var(--ink-2)
}

.dz-main b {
  color: var(--green-800)
}

.dz-sub {
  font-size: 12px;
  color: #6f7d75;
  line-height: 1.5
}

/* Нативный input прячем визуально, но оставляем в потоке фокусируемым —
   display:none выключил бы его из табуляции и с клавиатуры файл не выбрать. */
.dropzone input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0
}

/* padding/margin у <ul> сбрасываем явно: браузерный padding-inline-start
   в 40 px сдвигал карточки вправо и не давал им дотянуться до края зоны
   загрузки — список выглядел смещённым относительно всего остального. */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0
}

.file-list:empty {
  display: none
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px
}

/* Значок с расширением. Строка из одного имени и размера читалась как
   сплошная простыня — квадратик слева даёт глазу опору и сразу говорит,
   что именно приложено. Текст расширения ставит JS. */
.file-item .fi-ext {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--cream-2);
  color: var(--green-700);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase
}

.file-item .fi-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2)
}

.file-item .fi-size {
  flex: 0 0 auto;
  font-size: 12px;
  color: #6f7d75;
  font-variant-numeric: tabular-nums
}

.file-item .fi-del {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--green-800);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s
}

.file-item .fi-del:hover {
  background: #fdecea;
  color: #c0392b
}

/* Плашка ошибки под конкретной зоной загрузки. Стили наследует от
   .form-note.form-error выше, здесь только привязка к списку файлов. */
.zone-error {
  margin-top: 8px
}

.file-item.is-bad {
  border-color: #f2bab2;
  background: #fdecea
}

.file-item.is-bad .fi-ext {
  background: #f7d2cd;
  color: #8a2318
}

.file-item.is-bad .fi-size {
  color: #b03a2e
}

/* ---------- прогресс отправки ---------- */
.upload-progress {
  grid-column: 1/-1
}

.up-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--cream-2);
  overflow: hidden
}

.up-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--gold);
  transition: width .2s ease
}

.up-text {
  margin-top: 8px;
  font-size: 12.5px;
  color: #6f7d75;
  font-variant-numeric: tabular-nums
}

/* ---------- экран «отправлено» ---------- */
.offer-ok {
  text-align: center;
  padding: 26px 0
}

.offer-ok .ok-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--green-800);
  color: var(--gold);
  margin-bottom: 18px
}

.offer-ok .ok-ic svg {
  width: 28px;
  height: 28px
}

.offer-ok h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--green-900)
}

.offer-ok p {
  max-width: 52ch;
  margin: 10px auto 0;
  color: var(--ink-2)
}

/* ---------- карточки под формой ---------- */
.offer-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 22px
}

.oi-card {
  background: var(--green-900);
  color: #d9e2db;
  border-radius: 14px;
  padding: 22px 24px
}

.oi-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 10px
}

.oi-card h3 svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto
}

.oi-card p {
  font-size: 14px;
  line-height: 1.65
}

.oi-card a {
  color: var(--gold-light);
  text-decoration: underline
}

.oi-muted {
  color: #9fb0a3;
  font-size: 12.5px
}

/* ---------- мобильное ---------- */
/* Десктоп: карточки выстраиваются в строку и переносятся, ширина каждой —
   по длине имени. В колонку по одной они растягивались на всю ширину формы
   и при трёх-четырёх файлах занимали пол-экрана впустую.
   Порог тот же, что у перехода формы в одну колонку (max-width:760px ниже):
   в одноколоночной раскладке места на строку уже нет, там остаётся столбик. */
@media(min-width:761px) {
  .file-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px
  }

  .file-item {
    flex: 0 1 auto;
    max-width: 100%
  }

  /* Имя больше не растягивает карточку: сжимается по содержимому, но не длиннее
     34 символов — иначе одно длинное имя занимало бы всю строку и смысл
     раскладки терялся. Что не влезло, обрезается многоточием, полное имя
     остаётся в title. */
  .file-item .fi-name {
    flex: 0 1 auto;
    max-width: 34ch
  }
}

@media(max-width:760px) {
  .ph-steps {
    grid-template-columns: 1fr
  }

  .ph-steps li {
    padding: 16px 0;
    border-inline-end: 0;
    border-bottom: 1px solid rgba(233, 213, 168, .2)
  }

  .ph-steps li:last-child {
    border-bottom: 0;
    padding-bottom: 0
  }

  .offer-card {
    padding: 22px 18px
  }

  .offer-form {
    grid-template-columns: 1fr
  }
}

@media(max-width:640px) {

  /* 16px — порог, ниже которого iOS Safari зумит страницу при фокусе в поле
     и обратно уже не отъезжает. Только на узких экранах: на десктопе
     сохраняем типографику остального сайта. */
  .offer-form input,
  .offer-form textarea {
    font-size: 16px
  }

  .purchase-hero {
    padding: 40px 0 44px
  }

  .dropzone {
    padding: 20px 14px
  }
}
