/* ─── svc-lead-standalone.css ─────────────────────────────────────────
   Вытяжка стилей модалки-заявки (svc-lead-modal.js) из style.css для
   самодостаточных демо-страниц /portfolio/*. Переменные и утилитарные
   классы скоуплены в .svc-lead-dialog, чтобы не конфликтовать со
   стилями самих демо (у них свои --accent/--bg/.btn).
   Источник — style.css; при правке модалки синхронизировать оба файла.
   ──────────────────────────────────────────────────────────────────── */
.svc-lead-dialog, .svc-lead-dialog::backdrop {
  /* Backgrounds */
  --bg:          #000000;
  --bg-raised:   #0A0A0A;
  --bg-overlay:  #111111;
  --bg-subtle:   #1C1C1E;

  /* Text */
  --text:        #FFFFFF;
  --text-2:      rgba(255,255,255,0.68);
  --text-3:      rgba(255,255,255,0.44);
  --text-4:      rgba(255,255,255,0.28);

  /* Accent */
  --accent:       #3A82FF;
  --accent-hover: #5A9AFF;
  --accent-glow:  rgba(58,130,255,0.25);
  --accent-purple:#A78BFA;
  --success:      #34D399;
  --gradient-accent: linear-gradient(90deg, #3A82FF, #A78BFA);

  /* Borders */
  --border:       rgba(255,255,255,0.10);
  --border-hover: rgba(255,255,255,0.20);

  /* Radius */
  --radius:      16px;
  --radius-lg:   24px;
  --radius-pill: 980px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --section-y: clamp(80px, 10vw, 140px);
  --section-x: clamp(24px, 5vw, 80px);

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

.svc-lead-dialog .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  line-height: 1;
  white-space: nowrap;
}
.svc-lead-dialog .btn:active { transform: scale(0.97); }

.svc-lead-dialog .btn-primary,
.svc-lead-dialog .nav a.btn-primary {
  background: linear-gradient(180deg, #4D8FFF 0%, #2563EB 100%);
  color: #FFFFFF !important;
  padding: 14px 28px;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(58,130,255,0.30), 0 4px 12px rgba(58,130,255,0.20);
}
.svc-lead-dialog .btn-primary:hover,
.svc-lead-dialog .nav a.btn-primary:hover {
  background: linear-gradient(180deg, #5A9AFF 0%, #3A82FF 100%);
  color: #FFFFFF !important;
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(58,130,255,0.45), 0 8px 30px rgba(58,130,255,0.25);
}
.svc-lead-dialog .btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 14px 28px;
  font-size: 15px;
  border: 1.5px solid rgba(255,255,255,0.18);
}
.svc-lead-dialog .btn-secondary:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.30);
  transform: scale(1.02);
}
.svc-lead-dialog .btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 14px 28px;
  font-size: 15px;
  border: 1.5px solid rgba(255,255,255,0.22);
}
.svc-lead-dialog .btn-ghost:hover {
  border-color: rgba(255,255,255,0.44);
  background: rgba(255,255,255,0.10);
  color: var(--text);
}
.svc-lead-dialog .btn-sm { padding: 10px 20px; font-size: 14px; }
.svc-lead-dialog .btn-lg { padding: 16px 32px; font-size: 16px; }
.svc-lead-dialog .btn-xl { padding: 18px 40px; font-size: 17px; }
.svc-lead-dialog .w-full { width: 100%; display: flex; }

