/* CHAT SECTION */

.chat-section {
  width: 100%;
  padding: 88px 20px;
  background: var(--color-background, #faf9f6);
}

.chat-section__container {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.chat-section__intro {
  max-width: 700px;
  margin: 0 auto 38px;
  text-align: center;
}

.chat-section__eyebrow {
  margin: 0 0 12px;
  color: var(--color-primary, #756247);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.chat-section__title {
  margin: 0;
  color: var(--color-heading, #222722);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.chat-section__description {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--color-text-muted, #68706b);
  font-size: 16px;
  line-height: 1.75;
}

.chat-section__panel {
  width: min(100%, 620px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e5e1da);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(35, 31, 25, 0.08);
}

.chat-section__panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border, #e9e6df);
}

.chat-section__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-section__avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary, #756247);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.chat-section__chat-title {
  margin: 0;
  color: var(--color-heading, #252a26);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
}

.chat-section__status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: var(--color-text-muted, #707772);
  font-size: 12px;
  line-height: 1.4;
}

.chat-section__status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #5b8065;
}

.chat-section__messages {
  min-height: 250px;
  max-height: 390px;
  padding: 22px 20px;
  overflow-y: auto;
  background: #fcfbf9;
}

.chat-section__empty {
  margin-bottom: 14px;
  color: #858b87;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.chat-section__message {
  display: flex;
  margin-bottom: 12px;
}

.chat-section__message--agent {
  justify-content: flex-start;
}

.chat-section__message--customer {
  justify-content: flex-end;
}

.chat-section__bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 14px;
  color: #343a36;
  background: #eeece7;
  font-size: 14px;
  line-height: 1.55;
}

.chat-section__message--agent .chat-section__bubble {
  border-bottom-left-radius: 4px;
}

.chat-section__message--customer .chat-section__bubble {
  border-bottom-right-radius: 4px;
  color: #ffffff;
  background: var(--color-primary, #756247);
}

.chat-section__form-area {
  padding: 20px;
  border-top: 1px solid var(--color-border, #e9e6df);
}

.chat-section__form {
  display: grid;
  gap: 14px;
}

.chat-section__field {
  display: grid;
  gap: 7px;
}

.chat-section__label {
  color: var(--color-heading, #343a36);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
}

.chat-section__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--color-border, #dcd8d0);
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: var(--color-heading, #252a26);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.chat-section__textarea {
  min-height: 90px;
  resize: vertical;
}

.chat-section__input::placeholder {
  color: #969b97;
}

.chat-section__input:focus {
  border-color: var(--color-primary, #756247);
  box-shadow: 0 0 0 3px rgba(117, 98, 71, 0.12);
}

.chat-section__form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chat-section__feedback {
  min-height: 20px;
  margin: 0;
  color: #737975;
  font-size: 12px;
  line-height: 1.5;
}

.chat-section__feedback--success {
  color: #50705a;
}

.chat-section__feedback--error {
  color: #a2544e;
}

.chat-section__send,
.chat-section__cta-button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.chat-section__send {
  min-height: 46px;
  padding: 11px 18px;
  flex: 0 0 auto;
  background: var(--color-primary, #756247);
  color: #ffffff;
}

.chat-section__send:hover,
.chat-section__cta-button:hover {
  transform: translateY(-1px);
  background: var(--color-primary-dark, #62523b);
}

.chat-section__send:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.chat-section__send:focus-visible,
.chat-section__cta-button:focus-visible {
  outline: 3px solid rgba(117, 98, 71, 0.25);
  outline-offset: 3px;
}

.chat-section__footer {
  padding: 13px 20px;
  border-top: 1px solid var(--color-border, #e9e6df);
  color: #858b87;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.chat-section__cta {
  margin-top: 24px;
  text-align: center;
}

.chat-section__cta-button {
  min-height: 50px;
  padding: 13px 28px;
  background: var(--color-primary, #756247);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(67, 54, 37, 0.12);
}

.chat-section__cta-note {
  margin: 9px 0 0;
  color: #858b87;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .chat-section {
    padding: 64px 16px;
  }

  .chat-section__intro {
    margin-bottom: 28px;
  }

  .chat-section__description {
    font-size: 15px;
    line-height: 1.65;
  }

  .chat-section__panel {
    border-radius: 16px;
  }

  .chat-section__messages {
    min-height: 230px;
    padding: 18px 14px;
  }

  .chat-section__form-area {
    padding: 16px;
  }

  .chat-section__form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-section__send {
    width: 100%;
  }

  .chat-section__bubble {
    max-width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-section__input,
  .chat-section__send,
  .chat-section__cta-button {
    transition: none;
  }
}