/* =========================================================
   IT Help Widget — Elementor friendly
   НЕТ управления фоном секции, НЕТ управления типографикой.
   Оставляем: тени/карточки/кнопки/модалку.
   ========================================================= */

.ithw-root{
  /* переменные только для собственных элементов */
  --line: rgba(255,255,255,.12);
  --shadow: 0 18px 46px rgba(0,0,0,.28);
  --shadow-strong: 0 22px 60px rgba(0,0,0,.35);
  --radius: 18px;
  --btnh: 52px;

  --accent: #4da3ff;
  --accent2:#2b7bd8;
  --ok: #34d399;

  /* ВАЖНО: НЕ трогаем глобальные шрифты/цвета */
  font-family: inherit;
  color: inherit;
}

.ithw-root *{ box-sizing: border-box; }

.ithw-wrap{
  background: transparent; /* фон делает Elementor */
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.ithw-main{ padding: 0; }

/* Сетка: всегда компактная (одна колонка) */
.ithw-hero{
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Карточка */
.ithw-card{
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.14); /* легкая стеклянность на фоне секции */
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ithw-card-inner{
  padding: 22px 22px;
}

/* НЕ управляем h2/p, но можно чуть подправить отступы (без font-size) */
.ithw-title{ margin: 0 0 10px; }
.ithw-subtitle{ margin: 0 0 14px; }

/* Кнопки */
.ithw-cta{
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.ithw-btn{
  height: var(--btnh);
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
  transition: transform .08s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.ithw-btn:hover{
  border-color: rgba(77,163,255,.45);
  background: rgba(77,163,255,.10);
  box-shadow: 0 12px 28px rgba(77,163,255,.10);
}
.ithw-btn:active{ transform: translateY(1px); }

.ithw-btn-primary {
    color: #fff;
    border-color: rgba(255, 80, 80, .55);
    background: linear-gradient(
        180deg,
        rgba(255, 80, 80, .95),
        rgba(210, 45, 45, .95)
    );
    box-shadow: 0 16px 40px rgba(255, 80, 80, .18);
}

.ithw-btn-primary:hover{
 /* background: linear-gradient(180deg, rgba(77,163,255,1), rgba(43,123,216,1));*/
   background: linear-gradient(180deg, rgba(255, 80, 80, 1), rgba(190, 35, 35, 1));
  border-color: rgba(255, 80, 80, .75);
  box-shadow: 0 16px 40px rgba(255, 80, 80, .22);
}

.ithw-btn-ghost{
  background: transparent;
}

/* KPI чипы */
.ithw-kpis{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ithw-kpi{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  opacity: .92;
  font-size: 13px; /* если хочешь — уберу вообще, но обычно норм для бейджей */
}

/* =========================
   MODAL
   ========================= */
.ithw-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999999;
}

.ithw-backdrop.open{ display:flex; }

.ithw-modal{
  width: min(920px, 100%);
  height: min(680px, 92vh);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 18, 32, .92);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  display: grid;
  grid-template-rows: 60px 1fr auto;
}

.ithw-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 18, 32, .70);
}

.ithw-left{ display:flex; align-items:center; gap:10px; }
.ithw-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(52,211,153,.12);
}