.svc-lead-dialog .form-success-card {
  text-align: center;
  padding: 48px 24px;
  animation: form-success-in 0.5s var(--ease-out) both;
}
@keyframes form-success-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.svc-lead-dialog .form-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(52,211,153,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.svc-lead-dialog .form-success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--success);
}
.svc-lead-dialog .form-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.svc-lead-dialog .form-success-text {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 20px;
}
.svc-lead-dialog .form-success-contacts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.875rem;
}
.svc-lead-dialog .form-success-contacts a {
  color: var(--accent);
  text-decoration: none;
}
.svc-lead-dialog .form-success-contacts a:hover { text-decoration: underline; }
.svc-lead-dialog .form-success-contacts span { color: var(--text-4); }

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Модалка-заявка для страниц услуг (svc-lead-modal.js) ── */
.svc-lead-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-overlay);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  margin: auto;
  max-height: 92vh;
  overflow-y: auto;
}
.svc-lead-dialog[open] { animation: svc-lead-in 0.32s var(--ease-out) both; }
@keyframes svc-lead-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.svc-lead-dialog::backdrop {
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.svc-lead-form { position: relative; padding: 40px 32px 32px; }
.svc-lead-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  z-index: 10;                /* всегда над прокручиваемым контентом — чтобы тап ловился */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.svc-lead-close:hover { background: var(--border-hover); color: var(--text); }
.svc-lead-close svg { width: 18px; height: 18px; pointer-events: none; }
.svc-lead-head { margin-bottom: 22px; padding-right: 32px; }
.svc-lead-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.svc-lead-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.svc-lead-sub { font-size: 0.875rem; color: var(--text-2); line-height: 1.55; }
.svc-lead-hp { position: absolute; left: -9999px; top: -9999px; }
.svc-lead-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.svc-lead-field label { font-size: 0.8125rem; font-weight: 600; color: var(--text-3); }
.svc-lead-field input {
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-raised);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.svc-lead-field input::placeholder { color: var(--text-4); }
.svc-lead-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.svc-lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 4px 0 18px;
  cursor: pointer;
}
.svc-lead-consent input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}
.svc-lead-consent a { color: var(--accent); text-decoration: none; }
.svc-lead-consent a:hover { text-decoration: underline; }
.svc-lead-msg {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.8125rem;
  margin-bottom: 16px;
  background: rgba(239,68,68,0.12);
  color: #F87171;
  border: 1px solid rgba(239,68,68,0.20);
}
.svc-lead-submit { margin-top: 4px; }

body.svc-lead-open { overflow: hidden; }
body.svc-lead-open .chat-toggle,
body.svc-lead-open .chat-panel,
body.svc-lead-open .chat-promo,
body.svc-lead-open .sticky-cta { visibility: hidden; }

[data-theme="light"] .svc-lead-dialog::backdrop { background: rgba(0,0,0,0.4); }

@media (max-width: 600px) {
  body.svc-lead-open {
    position: fixed;
    width: 100%;
    height: 100%;
  }
  .svc-lead-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
  }
  .svc-lead-dialog[open] { animation: svc-lead-up 0.3s var(--ease-out) both; }
  @keyframes svc-lead-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  /* Контент скроллится, футер с кнопкой зафиксирован внизу (flex) */
  .svc-lead-form { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .svc-lead-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 22px 14px; }
  .svc-lead-footer {
    flex-shrink: 0;
    padding: 14px 22px calc(18px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-overlay);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 28px rgba(0,0,0,0.28);
  }
  .svc-lead-footer .svc-lead-consent { margin-bottom: 12px; }
  .svc-lead-footer .svc-lead-trust { margin-top: 10px; }
  /* Тач-зоны крупнее */
  .svc-lead-close { width: 40px; height: 40px; }
  .svc-lead-consent input { width: 20px; height: 20px; }
  [data-theme="light"] .svc-lead-footer { box-shadow: 0 -10px 28px rgba(0,0,0,0.10); }
}

/* ── Модалка: комментарий + доп.услуги + анимации ── */
.svc-lead-dialog .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* Тоггл-кнопки «+ Добавить комментарий» / «+ Что ещё интересно?» */
.svc-lead-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 2px 0;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.svc-lead-toggle:hover { color: var(--accent-hover); }
.svc-lead-toggle svg {
  width: 16px; height: 16px;
  transition: transform 0.22s var(--ease-out);
}
.svc-lead-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }
.svc-lead-opt { color: var(--text-4); font-weight: 500; font-size: 0.8125rem; }
/* Плавное раскрытие (grid-rows — анимирует любую высоту без рывков) */
.svc-lead-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s var(--ease-out), opacity 0.28s var(--ease-out);
}
.svc-lead-reveal > div { overflow: hidden; min-height: 0; }
.svc-lead-reveal.open { grid-template-rows: 1fr; opacity: 1; }
/* Textarea комментария */
.svc-lead-field textarea {
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-raised);
  resize: none;
  min-height: 84px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.svc-lead-field textarea::placeholder { color: var(--text-4); }
