/* Дополнения к styles.css (2026-09-29): форма, n8n-карточка, всплывающая заявка. */

/* форма на первом экране не заезжает под фиксированные кнопки «Позвонить»/Telegram */
@media (min-width: 981px){
  .hero__row{ padding-right: calc(54px + var(--space-4)); }
}

/* портфолио: статичная картинка-схема (n8n) целиком, без кропа */
.portfolio-card__media--static{ background: #101017; }
.portfolio-card__media--static img{ object-fit: cover; }
.portfolio-card--n8n:hover .portfolio-card__media img{ filter: saturate(1.05) brightness(1.02); }

/* ловушка для спам-ботов: поле скрыто от людей */
.lead-form__hp{ position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ответ формы (успех/ошибка) */
.lead-form__status{ font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.lead-form__status a{ color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.lead-form__status.is-error{ color: #ff8a9b; }

/* всплывающая форма заявки */
.lead-popup{
  width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: var(--space-5); margin: auto;
  color: var(--text); background: rgba(21,21,29,.96);
  border: 1px solid rgba(255,255,255,.1); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(27,69,255,.25), inset 0 1px 0 rgba(255,255,255,.06);
}
.lead-popup::backdrop{ background: rgba(5,5,9,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lead-popup[open]{ animation: leadPopupIn .45s cubic-bezier(.16,1,.3,1); }
@keyframes leadPopupIn{ from{ opacity: 0; transform: translateY(18px) scale(.97); } to{ opacity: 1; transform: none; } }
.lead-popup__close{
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: var(--text-muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--border); cursor: pointer;
}
.lead-popup__close:hover{ color: var(--text); border-color: var(--accent-light); }
.lead-popup__close:focus-visible{ outline: 2px solid var(--accent-light); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){ .lead-popup[open]{ animation: none; } }

/* ---------- редизайн форм заявок (2026-09-29) ----------
   Поля — мягкие «таблетки» с подсветкой фокуса кобальтом; чипы услуг;
   аккуратный чекбокс 18px (раньше на него случайно действовали min-height
   и padding общего правила для input — отсюда был огромный прямоугольник). */
.lead-form, .contact__form{ gap: 14px; }
.lead-form label, .contact__form label{
  gap: 7px; font-size: 12.5px; font-weight: 500; letter-spacing: .01em; color: var(--text-muted);
}
.lead-form input:not([type="checkbox"]),
.contact__form input:not([type="checkbox"]),
.contact__form textarea{
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.09); border-radius: 12px;
  padding: 13px 15px; min-height: 48px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.contact__form textarea{ min-height: 96px; resize: vertical; line-height: 1.5; }
.lead-form input::placeholder, .contact__form input::placeholder, .contact__form textarea::placeholder{ color: rgba(166,170,189,.55); }
.lead-form input:not([type="checkbox"]):hover,
.contact__form input:not([type="checkbox"]):hover,
.contact__form textarea:hover{ border-color: rgba(124,147,255,.35); }
.lead-form input:not([type="checkbox"]):focus,
.contact__form input:not([type="checkbox"]):focus,
.contact__form textarea:focus{
  outline: none; border-color: var(--accent-light); background: rgba(27,69,255,.06);
  box-shadow: 0 0 0 4px rgba(27,69,255,.18);
}
.lead-form__row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px){ .lead-form__row{ grid-template-columns: 1fr; } }

/* согласие: строка, маленький чекбокс с галочкой-иконкой */
.lead-form .consent-field, .contact__form .consent-field{
  flex-direction: row; align-items: flex-start; gap: 10px;
  font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; cursor: pointer;
}
.lead-form .consent-field input[type="checkbox"],
.contact__form .consent-field input[type="checkbox"],
.lead-popup .consent-field input[type="checkbox"]{
  flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 1px 0 0;
  appearance: none; -webkit-appearance: none; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.22); background: rgba(255,255,255,.03) center / 12px 12px no-repeat;
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.lead-form .consent-field input[type="checkbox"]::after,
.contact__form .consent-field input[type="checkbox"]::after{ content: none; }
.lead-form .consent-field input[type="checkbox"]:hover,
.contact__form .consent-field input[type="checkbox"]:hover{ border-color: var(--accent-light); }
.lead-form .consent-field input[type="checkbox"]:checked,
.contact__form .consent-field input[type="checkbox"]:checked{
  border-color: var(--accent-light); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.lead-form .consent-field input[type="checkbox"]:focus-visible,
.contact__form .consent-field input[type="checkbox"]:focus-visible{ outline: none; box-shadow: 0 0 0 4px rgba(27,69,255,.25); }

/* чипы «С чем нужна помощь» */
.lead-chips{ border: 0; padding: 0; margin: 0; min-width: 0; }
.lead-chips legend{ padding: 0; margin-bottom: 9px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.lead-chips__list{ display: flex; flex-wrap: wrap; gap: 8px; }
.contact__form .lead-chip{ display: inline-flex; flex-direction: row; gap: 0; cursor: pointer; }
.lead-chip input{ position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lead-chip span{
  display: inline-block; padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1);
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
  user-select: none;
}
.lead-chip:hover span{ color: var(--text); border-color: rgba(124,147,255,.45); }
.lead-chip input:checked + span{ color: #fff; background: rgba(27,69,255,.22); border-color: var(--accent-light); }
.lead-chip input:focus-visible + span{ box-shadow: 0 0 0 3px rgba(27,69,255,.35); }

/* кнопка отправки */
.lead-form button[type="submit"], .contact__form button[type="submit"]{ width: 100%; border-radius: 14px; margin-top: 2px; }

/* экран успеха вместо формы */
.js-lead.is-sent > :not(.lead-success){ display: none !important; }
.lead-success{
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: var(--space-5) var(--space-3); animation: leadPopupIn .45s cubic-bezier(.16,1,.3,1);
}
.lead-success__icon{
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  font-size: 22px; color: #fff; background: linear-gradient(155deg, var(--accent-light), var(--accent));
  box-shadow: 0 10px 30px rgba(27,69,255,.35);
}
.lead-success__title{ font-size: 1.1rem; font-weight: 700; color: var(--text); }
.lead-success__text{ font-size: 14px; color: var(--text-muted); }

/* портфолио: «200+ проектов» */
.portfolio-count{
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  margin-top: var(--space-6); text-align: center; color: var(--text-muted); font-size: 1.05rem;
}
.portfolio-count strong{
  font-family: var(--font-black); font-weight: 800; font-size: clamp(2.2rem, 4.5vw, 3.2rem); line-height: 1;
  background: linear-gradient(90deg, var(--text), var(--accent-text)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Ссылка «Подробнее» в карточках услуг на главной */
.card__more{ display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.card__more:hover{ text-decoration: underline; text-underline-offset: 3px; }

/* ---------- оффер «бесплатный макет первого экрана» (2026-10-01) ---------- */
.offer__card{
  position: relative; overflow: hidden; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: var(--space-6);
  padding: var(--space-7) var(--space-6); border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(27,69,255,.30), transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(76,107,255,.10), transparent 60%),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 30px 80px rgba(0,0,0,.35);
}
.offer__title{
  font-family: var(--font-black); font-weight: 800; letter-spacing: -0.012em; line-height: 1.08;
  font-size: clamp(1.75rem, 3.4vw, 2.7rem); margin-bottom: var(--space-3);
}
.offer__title span{ color: var(--accent-text); white-space: nowrap; }
.offer__lead{ color: var(--text-muted); font-size: 16px; line-height: 1.6; max-width: 520px; }
.offer__steps{ list-style: none; margin: var(--space-4) 0 var(--space-5); padding: 0; display: grid; gap: 10px; }
.offer__steps li{ display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; font-size: 14.5px; line-height: 1.45; }
.offer__steps b{ font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent-text); letter-spacing: .08em; }
.offer__form{ max-width: 520px; }
.offer__btn{ align-self: flex-start; }

.offer__visual{ position: relative; min-height: 380px; perspective: 1400px; }
.offer__glow{
  position: absolute; inset: 8% 0 0 6%; border-radius: 50%; filter: blur(60px);
  background: radial-gradient(closest-side, rgba(27,69,255,.55), transparent);
}
.offer__win{
  position: absolute; margin: 0; overflow: hidden; border-radius: 14px; background: #101017;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(27,69,255,.18);
  transform-style: preserve-3d; will-change: transform;
}
.offer__win img{ display: block; width: 100%; height: auto; }
.offer__bar{ display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; background: #1B1B26; border-bottom: 1px solid rgba(255,255,255,.06); }
.offer__bar i{ width: 8px; height: 8px; border-radius: 50%; background: #3a3a48; }
.offer__bar span{ margin-left: 10px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.offer__win--back{ width: 88%; right: -6%; top: 0; transform: rotateY(-16deg) rotateX(6deg) rotateZ(1.5deg); opacity: .75; animation: offerFloatB 9s ease-in-out infinite; }
.offer__win--front{ width: 96%; left: -2%; top: 31%; transform: rotateY(-12deg) rotateX(5deg) rotateZ(-1deg); animation: offerFloatA 7s ease-in-out infinite; }
@keyframes offerFloatA{ 50%{ transform: rotateY(-10deg) rotateX(4deg) rotateZ(-1deg) translateY(-10px); } }
@keyframes offerFloatB{ 50%{ transform: rotateY(-17deg) rotateX(7deg) rotateZ(1.5deg) translateY(8px); } }
.offer__badge{
  position: absolute; right: 2%; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 118px; height: 118px; border-radius: 50%; text-align: center; transform: rotate(-9deg);
  background: linear-gradient(145deg, var(--accent-light), var(--accent)); color: #fff;
  box-shadow: 0 18px 40px rgba(27,69,255,.5), inset 0 1px 0 rgba(255,255,255,.35);
}
.offer__badge b{ font-family: var(--font-black); font-weight: 800; font-size: 30px; line-height: 1; }
.offer__badge span{ font-size: 11px; line-height: 1.2; margin-top: 4px; max-width: 80px; }
@media (max-width: 980px){
  .offer__card{ grid-template-columns: 1fr; padding: var(--space-6) var(--space-4); }
  .offer__visual{ min-height: 0; aspect-ratio: 16 / 11; margin-top: var(--space-3); }
  .offer__btn{ align-self: stretch; }
}
@media (max-width: 560px){
  .offer__card{ padding: var(--space-5) var(--space-3); border-radius: 22px; }
  .offer__badge{ width: 92px; height: 92px; }
  .offer__badge b{ font-size: 24px; }
}
@media (prefers-reduced-motion: reduce){ .offer__win{ animation: none; } }
