:root {
  --teal: #02a99f;
  --teal-dark: #007f7a;
  --mint: #e7f7f4;
  --mint-line: #b8ddd8;
  --ink: #1f2329;
  --muted: #6d7683;
  --panel: #f3f8f7;
  --line: #dbe7e5;
  --white: #ffffff;
  --amber: #f4a11a;
  --danger: #c2413d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: transparent;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.bot-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.bot-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  gap: 14px;
  align-items: center;
  min-height: 110px;
  padding: 20px 26px 18px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(244, 161, 26, 0.16), transparent 36%),
    linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.avatar-wrap {
  position: relative;
  width: 62px;
  height: 62px;
}

.avatar {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
}

.online-dot {
  position: absolute;
  right: -1px;
  bottom: 2px;
  width: 19px;
  height: 19px;
  border: 4px solid var(--white);
  border-radius: 999px;
  background: #16d873;
}

.header-copy {
  min-width: 0;
}

.header-copy strong {
  display: block;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.header-copy span {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: transparent;
  cursor: pointer;
}

.icon-button span {
  width: 16px;
  height: 16px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 24px 24px;
  scrollbar-color: rgba(0, 127, 122, 0.28) transparent;
}

.message-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.message-avatar {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
}

.bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px 20px 20px 5px;
  background: var(--white);
  padding: 20px 22px;
  box-shadow: 0 8px 26px rgba(31, 35, 41, 0.06);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.45;
}

.bubble p {
  margin: 0;
}

.bubble p + p {
  margin-top: 18px;
}

.user-row {
  display: flex;
  justify-content: flex-end;
}

.user-bubble {
  max-width: 82%;
  border-radius: 18px 18px 5px 18px;
  background: #123847;
  color: var(--white);
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.composer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: 16px 18px 14px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-button,
.submit-button,
.secondary-button {
  min-height: 44px;
  border: 1px solid var(--mint-line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.choice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 9px 16px;
  color: #00534f;
  background: var(--mint);
  font-size: 16px;
  text-align: center;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: var(--teal);
  background: #d9f2ee;
  box-shadow: 0 8px 18px rgba(2, 169, 159, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.form-panel {
  display: grid;
  gap: 10px;
}

.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.text-input,
.textarea-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.text-input {
  height: 48px;
  padding: 0 15px;
}

.textarea-input {
  min-height: 92px;
  max-height: 150px;
  resize: vertical;
  padding: 13px 15px;
  line-height: 1.45;
}

.text-input:focus,
.textarea-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(2, 169, 159, 0.16);
}

.phone-field {
  display: block;
}

.phone-field .iti {
  width: 100%;
  --iti-border-color: var(--line);
  --iti-hover-color: rgba(2, 169, 159, 0.08);
  --iti-icon-color: #00534f;
}

.phone-field .iti__tel-input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  padding-right: 15px;
  font-size: 16px;
  font-weight: 700;
}

.phone-field .iti__tel-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(2, 169, 159, 0.16);
}

.phone-field .iti__selected-country {
  border-radius: 16px 0 0 16px;
}

.phone-field .iti__dropdown-content {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(31, 35, 41, 0.18);
}

.phone-field .iti__search-input {
  height: 42px;
  outline: none;
}

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

.submit-button {
  flex: 1;
  border-color: transparent;
  background: var(--teal-dark);
  color: var(--white);
  padding: 0 18px;
  box-shadow: 0 12px 24px rgba(0, 127, 122, 0.2);
}

.secondary-button {
  flex: 0 0 auto;
  background: var(--white);
  color: var(--teal-dark);
  padding: 0 16px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.error-text {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.bot-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 12px;
  color: #7e9d98;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .bot-shell {
    min-height: 100vh;
    border: 0;
  }

  .bot-header {
    grid-template-columns: 58px minmax(0, 1fr) 36px;
    min-height: 96px;
    padding: 16px 18px 15px;
  }

  .avatar-wrap,
  .avatar {
    width: 52px;
    height: 52px;
  }

  .online-dot {
    width: 17px;
    height: 17px;
  }

  .header-copy strong {
    font-size: 22px;
  }

  .header-copy span {
    font-size: 14px;
  }

  .messages {
    gap: 14px;
    padding: 22px 18px;
  }

  .message-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .message-avatar {
    width: 36px;
    height: 36px;
  }

  .bubble {
    padding: 16px 17px;
    font-size: 17px;
  }

  .composer {
    padding: 14px 14px 12px;
  }

  .choice-button {
    min-height: 42px;
    padding: 8px 13px;
    font-size: 14px;
  }

  .phone-field .iti__tel-input {
    height: 46px;
    font-size: 15px;
  }
}
