/* =========================================================
   Фрезерная обработка на ЧПУ — страница заявки
   Десктоп (≥1100px): один экран без прокрутки, фото на фоне.
   Планшет / мобильный (<1100px): фото сверху, форма ниже.
   ========================================================= */

:root {
  --accent: #FF6B1A;
  --accent-hover: #FF8A45;
  --bg: #0c0c0e;
  --card: rgba(18, 18, 20, 0.8);
  --card-solid: #161618;
  --text: #F4F2EE;
  --text-2: #D6D2CB;
  --text-3: #BDB8B0;
  --text-4: #A9A49C;
  --muted: #8E8981;
  --line: rgba(255, 255, 255, 0.16);
  --line-2: rgba(255, 255, 255, 0.1);
  --field: rgba(255, 255, 255, 0.06);
  --field-focus: rgba(255, 255, 255, 0.09);
  --on-accent: #141414;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --radius-card: 22px;
  --pad-x: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.accent { color: var(--accent); }

/* ---------- Каркас ---------- */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px var(--pad-x) 18px;
  overflow: hidden;
  isolation: isolate;
}

.page__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.page__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}
/* широкое фото — для десктопа, вертикальное — для телефона */
.page__bg .bg-tall { display: none; }
.page__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,12,.94) 0%, rgba(10,10,12,.82) 42%, rgba(10,10,12,.5) 100%);
}

/* ---------- Шапка ---------- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 40px;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo svg { color: var(--accent); flex-shrink: 0; }
.logo__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .02em;
}

.nav { display: flex; gap: 36px; font-size: 14px; font-weight: 500; }

.header__contacts { display: flex; align-items: center; gap: 24px; }
.header__phone { font-size: 15px; font-weight: 700; }
.header__mail { font-size: 14px; color: var(--text-3); }

.header__call {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  align-items: center;
  justify-content: center;
}

/* ---------- Основная часть ---------- */

.main {
  flex: 1;
  display: flex;
  gap: 48px;
  align-items: stretch;
  min-height: 0;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 0 0;
}
.hero__top { display: flex; flex-direction: column; gap: 22px; }

.kicker {
  margin: 0;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2);
}
.kicker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 3.5vw, 54px);
  line-height: 1.08;
  letter-spacing: -.01em;
}

.hero__lead {
  margin: 0;
  max-width: 580px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
}

.steps {
  margin: 0; padding: 0; list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 780px;
}
.steps li {
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.steps__num { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--accent); }
.steps__text { font-size: 13.5px; line-height: 1.4; font-weight: 600; }

/* ---------- Карточка формы ---------- */

.card {
  width: 710px;
  flex-shrink: 0;
  align-self: center;
  padding: 22px 36px;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.form { display: flex; flex-direction: column; gap: 12px; }

.form__head { display: flex; flex-direction: column; gap: 6px; }
.form__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
}
.form__sub { margin: 0; font-size: 14px; color: var(--text-4); }

