/**
 * EL How-order — layout + CMW chat widget skin only.
 * Text/cards/form typography stays on el-terms + el-lead-form.
 */

/* Cards with подложками — верхний ряд */
.elho-cards-top {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.elho-cards-note {
  margin-bottom: clamp(20px, 3vw, 28px);
}

/* Нижний ряд: чат и форма 50/50, одна высота */
.elho-bottom {
  --elho-row-h: clamp(360px, 48vh, 500px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}

.elho-chat-slot,
.elho-form-slot {
  min-width: 0;
}

/* Чат — высота как в aa-own; не растягивать на 100% (ломает scroll) */
.elho-chat-scope.aa-own {
  padding: 0;
  background: transparent;
  --aa-gold: #e6c98a;
  --aow-cmw-h: var(--elho-row-h);
  --aow-cmw-radius: 12px;
  --aow-cmw-blur: 12px;
  min-height: 0;
}

.elho-chat-scope .aow-chat.aow-chat--cmw {
  width: 100%;
  height: var(--aow-cmw-h, var(--elho-row-h));
  max-height: var(--aow-cmw-h, var(--elho-row-h));
  min-height: 0;
  overflow: hidden;
}

/* Цепочка flex для прокрутки ленты сообщений */
.elho-chat-scope .aow-chat--cmw .cmw-widget-host,
.elho-chat-scope .aow-chat--cmw .cmw-widget,
.elho-chat-scope .aow-chat--cmw .cmw-widget__card,
.elho-chat-scope .aow-chat--cmw .cmw-widget__panel {
  min-height: 0 !important;
  overflow: hidden !important;
}

.elho-chat-scope .aow-chat--cmw .cmw-widget__messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.elho-chat-scope .aow-chat--cmw .cmw-widget-host {
  --cmw-radius: 12px !important;
  border-radius: 12px !important;
}

/* Форма — рамка в стиле чата (glass + gold border) */
.elho-form-slot .elbe-lead-form-wrap {
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  width: 100%;
  min-height: var(--elho-row-h);
  height: 100%;
  padding: clamp(16px, 2vw, 20px);
  text-align: left;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(230, 201, 138, 0.12), transparent 42%),
    rgba(6, 10, 20, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.elho-form-slot .elbe-lead-form-title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.elho-form-slot .elbe-lead-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  min-height: 0;
}

.elho-form-slot .elbe-lead-form__fields {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.elho-form-slot .elbe-lead-form__label {
  gap: 6px;
}

.elho-form-slot .elbe-lead-form__input {
  border-radius: 10px;
}

.elho-form-slot .elbe-lead-form__submit {
  align-self: stretch;
  width: 100%;
  margin-top: auto;
  padding-top: 14px;
}

.elho-form-slot .elbe-lead-form__ok {
  margin-top: auto;
}

@media (max-width: 860px) {
  .elho-bottom {
    grid-template-columns: 1fr;
  }

  .elho-form-slot .elbe-lead-form-wrap {
    min-height: 360px;
  }
}
