/* Окно бесплатной сессии на лендинге (embed.html). Повторяет макет
   ai_therapist_landing/mockup_hero_chat.html: рамку, тень и скругление
   рисует сам лендинг, здесь — только содержимое на всю высоту iframe. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

.chat { display: flex; flex-direction: column; height: 100%; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--mint-50), var(--surface));
}
.avatar {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--mint-200);
}
.chat-name { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.2; }
.chat-status { font-size: var(--fs-caption); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-400); }

.chat-log {
  flex: 1 1 auto; overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14.5px; line-height: 1.5;
  white-space: pre-line; overflow-wrap: anywhere;
  animation: msgIn .28s ease both;
}
.msg-ai { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; }
.msg-me { align-self: flex-end; background: var(--grad-accent); color: #fff; border-bottom-right-radius: 6px; }
.msg-error { align-self: flex-start; background: var(--danger-bg); color: var(--danger); font-size: 13.5px; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.typing { align-self: flex-start; background: var(--bg); border-radius: 18px 18px 18px 6px; padding: 14px 16px; display: flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.chat-foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; }
.chat-form textarea {
  flex: 1 1 auto; resize: none;
  font: inherit; font-size: 14.5px; line-height: 1.45;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 14px; min-height: 46px; max-height: 120px;
  background: var(--surface); color: var(--ink); outline: none;
  overflow-y: hidden;
}
.chat-form textarea:focus { border-color: var(--mint-300); box-shadow: 0 0 0 3px var(--mint-50); }
.send {
  width: 46px; height: 46px; flex: 0 0 auto;
  border: 0; border-radius: 14px;
  background: var(--grad-accent); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-btn);
}
.send svg { width: 20px; height: 20px; }
.send:disabled { opacity: .45; box-shadow: none; cursor: default; }
.chat-note { font-size: 11.5px; color: var(--muted); margin: 8px 2px 0; line-height: 1.4; }

.chat-locked { display: none; text-align: center; padding: 6px 4px 2px; }
.chat.is-locked .chat-form, .chat.is-locked .chat-note { display: none; }
.chat.is-locked .chat-locked { display: block; }
.chat.is-expired #chatDelete, .chat.is-member #chatDelete { display: none; }
.chat-locked h4 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.chat-locked p { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.45; }
.chat-locked p:empty, .chat-locked h4:empty { display: none; }
.chat-locked .chat-login { display: none; margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.chat.is-expired .chat-login { display: block; }
.chat-login a { color: var(--accent-text); font-weight: 600; text-underline-offset: 3px; }

.btn {
  font: inherit; font-size: 15.5px; font-weight: 600; line-height: 1;
  border: 0; border-radius: var(--r-btn);
  padding: 15px 26px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
}
.btn-primary { color: #fff; background: var(--grad-accent); box-shadow: var(--shadow-btn); }
.btn:disabled { opacity: .6; cursor: default; }
.link-quiet {
  display: inline-block; margin-top: 10px;
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 12.5px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-quiet:hover { color: var(--ink-2); }

/* iOS приближает всю страницу лендинга при фокусе на поле со шрифтом меньше
   16px и не отдаляет обратно — как в приложении (styles.css), на телефоне
   поле ввода 16px. Пользовательский zoom не запрещаем. */
@media (max-width: 760px), (hover: none) {
  .chat-form textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .chat-head { padding: 12px 14px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .msg, .typing i { animation: none; }
}