.group { margin: 0; padding: 0; border: 0; min-width: 0; }
.group > .label { padding: 0; margin-bottom: 6px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-3);
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font: 500 14px var(--font-body);
  outline: none;
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); background: var(--field-focus); }
.input.is-invalid { border-color: #F2555A; }

.input--area {
  height: 64px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}

.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select select option { color: #141414; }
.select::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -6px;
  border-right: 1.6px solid var(--text-3);
  border-bottom: 1.6px solid var(--text-3);
  transform: rotate(45deg);
  pointer-events: none;
}

/* Чипы (радио / чекбоксы) */
.seg { display: flex; gap: 6px; }
.seg .chip { flex: 1 1 0; justify-content: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font: 600 14px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: rgba(255,255,255,.35); }
.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* запасной вариант для браузеров без :has — класс ставит JS */
.chip.is-checked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Файлы */
.file {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255,255,255,.26);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.file:hover, .file:focus-within { border-color: var(--accent); }
.file svg { color: var(--accent); flex-shrink: 0; }
.file__title { flex: 1; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__hint { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Низ формы */
.form__foot { display: flex; align-items: center; gap: 20px; margin-top: 2px; }

.check {
  flex: 1;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; line-height: 1.4;
  color: var(--text-4);
  cursor: pointer;
}
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.check a { text-decoration: underline; text-underline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px;
  padding: 0 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 15px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.25); }

.form__error { margin: 0; font-size: 13px; color: #FF8A8E; }

/* Успех */
.success {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
  padding: 80px 8px;
}
.success[hidden] { display: none; }
.success svg { color: var(--accent); }
.success__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.25; }
.success__text { margin: 0; max-width: 400px; font-size: 16px; line-height: 1.55; color: var(--text-3); }

/* =========================================================
   Планшет и мобильный (<1100px)
   ========================================================= */
@media (max-width: 1099px) {
  :root { --pad-x: 20px; }

  .page { padding: 16px 0 24px; gap: 0; min-height: 0; }

  .page__bg { bottom: auto; height: 470px; }
  .page__bg img { object-position: 50% 35%; transform: none; }
  .page__bg .bg-wide { display: none; }
  .page__bg .bg-tall { display: block; }
  .page__bg::after {
    background: linear-gradient(180deg, rgba(10,10,12,.7) 0%, rgba(10,10,12,.55) 40%, var(--bg) 100%);
  }

  .header { padding: 0 var(--pad-x); min-height: 44px; }
  .logo svg { width: 30px; height: 30px; }
  .logo__text { font-size: 14px; }
  .nav, .header__contacts { display: none; }
  .header__call { display: inline-flex; }

  .main { flex-direction: column; gap: 0; }

  .hero { padding: 0 var(--pad-x); min-height: 410px; justify-content: flex-end; gap: 0; }
  .hero__top { gap: 16px; padding-bottom: 28px; }
  .kicker { font-size: 11px; gap: 8px; }
  .kicker__dot { width: 7px; height: 7px; }
  .hero__title { font-size: 30px; line-height: 1.12; }
  .br-desktop { display: none; }
  .hero__lead { font-size: 15px; line-height: 1.5; }

  .steps { display: none; }

  .card {
    width: auto;
    align-self: stretch;
    margin: 0 12px;
    padding: 24px 18px;
    border-radius: 20px;
    background: var(--card-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .form { gap: 18px; }
  .form__title { font-size: 22px; }

  .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .seg .chip { height: 44px; }

  .grid { grid-template-columns: 1fr; }

  /* 16px в полях — чтобы iOS не зумил страницу при фокусе */
  .input { height: 48px; font-size: 16px; }
  .input--area { height: 88px; }

  .file__hint { font-size: 11px; }

  .form__foot { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 4px; }
  .btn { width: 100%; }

  .success { padding: 40px 0; }
}

/* Планшет: форма по центру, не растягиваем на всю ширину */
@media (min-width: 640px) and (max-width: 1099px) {
  .hero { max-width: 640px; margin: 0 auto; width: 100%; }
  .card { width: 100%; max-width: 600px; margin: 0 auto; padding: 32px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { display: flex; }
  .hero__title { font-size: 40px; }
}


.form[hidden] { display: none; }
.lgA { fill: #F4F2EE; }

/* ── Низкие окна: масштабируем страницу целиком ── */
/* ── Крупный десктоп: базовый масштаб как в макете ── */
@media (min-width: 1100px) {
  body { zoom: 1.15; }
  .page { min-height: calc(100vh / 1.15); min-height: calc(100svh / 1.15); }
}
@media (min-width: 1100px) and (max-height: 980px) {
  body { zoom: 1; }
  .page { min-height: 100vh; min-height: 100svh; }
}
@media (min-width: 1100px) and (max-height: 860px) {
  body { zoom: .9; }
  .page { min-height: calc(100vh / .9); min-height: calc(100svh / .9); }
}
@media (min-width: 1100px) and (max-height: 700px) {
  body { zoom: .8; }
  .page { min-height: calc(100vh / .8); min-height: calc(100svh / .8); }
}
@media (min-width: 1100px) and (max-height: 620px) {
  body { zoom: .7; }
  .page { min-height: calc(100vh / .7); min-height: calc(100svh / .7); }
}
@media (min-width: 1100px) and (max-height: 540px) {
  body { zoom: .62; }
  .page { min-height: calc(100vh / .62); min-height: calc(100svh / .62); }
}
