/* =========================================================
   COMPONENTS: кнопки, бейджи, поля формы, карточка заявки
   ========================================================= */

/* =========================================================
   BUTTON
   ========================================================= */
.btn {
  --btn-bg:    var(--c-ink);
  --btn-fg:    #fff;
  --btn-bd:    transparent;
  --btn-bg-h:  var(--c-ink-2);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 22px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  text-align: center;
  white-space: nowrap;
}
.btn:hover {
  background: var(--btn-bg-h);
  color: var(--btn-fg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }

/* Размеры */
.btn--sm { padding: 10px 16px; font-size: 0.85rem; }
.btn--lg { padding: 18px 28px; font-size: 1rem; }
.btn--block { width: 100%; }

/* Варианты */
.btn--primary {
  --btn-bg:   var(--c-accent);
  --btn-fg:   #fff;
  --btn-bg-h: var(--c-accent-hi);
}
.btn--ghost {
  --btn-bg:   transparent;
  --btn-fg:   var(--c-ink);
  --btn-bd:   var(--c-ink);
  --btn-bg-h: var(--c-ink);
}
.btn--ghost:hover { color: #fff; }

/* =========================================================
   BADGE (бейджи преимуществ в hero)
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-ink-2);
}
.badge__icon { width: 13px; height: 13px; flex-shrink: 0; }
.badge--accent {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: #fff;
}

/* =========================================================
   FIELD (поля формы)
   ========================================================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-muted);
  letter-spacing: 0.01em;
}
.field__input {
  width: 100%;
  padding: 13px 14px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-line);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--c-ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field__input::placeholder { color: var(--c-muted); }
.field__input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(232,93,47,0.15);
}
.field__input--select {
  /* кастомная стрелка */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23141821' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 38px;
  cursor: pointer;
}

/* =========================================================
   CONSENT (чекбокс согласия с политикой и обработкой ПД)
   ========================================================= */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--c-muted);
  user-select: none;
}
.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1.5px solid var(--c-line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.consent input[type="checkbox"]:hover {
  border-color: var(--c-accent);
}
.consent input[type="checkbox"]:checked {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M3 7l3 3 5-6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.consent__text a {
  color: var(--c-ink-2);
  text-decoration: underline;
  text-decoration-color: var(--c-line);
}
.consent__text a:hover {
  color: var(--c-accent);
  text-decoration-color: var(--c-accent);
}
/* Вариант для тёмного фона (mid-CTA) */
.consent--on-dark {
  color: rgba(255,255,255,.55);
}
.consent--on-dark input[type="checkbox"] {
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.05);
}
.consent--on-dark input[type="checkbox"]:checked {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.consent--on-dark .consent__text a {
  color: rgba(255,255,255,.75);
  text-decoration-color: rgba(255,255,255,.25);
}
.consent--on-dark .consent__text a:hover {
  color: #fff;
  text-decoration-color: var(--c-accent);
}

/* =========================================================
   LEAD-FORM (карточка заявки в hero)
   ========================================================= */
.lead-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);

  /* «штамповая» декоративная полоса слева */
  background-image:
    linear-gradient(180deg, var(--c-accent) 0%, var(--c-accent) 100%);
  background-repeat: no-repeat;
  background-size: 4px 100%;
  background-position: left top;
  padding-left: calc(var(--sp-6) + 4px);
}

/* Компактный вариант — для hero и mid-CTA */
.lead-form--compact {
  gap: var(--sp-3);
  padding: var(--sp-5);
  padding-left: calc(var(--sp-5) + 4px);
}
.lead-form--compact .lead-form__head { margin-bottom: var(--sp-1); }
.lead-form--compact .lead-form__title { font-size: 1.25rem; }

.lead-form__head { margin-bottom: var(--sp-2); }
.lead-form__kicker {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--sp-2);
}
.lead-form__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.02em;
}
.lead-form__sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--c-muted);
  line-height: 1.45;
}

.lead-form__legal {
  margin: 0;
  font-size: 0.7rem;
  color: var(--c-muted);
  line-height: 1.4;
  text-align: center;
}
.lead-form__legal a {
  color: var(--c-muted);
  text-decoration: underline;
  text-decoration-color: var(--c-line);
}
.lead-form__legal a:hover { color: var(--c-accent); text-decoration-color: var(--c-accent); }

.lead-form__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.lead-form__foot-icon {
  width: 18px; height: 18px;
  color: var(--c-accent);
  flex-shrink: 0;
}
.lead-form__foot strong {
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--c-accent);
}

/* ============ МОДАЛЬНЫЙ ПОПАП ЗАКАЗА ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.modal.is-open { display: flex; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: modalFade var(--t-base);
}
.modal__dialog {
  position: relative;
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  width: min(820px, 100%);
  max-height: calc(100vh - 2 * var(--sp-4));
  background: var(--c-bg-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop var(--t-base);
}
@keyframes modalFade { from { opacity: 0; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal__close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: var(--radius);
  cursor: pointer;
  z-index: 3;
  transition: background var(--t-fast);
}
.modal__close:hover { background: rgba(255, 255, 255, .35); }

/* Фото-панель: положите /img/popup.jpg, чтобы заменить фон */
.modal__media {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-6);
  color: #fff;
  background:
    linear-gradient(155deg, rgba(30, 64, 175, .90), rgba(11, 18, 32, .94)),
    url('/img/popup.jpg') center / cover no-repeat,
    radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px) 0 0 / 16px 16px var(--c-ink);
}
.modal__media-mark {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.35rem;
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.modal__media-pitch {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: var(--sp-4);
}
.modal__media-list { list-style: none; display: grid; gap: 9px; }
.modal__media-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, .88);
}
.modal__media-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  font-weight: 700;
}

/* Панель формы */
.modal__pane {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.modal__success { text-align: center; padding: var(--sp-4) 0; }
.modal__success-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-success);
  font-size: 1.7rem;
}
.modal__success-title { font-family: var(--f-display); font-size: 1.25rem; margin-bottom: var(--sp-2); }
.modal__success-text { color: var(--c-muted); margin-bottom: var(--sp-5); }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .modal { padding: 0; align-items: stretch; }
  .modal__dialog {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    overflow-y: auto;
  }
  .modal__media { display: none; }
  .modal__pane { padding: var(--sp-7) var(--sp-5); min-height: 100vh; }
}