.svc-lead-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.svc-lead-counter {
  align-self: flex-end;
  font-size: 0.6875rem;
  color: var(--text-4);
  margin-top: 4px;
}
/* Подсказка над чипами */
.svc-lead-hint {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin: 0 0 12px;
}
/* Чипы доп.услуг */
.svc-lead-chips {
  border: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.svc-chip { display: inline-flex; cursor: pointer; }
.svc-chip input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;   /* фокусируемый, но визуально скрыт */
}
.svc-chip span {
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-raised);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.svc-chip span::before {
  content: '✓';
  width: 0;
  margin-right: 0;
  opacity: 0;
  transform: scale(0);
  font-size: 0.72rem;
  overflow: hidden;
  transition: width 0.2s var(--ease-out), margin 0.2s var(--ease-out), opacity 0.2s, transform 0.2s var(--ease-out);
}
.svc-chip:hover span { border-color: var(--border-hover); color: var(--text); }
.svc-chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.svc-chip input:checked + span::before {
  width: 0.85em;
  margin-right: 5px;
  opacity: 1;
  transform: scale(1);
}
.svc-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-glow); }
.svc-chip.pop span { animation: svc-chip-pop 0.18s var(--ease-out); }
@keyframes svc-chip-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
/* Эхо доп.услуг в success-карточке */
.svc-lead-dialog .form-success-extra {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 4px;
}
/* Draw-in галочки успеха */
.svc-lead-dialog .form-success-icon svg polyline {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: svc-success-draw 0.5s var(--ease-out) 0.15s forwards;
}
@keyframes svc-success-draw { to { stroke-dashoffset: 0; } }

/* Ориентир по цене в шапке модалки */
.svc-lead-price {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.svc-lead-price strong { color: var(--text); font-weight: 700; }
/* Предпочтительный канал связи */
.svc-lead-pref { margin-bottom: 16px; }
.svc-lead-chips-compact { margin-bottom: 0; }
/* «Что дальше» — шаги после заявки (вертикаль + мини-дерево-коннектор) */
.svc-lead-next {
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  --tree: 56,189,248;
}
.svc-lead-next-title { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.svc-next-row { display: flex; align-items: center; gap: 11px; font-size: 0.875rem; color: var(--text-2); }
.svc-next-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.svc-next-txt { line-height: 1.3; }
.svc-next-conn { height: 32px; padding-left: 1px; line-height: 0; }
.svc-next-tree { display: block; }
.svc-next-tree line { stroke: rgba(var(--tree), 0.9); stroke-linecap: round; }
.svc-next-tree circle { fill: rgba(var(--tree), 0.95); }
.svc-next-tree circle.p { opacity: 0.6; }
[data-theme="light"] .svc-lead-next { --tree: 8,145,178; }
/* Трист-строка под кнопкой */
.svc-lead-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-4);
  text-align: center;
  line-height: 1.4;
}
.svc-lead-trust svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Подсветка проблемного поля при ошибке валидации */
.svc-lead-field input.svc-invalid,
.svc-lead-field textarea.svc-invalid {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}
.svc-lead-consent.svc-invalid { color: #F87171; }
.svc-lead-consent.svc-invalid input { outline: 2px solid #EF4444; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .svc-lead-dialog[open],
  .svc-lead-reveal,
  .svc-chip span,
  .svc-chip span::before,
  .svc-lead-toggle svg,
  .svc-lead-dialog .form-success-card,
  .svc-lead-dialog .form-success-icon svg polyline {
    animation: none !important;
    transition: none !important;
  }
  .svc-lead-reveal { grid-template-rows: 0fr; opacity: 0; }
  .svc-lead-reveal.open { grid-template-rows: 1fr; opacity: 1; }
  .svc-lead-dialog .form-success-icon svg polyline { stroke-dashoffset: 0; }
}
