/* ==========================================================================
   Помощник встречи выпускников.

   Окно диалога фиксированной высоты: лента прокручивается внутри, а поле
   ответа всегда на виду — иначе на телефоне после каждого вопроса пришлось
   бы искать, куда писать.
   ========================================================================== */

.bot { width: min(100% - 48px, 760px); margin: 0 auto; padding: 48px 0 72px; }
.bot-head { margin-bottom: 22px; }
.bot-head h1 { margin: 8px 0 12px; color: var(--green); font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); font-weight: 500; line-height: 1.06; }
.bot-when { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; color: var(--muted); font-size: 15px; }
.bot-when b { color: var(--ink); font-weight: 800; }

.bot-window { display: flex; flex-direction: column; overflow: hidden; height: min(72vh, 640px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--shadow); }
.bot-feed { flex: 1 1 auto; overflow-y: auto; padding: 22px 20px 6px; scroll-behavior: smooth; }
.bot-dock { flex: 0 0 auto; padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--wash); }

/* ------------------------------------------------------------- реплики */
.bot-msg { display: flex; margin-bottom: 12px; }
.bot-msg.is-me { justify-content: flex-end; }
.bot-bubble { max-width: 84%; padding: 12px 16px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; }
.bot-msg.is-bot .bot-bubble { border-bottom-left-radius: 5px; background: var(--wash); color: var(--text); }
.bot-msg.is-me .bot-bubble { border-bottom-right-radius: 5px; background: var(--green); color: var(--white); }
.bot-bubble a { color: var(--teal); text-decoration: underline; }
.bot-msg.is-me .bot-bubble a { color: #cfe6dc; }

/* Три точки, пока «печатает»: без них ответы появляются рывком. */
.bot-msg.is-typing .bot-bubble { display: flex; gap: 4px; padding: 15px 16px; }
.bot-msg.is-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .4; animation: bot-dot 1s infinite; }
.bot-msg.is-typing i:nth-child(2) { animation-delay: .15s; }
.bot-msg.is-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bot-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Сводка перед отправкой. */
.bot-sum { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.bot-sum th, .bot-sum td { padding: 7px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.bot-sum th { width: 45%; padding-right: 14px; color: var(--muted); font-weight: 600; }
.bot-sum td { color: var(--ink); font-weight: 700; }
.bot-sum tr:last-child th, .bot-sum tr:last-child td { border-bottom: 0; }

.bot-consent { font-size: 13.5px; line-height: 1.55; }

/* ------------------------------------------------------------ управление */
.bot-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.bot-choice { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--green); font-size: 14.5px; font-weight: 700; text-align: center; transition: border-color .16s, background .16s, color .16s; }
.bot-choice:hover { border-color: var(--green); }
.bot-choice.is-main { border-color: var(--green); background: var(--green); color: var(--white); }
.bot-choice.is-main:hover { background: var(--green-2); border-color: var(--green-2); }
.bot-choice:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.bot-ask { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bot-field { flex: 1 1 200px; min-width: 0; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--text); font-size: 15.5px; }
.bot-field:focus { border-color: var(--teal); outline: none; }
.bot-send { height: 44px; padding: 0 20px; border: 1px solid var(--green); border-radius: 999px; background: var(--green); color: var(--white); font-size: 14.5px; font-weight: 700; }
.bot-send:hover { background: var(--green-2); border-color: var(--green-2); }
.bot-skip { height: 44px; padding: 0 16px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: underline; }
.bot-skip:hover { color: var(--green); }
.bot-hint { flex: 1 1 100%; margin: 0; color: #b3462f; font-size: 13.5px; }

/* Галочка согласия: кликабельна вся строка, а кнопка до отметки не работает. */
.bot-consent-form { display: grid; gap: 12px; }
.bot-check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 13px; line-height: 1.5; cursor: pointer; }
.bot-check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green); cursor: pointer; }
.bot-check a { color: var(--teal); text-decoration: underline; }
.bot-consent-form .bot-choice { justify-self: start; }
.bot-consent-form .bot-choice:disabled { border-color: var(--line); background: var(--line); color: var(--muted); cursor: not-allowed; }

.bot-legal { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.bot-legal a { color: var(--teal); text-decoration: underline; }

/* -------------------------------------------------------------- телефоны */
@media (max-width: 720px) {
  .bot { width: min(100% - 32px, 760px); padding: 32px 0 48px; }
  /* Окно во весь доступный экран: на телефоне диалог — это вся страница. */
  .bot-window { height: min(76vh, 620px); border-radius: 14px; }
  .bot-feed { padding: 16px 14px 4px; }
  .bot-dock { padding: 12px 14px 14px; }
  .bot-bubble { max-width: 90%; font-size: 15px; }
  .bot-choice { min-height: 44px; }
  .bot-check { font-size: 13.5px; }
  .bot-check input { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .bot-feed { scroll-behavior: auto; }
  .bot-msg.is-typing i { animation: none; }
  .bot-choice { transition: none; }
}

/* ==========================================================================
   Плавающая кнопка помощника на остальных страницах.
   Диалог открывается панелью на месте: уводить человека со страницы ради
   четырёх вопросов незачем.
   ========================================================================== */

.bot-bubble-root { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.bot-fab { display: inline-flex; gap: 10px; align-items: center; height: 54px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; background: var(--green); color: #fff; font-family: var(--sans); font-size: 15px; font-weight: 700; box-shadow: 0 12px 34px rgba(0, 88, 62, .34); transition: background .18s, transform .18s, box-shadow .18s; }
.bot-fab:hover { background: var(--green-2); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 88, 62, .4); }
.bot-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.bot-fab-icon { display: grid; place-items: center; }
.bot-bubble-root.is-open .bot-fab-label { display: none; }
.bot-bubble-root.is-open .bot-fab { padding: 0; width: 54px; justify-content: center; }

.bot-panel { display: flex; flex-direction: column; overflow: hidden; width: min(94vw, 400px); height: min(72vh, 580px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 26px 70px rgba(15, 40, 35, .26); }
.bot-panel[hidden] { display: none; }
.bot-panel-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--line); background: var(--green); color: #fff; }
.bot-panel-head b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 500; line-height: 1.25; }
.bot-panel-head span { display: block; margin-top: 3px; color: rgba(255, 255, 255, .78); font-size: 12px; }
.bot-panel-close { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; line-height: 1; }
.bot-panel-close:hover { background: rgba(255, 255, 255, .26); }

/* Внутри панели у диалога нет своих полей и рамки — их даёт сама панель. */
.bot-panel .bot { width: auto; min-height: 0; padding: 0; flex: 1 1 auto; display: flex; }
.bot-panel .bot-window { flex: 1 1 auto; height: auto; border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 720px) {
  .bot-bubble-root { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .bot-fab { align-self: flex-end; height: 52px; }
  /* На телефоне панель занимает почти весь экран: иначе в ней не поговорить. */
  .bot-panel { width: auto; height: min(78vh, 560px); }
}

@media (prefers-reduced-motion: reduce) {
  .bot-fab { transition: none; }
  .bot-fab:hover { transform: none; }
}