.ithw-modal-head b{ color:#fff; }
.ithw-modal-head small{ display:block; opacity:.75; }

.ithw-icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

/* Chat */
.ithw-chat{
  padding: 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ithw-msg{
  max-width: 82%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #e7eefc;
}

.ithw-msg.bot{
  align-self: flex-start;
  background: rgba(77,163,255,.10);
  border-color: rgba(77,163,255,.25);
}

.ithw-msg.user{
  align-self: flex-end;
  background: rgba(255,255,255,.08);
}

.ithw-meta{
  display: block;
  margin-top: 6px;
  color: rgba(231,238,252,.65);
  font-size: 11px;
}

.ithw-quick{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ithw-qbtn{
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #e7eefc;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform .08s ease, border-color .2s ease, background .2s ease;
}

.ithw-qbtn:hover{
  border-color: rgba(77,163,255,.45);
  background: rgba(77,163,255,.12);
}
.ithw-qbtn:active{ transform: translateY(1px); }
.ithw-qbtn.primary{
  background: rgba(77,163,255,.22);
  border-color: rgba(77,163,255,.50);
}

/* Composer */
.ithw-composer{
  border-top: 1px solid rgba(255,255,255,.10);
  padding: 12px;
  background: rgba(10, 18, 32, .70);
  display: grid;
  gap: 10px;
}

.ithw-leadrow{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ithw-sendrow{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.ithw-field{
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #e7eefc;
  padding: 0 14px;
  outline: none;
  font-size: 14px;
}

.ithw-field::placeholder{ color: rgba(231,238,252,.60); }

.ithw-send{
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(77,163,255,.55);
  background: linear-gradient(180deg, rgba(77,163,255,.95), rgba(43,123,216,.95));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.ithw-note{
  font-size: 12px;
  color: rgba(231,238,252,.75);
}

@media (max-width: 860px){
  .ithw-modal{ height: min(720px, 94vh); }
  .ithw-msg{ max-width: 92%; }
  .ithw-leadrow{ grid-template-columns: 1fr; }
  .ithw-sendrow{ grid-template-columns: 1fr; }
}

/* =========================================================
   FIX PACK (минимально, без ломания базы)
   ========================================================= */

/* 1) Карточка как "первый дизайн": ограничение ширины и центрирование */
.ithw-wrap{
  max-width: 860px;   /* подстрой: 780–960 */
  margin-left: auto;
  margin-right: auto;
}

/* если Elementor/тема даёт padding контейнера — оставим, но карточку центрируем */
.ithw-card{
  width: 100%;
}

/* 2) Заголовок/подзаголовок на карточке — белым (чтобы читалось) */
.ithw-title{
  color: #ffffff;
}

.ithw-subtitle{
  color: rgba(255,255,255,.80);
}

/* 3) Попап выше шапки сайта:
   Часто шапки имеют z-index 999999 и выше.
   Поднимем наш до максимально безопасного. */
.ithw-backdrop{
  z-index: 2147483647; /* max int32, перекрывает всё */
}

/* 4) На всякий случай: не даём "липким" элементам внутри темы перекрывать крестик */
.ithw-modal{
  position: relative;
}

/* 5) Если на мобиле/малых экранах надо шире — делаем почти во всю ширину */
@media (max-width: 1024px){
  .ithw-wrap{
    max-width: 100%;
  }
}

/* =========================================================
   VIEWPORT FIX: чтобы шапка модалки (и ✕) всегда влезали
   ========================================================= */

.ithw-backdrop{
  align-items: flex-start;         /* не центрируем по вертикали */
  padding-top: 16px;
  padding-bottom: 16px;
}

.ithw-modal{
  margin-top: 0;
  height: min(680px, calc(100vh - 32px)); /* гарантированно влезает */
}

@media (max-width: 860px){
  .ithw-modal{
    height: min(720px, calc(100vh - 24px));
  }
}

/* Внешняя (отдельная) кнопка — размеры и вид отдельно от кнопки в виджете */
/* =========================================================
   Standalone button — как основная (.ithw-btn + .ithw-btn-primary),
   но с отдельными размерами
   ========================================================= */
.ithw-btn.ithw-btn--standalone{
  /* размеры standalone */
  font-size: 20px;
  padding: 14px 26px;
  min-height: 58px;

  /* как у .ithw-btn */
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
  transition: transform .08s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
}

/* красная как у .ithw-btn-primary */
.ithw-btn.ithw-btn--standalone.ithw-btn-primary{
  color: #fff;
  border-color: rgba(255, 80, 80, .55);
  background: linear-gradient(180deg, rgba(255, 80, 80, .95), rgba(210, 45, 45, .95));
  box-shadow: 0 16px 40px rgba(255, 80, 80, .18);
}

.ithw-btn.ithw-btn--standalone:hover{
  border-color: rgba(255, 80, 80, .75);
  background: linear-gradient(180deg, rgba(255, 80, 80, 1), rgba(190, 35, 35, 1));
  box-shadow: 0 16px 40px rgba(255, 80, 80, .22);
}

.ithw-btn.ithw-btn--standalone:active{
  transform: translateY(1px);
}

/* маленькая */
.ithw-btn.ithw-btn--standalone.is-sm{
  font-size: 14px;
  padding: 10px 18px;
  min-height: 40px;
}

/* если Elementor/тема давит на <button> — усиливаем приоритет точечно */
button.ithw-btn.ithw-btn--standalone{
  box-sizing: border-box;
}
