/* mod_leadform — формы заявок. Цвета настраиваются переменными ниже (или в custom.css шаблона). */
.leadform {
  --lf-accent: #1e88e5;
  --lf-accent-hover: #1565c0;
  --lf-border: #c9c9c9;
  --lf-text: #333;
  --lf-error: #c62828;
  --lf-ok: #2e7d32;
  color: var(--lf-text);
}

.leadform__intro { margin-bottom: 1rem; }
.leadform__body--side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 40%); gap: 2rem; align-items: start; }
.leadform__side img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.leadform__row { margin-bottom: 1rem; }
.leadform__label { display: block; margin-bottom: .3rem; font-weight: 600; }
.leadform__req { color: var(--lf-error); }
.leadform__hint { font-size: .85em; color: #666; margin-top: .25rem; }

.leadform__input {
  display: block;
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--lf-border);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}
.leadform__input:focus { outline: 2px solid var(--lf-accent); outline-offset: 0; border-color: var(--lf-accent); }
textarea.leadform__input { resize: vertical; min-height: 7rem; }

.leadform__select-wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.leadform__select-wrap select { flex: 0 1 18rem; }
.leadform__option-image { max-width: 260px; max-height: 140px; height: auto; background: #fff; border-radius: 4px; }

.leadform__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.leadform__consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .85em; line-height: 1.4; cursor: pointer; }
.leadform__consent input { margin-top: .2rem; flex: none; }

.leadform__submit {
  display: inline-block;
  padding: .8rem 2.6rem;
  border: 0;
  border-radius: 4px;
  background: var(--lf-accent);
  color: #fff;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .2s;
}
.leadform__submit:hover, .leadform__submit:focus-visible { background: var(--lf-accent-hover); }
.leadform__submit[disabled] { opacity: .7; cursor: wait; }

.leadform__status { margin-top: 1rem; padding: .75rem 1rem; border-radius: 4px; }
.leadform__status--ok { background: #e8f5e9; color: var(--lf-ok); border: 1px solid #a5d6a7; }
.leadform__status--error { background: #ffebee; color: var(--lf-error); border: 1px solid #ef9a9a; }
.leadform--sent .leadform__row, .leadform--sent .leadform__actions, .leadform--sent .leadform__intro { display: none; }

/* Всплывающее окно */
.leadform-dialog {
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.5rem 1.5rem 1rem;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  background: #fffcd7;
}
.leadform-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.leadform-dialog__title { font-size: 1.35rem; font-weight: 700; margin: 0 2rem 1rem 0; color: #222; }
.leadform-dialog__close {
  position: absolute; top: .4rem; right: .6rem;
  border: 0; background: none; font-size: 2rem; line-height: 1; color: #666; cursor: pointer;
}
.leadform-dialog .leadform__submit { width: 100%; font-size: 1.15rem; }

.leadform-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 1000;
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem .7rem .8rem;
  border: 0; border-radius: 40px;
  background: #2e9e44; color: #fff;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  cursor: pointer;
  animation: leadform-pulse 2.5s infinite;
}
.leadform-fab:hover { background: #238636; }
@keyframes leadform-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 158, 68, .6), 0 4px 14px rgba(0, 0, 0, .3); }
  70% { box-shadow: 0 0 0 16px rgba(46, 158, 68, 0), 0 4px 14px rgba(0, 0, 0, .3); }
  100% { box-shadow: 0 0 0 0 rgba(46, 158, 68, 0), 0 4px 14px rgba(0, 0, 0, .3); }
}
@media (prefers-reduced-motion: reduce) { .leadform-fab { animation: none; } }

@media (max-width: 767px) {
  .leadform__body--side { grid-template-columns: 1fr; }
  .leadform__side { display: none; }
  .leadform-fab__text { display: none; }
  .leadform-fab { padding: .8rem; }
}
