* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px;
}

/* Modal loading */
.modal__loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 1s ease-out;
}

.modal__loading.hide {
  opacity: 0;
  pointer-events: none;
}

.modal__loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.modal__loading-spinner {
  width: 72px;
  height: 72px;
}

.modal__loading-text {
  text-align: center;
}

.modal__loading-title {
  font-size: 21px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.modal__loading-subtitle {
  font-size: 19px;
  font-weight: 400;
  color: #333333;
}

.modal {
  position: relative;
  width: 505px;
  height: auto;
  /* height: 600px; */
  background: #ffffff;
  border: 2px solid #cfcfcf;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f4f4;
  padding: 14px 16px;
  border-bottom: 2px solid #d9d9d9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  height: 26px;
  width: auto;
  display: block;
}

.brand__title {
  font-size: 26px;
  font-weight: 400;
  color: #6b6b6b;
  margin-left: 4px;
}

.menu-btn {
  width: 46px;
  height: 46px;
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333333;
  border-radius: 1px;
}

/* ---------- Body ---------- */
.modal__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 46px 28px 46px;
  overflow: hidden;
  position: relative;
}

.content {
  display: none;
  height: 100%;
  flex-direction: column;
}

.content.active {
  display: flex;
}

.content.active-hidden {
  display: flex;
  opacity: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 14px;
}

.field-label__help {
  width: 22px;
  height: 22px;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.field-label__help img {
  width: 100%;
  height: 100%;
  display: block;
}

.field-label__help:hover {
  opacity: 0.75;
}

.field-label__help:active {
  transform: scale(0.92);
}

/* ---------- Dim overlay (when help is open) ---------- */
.modal__overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.modal.help-active .modal__overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, visibility 0s;
}

/* ---------- Help popover ---------- */
.help-popover {
  position: absolute;
  top: 100px;
  left: 18px;
  right: 18px;
  z-index: 20;
  background: #ffffff;
  border: 1px solid #8f8f8f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.help-popover.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.help-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #dedcde;
  border-bottom: 1px solid #b8b8b8;
  padding: 12px 16px;
}

.help-popover__title {
  font-size: 20px;
  font-weight: 700;
  color: #333333;
}

.help-popover__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 20px;
  color: #333333;
  cursor: pointer;
}

.help-popover__close:hover {
  color: #000000;
}

.help-popover__close-x {
  font-size: 22px;
  line-height: 1;
}

.help-popover__body {
  padding: 22px 30px 26px;
}

.help-popover__body p {
  font-size: 21px;
  font-weight: 500;
  color: #2b2b2b;
  line-height: 1.5;
}

.help-popover__body p + p {
  margin-top: 20px;
}

/* ---------- Input row ---------- */
.input-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.input-wrap {
  position: relative;
  flex: 1;
}

.input-wrap__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.input-field {
  width: 100%;
  height: 56px;
  border: 2.5px solid #cccccc;
  border-radius: 8px;
  padding: 0 12px 0 46px;
  font-size: 20px;
  color: #1a1a1a;
  outline: none;
  background: #ffffff;
  caret-color: #1a1a1a;
  transition: border-color 0.15s ease;
}

.input-field:focus,
.input-field:active {
  border-color: #1a6ea8;
}

.submit-btn {
  width: 78px;
  height: 56px;
  background: #2a7ab0;
  border: 1px solid #2a7ab0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;

  transition: color 0.2s ease;
}

.submit-btn:disabled {
  color: #7fa6c1;
  cursor: default;
}

.submit-btn svg {
  width: 30px;
  height: 30px;
}

.submit-btn svg path {
  stroke: currentColor;
  transition: stroke 0.15s ease;
}

.submit-btn__spinner {
  display: none;
  width: 30px;
  height: 30px;
}

.submit-btn.loading {
  cursor: default;
}

.submit-btn.loading .submit-btn__arrow {
  display: none;
}

.submit-btn.loading .submit-btn__spinner {
  display: block;
}

.hint {
  margin-top: 12px;
  font-size: 20px;
  color: #6f6f6f;
}

/* ---------- Footer ---------- */
.modal__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f4f4f4;
  border-top: 2px solid #d9d9d9;
  padding: 16px 20px;
}

.footer__shield {
  width: 34px;
  height: auto;
  display: block;
}

.footer__text {
  line-height: 1.25;
}

.footer__label {
  font-size: 18px;
  color: #6b6b6b;
}

.footer__site {
  font-size: 22px;
  color: #1a1a1a;
}

/* Push Content */
.push-message {
  text-align: center;
  padding: 9.3px 30px;
}

.push-message p {
  font-size: 26px;
  font-weight: 600;
  color: #333333;
  margin: 0;
  line-height: 1.4;
}

.push-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  margin: 23px 12px;
  background: #0066cc;
  color: #ffffff;
  border: none;
  border-radius: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.push-confirm-btn:hover:not(:disabled) {
  background: #0052a3;
}

.push-confirm-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

/* ---------- Support chat ---------- */
.support-chat {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 200;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2a7ab0;
  border: 1px solid #2a7ab0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.support-chat:hover {
  background: #1f628f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.support-chat:active {
  transform: scale(0.94);
}

.support-chat__icon {
  width: 30px;
  height: 30px;
  display: block;
}

/* ---------- Chat panel ---------- */
.chat-panel {
  position: fixed;
  right: 28px;
  bottom: 100px;
  z-index: 199;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

/* Header */
.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #2a7ab0;
  color: #ffffff;
  padding: 14px 16px;
  flex-shrink: 0;
}

.chat-panel__header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-panel__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-panel__subtitle {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.3;
}

.chat-panel__close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.chat-panel__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.chat-panel__close svg {
  width: 20px;
  height: 20px;
}

/* Messages */
.chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f6f7f9;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.chat-msg--in {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-msg--out {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg--in .chat-msg__bubble {
  background: #ffffff;
  border: 1px solid #e2e4e8;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}

.chat-msg--out .chat-msg__bubble {
  background: #2a7ab0;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg__time {
  font-size: 11px;
  color: #9a9a9a;
  margin-top: 4px;
  padding: 0 4px;
}

/* Footer */
.chat-panel__footer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e2e4e8;
  background: #ffffff;
  flex-shrink: 0;
}

.chat-panel__input {
  flex: 1;
  resize: none;
  border: 1.5px solid #cccccc;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  color: #1a1a1a;
  line-height: 1.4;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s ease;
}

.chat-panel__input:focus {
  border-color: #2a7ab0;
}

.chat-panel__send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: #2a7ab0;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.chat-panel__send:hover {
  background: #1f628f;
}

.chat-panel__send:active {
  transform: scale(0.94);
}

.chat-panel__send:disabled {
  background: #b7cede;
  cursor: default;
}

.chat-panel__send svg {
  width: 20px;
  height: 20px;
}
