/*
 * ЕЦИС — форма заявки, всплывающее окно и уведомление о cookies.
 * Отдельный файл: site.css не меняется. Цвета и шрифты — переменные сайта.
 */

/* ---------- Форма ---------- */

.lead-box {
  margin-top: 46px;
  max-width: 760px;
}

.lead-form {
  display: grid;
  gap: 18px;
}

.lead-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.lead-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.lead-field > label {
  color: var(--muted);
  font: 10px var(--font-geist-mono), monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lead-req {
  color: var(--mint);
}

.lead-field input[type="text"],
.lead-field input[type="tel"],
.lead-field input[type="email"],
.lead-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* меньше 16px — iOS увеличивает страницу при фокусе */
  line-height: 1.4;
  background: #0b1314;
  border: 1px solid #61ebdb59;
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.lead-field textarea {
  min-height: 120px;
  resize: vertical;
}

.lead-field input:hover,
.lead-field textarea:hover {
  border-color: #61ebdb99;
}

.lead-field input:focus-visible,
.lead-field textarea:focus-visible,
.lead-consent input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-color: var(--mint);
  box-shadow: 0 0 0 4px #18d7c526;
}

.lead-field [aria-invalid="true"] {
  border-color: #ff8f80;
}

.lead-error {
  margin: 0;
  color: #ffb3a8;
  font-size: 13px;
  line-height: 1.45;
}

.lead-error::before {
  content: "⚠ ";
}

.lead-error-form {
  padding: 12px 16px;
  border: 1px solid #ff8f8066;
  border-radius: 12px;
  background: #ff8f800f;
}

.lead-consent {
  grid-template-columns: 22px 1fr;
  align-items: start;
  column-gap: 12px;
}

.lead-consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--mint);
}

.lead-consent > label {
  color: #c7cfcc;
  font: 14px/1.5 var(--font-geist-sans), Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.lead-consent > label a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lead-consent .lead-error {
  grid-column: 2;
}

.lead-submit {
  justify-self: start;
  cursor: pointer;
  font-family: inherit;
}

.lead-submit[disabled] {
  opacity: .6;
  cursor: progress;
  transform: none;
}

.lead-submit:focus-visible,
.lead-cta-actions .btn:focus-visible,
.cookie-banner .btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.lead-success {
  margin: 0;
  padding: 26px 28px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.5;
  border: 1px solid var(--mint);
  border-radius: 18px;
  background: #18d7c514;
}

.lead-status:focus {
  outline: none;
}

/* Ловушка для ботов: вне экрана, но в разметке. */
.lead-trap {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Кнопки в блоке призыва внутренних страниц ---------- */

.lead-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* ---------- Всплывающее окно ---------- */

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Без JS — по якорю #lead-modal; с JS — классом is-open. */
html:not(.js-lead) .lead-modal:target,
.lead-modal.is-open {
  display: flex;
}

.lead-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #020606d9;
  cursor: default;
}

.lead-modal-panel {
  position: relative;
  box-sizing: border-box;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px 46px 40px;
  color: var(--ink);
  text-align: left;
  background: radial-gradient(circle at 90% 0%, #18d7c51c, #0000 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: 0 30px 90px #000a;
  animation: lead-modal-in .25s ease-out;
}

.lead-modal-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 550;
  letter-spacing: -.05em;
  line-height: 1;
}

.lead-modal-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.lead-modal .lead-box {
  margin-top: 28px;
}

.lead-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.lead-modal-close:hover,
.lead-modal-close:focus-visible {
  color: var(--mint);
  border-color: var(--mint);
  outline: none;
}

html.lead-modal-open,
html.lead-modal-open body {
  overflow: hidden;
}

@keyframes lead-modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Уведомление о cookies ---------- */

.cookie-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 900;
  box-sizing: border-box;
  width: min(640px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px 26px;
  color: var(--ink);
  background: #0d1515f5;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px #0009;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-title {
  margin: 0 0 8px;
  color: var(--mint);
  font: 10px var(--font-geist-mono), monospace;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.cookie-banner-text {
  margin: 0;
  color: #c7cfcc;
  font-size: 14px;
  line-height: 1.55;
}

.cookie-banner-text a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-options {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.cookie-banner-options[hidden] {
  display: none;
}

.cookie-banner-options label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  color: #c7cfcc;
  font-size: 13px;
  line-height: 1.5;
}

.cookie-banner-options input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--mint);
}

