@charset "UTF-8";

.dbx-max-chat,
.dbx-max-chat * {
  box-sizing: border-box;
}

.dbx-max-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100000;
  font-family: "Open Sans", Arial, sans-serif;
  color: #f7fbff;
}

.dbx-max-chat__toggle {
  display: grid;
  width: 60px;
  height: 60px;
  margin-left: auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #80bd35, #5aa825);
  box-shadow: 0 16px 38px rgba(53, 116, 23, 0.38);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dbx-max-chat__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(53, 116, 23, 0.46);
}

.dbx-max-chat__toggle span {
  position: relative;
  display: block;
  width: 28px;
  height: 22px;
  border-radius: 13px 13px 13px 5px;
  background: #fff;
}

.dbx-max-chat__toggle span::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 9px;
  height: 3px;
  border-radius: 4px;
  background: #73af2d;
  box-shadow: 6px 0 0 #73af2d, -6px 0 0 #73af2d;
}

.dbx-max-chat__panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  display: grid;
  width: min(380px, calc(100vw - 28px));
  max-height: min(640px, calc(100vh - 112px));
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: #171717;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dbx-max-chat--open .dbx-max-chat__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dbx-max-chat__head {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: #1b1b1b;
}

.dbx-max-chat__head strong {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.dbx-max-chat__head small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.3;
}

.dbx-max-chat__close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dbx-max-chat__messages {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px 16px;
  background: #1b1b1b;
  scrollbar-width: thin;
  scrollbar-color: #666 transparent;
}

.dbx-max-chat__message {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.dbx-max-chat__message--visitor {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: #75ad2e;
}

.dbx-max-chat__message--operator,
.dbx-max-chat__message--system {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: #2d2d3f;
}

.dbx-max-chat__message--system {
  color: rgba(255, 255, 255, 0.9);
}

.dbx-max-chat__contact {
  padding: 12px 16px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #181818;
}

.dbx-max-chat__contact label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.dbx-max-chat__contact input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  outline: 0;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.dbx-max-chat__contact input:focus {
  border-color: rgba(128, 189, 53, 0.72);
  box-shadow: 0 0 0 3px rgba(128, 189, 53, 0.14);
}

.dbx-max-chat__contact p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
  line-height: 1.35;
}

.dbx-max-chat__form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #181818;
}

.dbx-max-chat__form textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 21px;
  outline: 0;
  padding: 12px 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.dbx-max-chat__form textarea:focus {
  border-color: rgba(128, 189, 53, 0.72);
}

.dbx-max-chat__form button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #75ad2e;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.dbx-max-chat__form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 640px) {
  .dbx-max-chat {
    right: 14px;
    bottom: 14px;
  }

  .dbx-max-chat__toggle {
    width: 56px;
    height: 56px;
  }

  .dbx-max-chat__panel {
    right: -4px;
    bottom: 68px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 92px);
    border-radius: 16px;
  }

  .dbx-max-chat__messages {
    min-height: 230px;
  }
}
