/* =========================================================
   Заявка на литьё — страница по шаблону delta.online
   (teploizolyaciya-trub: последняя версия формы).
   Десктоп (≥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; }
.nav a.is-here { color: var(--accent); }
.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); }
.hero__more {
  display: inline-block; align-self: flex-start; margin-top: 2px;
  font-size: 15px; font-weight: 700; color: var(--accent);
  text-decoration: underline; text-underline-offset: 4px;
}
.hero__more:hover { color: var(--accent-hover); }
.hero__more svg { display: inline-block; vertical-align: -3px; margin-left: 2px; }

.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[hidden] { display: none; }
.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; }
.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; }
  .input { height: 48px; font-size: 16px; }   /* 16px — чтобы iOS не зумил при фокусе */
  .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; }
}

/* ---------- Десктоп: плотнее и крупнее ---------- */
@media (min-width: 1100px) {
  body { zoom: 1.15; }
  .page { min-height: calc(100vh / 1.15); min-height: calc(100svh / 1.15); }
  .nav { font-size: 15px; }
  .hero__top { gap: 20px; }
  .hero__lead { font-size: 20px; line-height: 1.5; max-width: 620px; }
  .steps__text { font-size: 14.5px; }
  .card { padding: 18px 36px 20px; }
  .form { gap: 10px; }
  .form__head { gap: 4px; }
  .form__title { font-size: 24px; }
  .form__sub { font-size: 15px; }
  .group > .label { margin-bottom: 5px; }
  .grid { gap: 10px 16px; }
  .field { gap: 5px; }
  .label { font-size: 14px; letter-spacing: 0; }
  .input, .input--area { font-size: 16px; }
  .chip { font-size: 15px; }
  .file { font-size: 15px; }
  .file__hint { font-size: 13px; }
  .check { font-size: 13px; }
  .btn { font-size: 16px; }
}
@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: 900px) and (min-height: 841px) { body { zoom: .95; } .page { min-height: calc(100vh / .95); } }
@media (min-width: 1100px) and (max-height: 840px) and (min-height: 761px) { body { zoom: .86; } .page { min-height: calc(100vh / .86); } }
@media (min-width: 1100px) and (max-height: 760px) { body { zoom: .80; } .page { min-height: calc(100vh / .80); } }
@media (min-width: 1100px) and (max-height: 700px) { body { zoom: .76; } .page { min-height: calc(100vh / .76); } }
@media (min-width: 1100px) and (max-height: 620px) { body { zoom: .66; } .page { min-height: calc(100vh / .66); } }
@media (min-width: 1100px) and (max-height: 540px) { body { zoom: .58; } .page { min-height: calc(100vh / .58); } }

/* ---------- Мобильный: крупнее текст и поля ---------- */
@media (max-width: 767px) {
  .header { padding: 14px 16px; }
  .logo svg { width: 34px; height: 34px; }
  .logo__text { font-size: 16px; }
  .header__call { width: 48px; height: 48px; border-radius: 14px; }

  .page__bg { height: 360px; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
  .page { padding: 12px 0 28px; }
  .hero { min-height: 300px; padding: 84px 16px 22px; }
  .hero__top { gap: 14px; padding-bottom: 0; }
  .kicker { font-size: 12px; letter-spacing: .1em; }
  .hero__title { font-size: 34px; line-height: 1.1; }
  .hero__lead { font-size: 17px; line-height: 1.55; }

  .card { margin: 0 12px; padding: 22px 18px 24px; border-radius: 22px; }
  .form { gap: 20px; }
  .form__title { font-size: 24px; line-height: 1.2; }
  .form__sub { font-size: 15px; line-height: 1.45; }
  .label { font-size: 14px; color: var(--text-2); }
  .field { gap: 8px; }
  .grid { gap: 18px; }
  .input { height: 56px; font-size: 17px; border-radius: 12px; padding: 0 16px; }
  .input--area { height: 120px; padding: 14px 16px; font-size: 17px; line-height: 1.5; }
  .select select { padding-right: 44px; }
  .select::after { right: 18px; }
  .seg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .chip, .seg .chip { height: 54px; font-size: 15px; border-radius: 12px; justify-content: center; }
  .tags { gap: 8px; }
  .file { min-height: 60px; font-size: 15px; border-radius: 12px; padding: 0 16px; }
  .file__hint { display: none; }
  .check { font-size: 14px; line-height: 1.45; gap: 12px; }
  .check input { width: 22px; height: 22px; margin-top: 0; }
  .btn { height: 58px; font-size: 17px; border-radius: 14px; }
  .form__foot { gap: 18px; }
  .success__title { font-size: 26px; }
  .success__text { font-size: 16px; }
}
@media (max-width: 400px) {
  .hero__title { font-size: 30px; }
  .card { margin: 0 8px; padding: 20px 14px 22px; }
}
.label__opt { font-weight: 500; color: var(--muted); }

/* длинный заголовок («Изготовление деталей по чертежам») */
@media (min-width: 1100px) { .hero__title--long { font-size: clamp(34px, 2.9vw, 46px); } }

/* CRM-1966: дополнения к стилям макета detali-po-chertezham.zip (theme.css) — то, чего в архиве нет.
   Собирает gen_parts_form.py: theme.css + этот файл = css/styles.css страницы «Изготовление деталей по чертежам». */

/* логотип delta.online — как на остальных страницах заявок */
.lgA { fill: #F4F2EE; }

/* текст под формой — на телефоне крупнее, как в шаблоне */
@media (max-width: 767px) {
  section.seo h3 { font-size: 19px; }
  section.seo p, section.seo dd { font-size: 16px; }
  section.seo dt { font-size: 16px; }
}

/* «Что уже есть»: пять чипов в одну строку — иначе пятый переносится,
   и форма на 1920×1080 перестаёт помещаться в экран (как на страницах литья, CRM-1965) */
@media (min-width: 1100px) {
  .tags .chip { padding: 0 11px; }
}

/* «по чертежам» — не разрывать между строками: на телефоне заголовок идёт в три строки */
.hero__title .accent { white-space: nowrap; }