.cookie-banner-options b {
  color: var(--ink);
  font-weight: 600;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cookie-banner .btn {
  min-height: 44px;
  padding: 0 18px;
  font-family: inherit;
  cursor: pointer;
}

.cookie-banner .btn[hidden] {
  display: none;
}

/* «Принять все» и «Только необходимые» — одинаковые: один размер, один стиль. */
.cookie-banner .cookie-choice {
  flex: 1 1 0;
  min-width: 190px;
  color: var(--ink);
  border-color: #61ebdb80;
}

.cookie-banner .cookie-choice:hover {
  color: var(--mint);
  border-color: var(--mint);
}

/* «Настроить» — третья, менее заметная: текстовая кнопка. */
.cookie-banner-link {
  align-self: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  font: 13px var(--font-geist-sans), Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  cursor: pointer;
}

.cookie-banner-link:hover {
  color: var(--ink);
}

.cookie-banner-link:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-radius: 6px;
}

/* В режиме настройки главная — «Сохранить выбор», она первая. */
.cookie-banner.is-customizing [data-consent="save"] {
  order: -1;
  flex: 1 1 100%;
}

/* Плашка не перекрывает низ страницы и кнопку формы: место под неё в конце прокрутки. */
html.has-cookie-banner body {
  padding-bottom: var(--cookie-banner-h, 0px);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Ссылка «Настройки cookies» в подвале выглядит как соседние. */
.footer-legal a[data-cookie-settings] {
  cursor: pointer;
}

/* ---------- Телефон ---------- */

@media (max-width: 760px) {
  .lead-box {
    margin-top: 34px;
  }

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

  .lead-submit {
    justify-self: stretch;
    width: 100%;
  }

  .lead-modal {
    padding: 0;
    align-items: stretch;
  }

  .lead-modal-panel {
    width: 100%;
    max-height: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: 70px 21px calc(40px + env(safe-area-inset-bottom));
  }

  .lead-cta-actions .btn {
    width: 100%;
  }

  .cookie-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 70vh;
    padding: 18px 21px calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }

  .cookie-banner .btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  .cookie-banner-link {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-modal-panel {
    animation: none;
  }

  .lead-field input,
  .lead-field textarea {
    transition: none;
  }

  .lead-submit:hover,
  .cookie-banner .btn:hover {
    transform: none;
  }
}

/* Тексты страниц (промт 27): фотография в карточке команды «О центре» и спикера форума — только если выбрана в медиатеке. */
.ecis-person-photo { display: block; width: 72px; height: 72px; margin: 0 0 14px; border-radius: 50%; object-fit: cover; }

/* Телефоны: длинные слова в крупных заголовках («Идентифицированный», «интеллектуальных») не шире блока. */
@media (max-width: 480px) {
  .service-outcome h2 { font-size: min(32px, 7.6vw); }
  .inner-contact h2 { font-size: min(43px, 9.6vw); }
  .service-outcome h2, .inner-contact h2 { hyphens: auto; overflow-wrap: break-word; }
}
/* «Следующая услуга»: длинное название переносится, а не упирается в край. */
.next-service a span { min-width: 0; overflow-wrap: break-word; }

/* Мобильное меню: если пункты не помещаются в экран телефона — нижняя часть закрытого меню
   выглядывала сверху поверх логотипа. Закрытое меню полностью скрыто, открытое прокручивается внутри. */
.mobile-nav { overflow-y: auto; overscroll-behavior: contain; }
.mobile-nav:not(.open) { visibility: hidden; transition: transform .4s, visibility 0s linear .4s; }
.mobile-nav.open { visibility: visible; transition: transform .4s, visibility 0s; }
@media (max-width: 720px) and (max-height: 860px) {
  .mobile-nav { padding-top: 92px; }
  .mobile-nav nav a { font-size: 24px; padding: 10px 0; }
}
@media (max-width: 720px) and (max-height: 700px) {
  .mobile-nav { padding-top: 84px; }
  .mobile-nav nav a { font-size: 21px; padding: 8px 0; }
}

/* «Патентный брокер»: «Договариваемся.» и «правообладателя.» не шире своих колонок. */
.broker-guarantees > div > h2 { max-width: 700px; }
.broker-route-intro h2 { max-width: 700px; }
@media (max-width: 1000px) { .broker-route > *, .broker-guarantees > * { min-width: 0; } }
@media (max-width: 480px) {
  .broker-route-intro h2 { font-size: min(53px, 9.4vw); }
  .broker-guarantees > div > h2 { font-size: min(60px, 11vw); }
  .broker-route-intro h2, .broker-guarantees > div > h2 { hyphens: auto; overflow-wrap: break-word; }
}
