/* ============================================================
   v2 bridge: функциональные компоненты старого сайта (модалка
   звонка, лид-форма, чат-виджет) в токенах «Ночной охоты».
   Разметка партиалов не меняется — перекрашиваем классы.
   ============================================================ */

[x-cloak] { display: none !important; }

/* ---------- Модалка «Заказать звонок» ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 9, 16, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(440px, 100%); max-height: 92svh; overflow: auto;
  background: linear-gradient(180deg, var(--panel), var(--deep));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.6rem; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.modal-close {
  position: absolute; top: .6rem; right: .8rem; background: none; border: 0;
  color: var(--dim); font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-title { font-family: 'Russo One', sans-serif; text-transform: uppercase; margin: 0 0 .4rem; }
.modal .muted { color: var(--dim); font-size: .92rem; }

/* ---------- Лид-форма (партиал partials/lead_form.html) ---------- */
.lead-form .field { margin-bottom: .85rem; display: grid; gap: .35rem; }
.lead-form label { font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.lead-form input, .lead-form select, .lead-form textarea {
  font: 600 .98rem 'Onest', sans-serif; color: var(--ink);
  background: rgba(20, 34, 52, .9); border: 1px solid var(--line); border-radius: 8px;
  padding: .85rem 1rem; outline: none; min-height: 44px; width: 100%;
  transition: border-color .25s, box-shadow .25s;
}
.lead-form input:focus, .lead-form select:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(70, 242, 126, .18); }
.lead-form ::placeholder { color: rgba(172, 195, 214, .55); }
.lead-form .hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--acid); color: #04270F; border: 0; border-radius: 8px; cursor: pointer;
  font: 700 .98rem 'Onest', sans-serif; padding: .9rem 1.4rem; min-height: 46px;
  box-shadow: 0 0 0 1px rgba(70, 242, 126, .5), 0 10px 30px -12px rgba(70, 242, 126, .5);
  transition: transform .2s, box-shadow .2s;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--acid), 0 14px 40px -12px rgba(70, 242, 126, .7); }
.btn-block { width: 100%; }
.form-hint { font-size: .78rem; color: var(--dim); margin: .7rem 0 0; }
.lead-success { color: var(--ink); }
.spinner { display: none; }
.htmx-request .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: v2spin .7s linear infinite; }
@keyframes v2spin { to { transform: rotate(360deg); } }

/* ---------- Чат-виджет (партиал partials/chat_widget.html) ---------- */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 110;
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(70, 242, 126, .5);
  background: var(--panel); color: var(--acid); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6), 0 0 18px rgba(70, 242, 126, .25);
  transition: transform .2s;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-panel {
  position: fixed; right: 18px; bottom: 84px; z-index: 115;
  min-width: 300px; max-width: calc(100vw - 24px); max-height: 76svh;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, var(--panel), var(--deep));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.chat-title { font-family: 'Russo One', sans-serif; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.chat-x { background: none; border: 0; color: var(--dim); cursor: pointer; }
.chat-x:hover { color: var(--ink); }
.chat-choice { display: flex; gap: .5rem; padding: .7rem 1rem 0; }
.chat-choice-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 700 .8rem 'Onest', sans-serif; color: var(--ink);
  background: rgba(20, 34, 52, .9); border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .6rem; cursor: pointer; min-height: 40px;
}
.chat-choice-btn:hover { border-color: var(--acid); color: var(--acid); }
.chat-log { flex: 1; overflow-y: auto; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem; min-height: 120px; }
.chat-msg { max-width: 85%; padding: .55rem .8rem; border-radius: 10px; font-size: .92rem; line-height: 1.45; }
.chat-msg.user { align-self: flex-end; background: rgba(70, 242, 126, .16); border: 1px solid rgba(70, 242, 126, .3); }
.chat-msg.assistant, .chat-msg.operator { align-self: flex-start; background: rgba(140, 180, 220, .1); border: 1px solid var(--line); }
.chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .5rem; }
.chat-act {
  font: 600 .78rem 'Onest', sans-serif; color: var(--cyanx);
  background: none; border: 1px solid rgba(55, 214, 255, .35); border-radius: 999px;
  padding: .35rem .8rem; cursor: pointer;
}
.chat-act:hover { background: rgba(55, 214, 255, .12); }
.chat-contact { padding: .7rem 1rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; }
.chat-contact-title { font-size: .85rem; color: var(--dim); }
.chat-contact input {
  font: 600 .92rem 'Onest', sans-serif; color: var(--ink);
  background: rgba(20, 34, 52, .9); border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem .8rem; outline: none;
}
.chat-contact input:focus { border-color: var(--acid); }
.chat-contact-row { display: flex; gap: .5rem; }
.chat-contact-send { flex: 1; background: var(--acid); color: #04270F; border: 0; border-radius: 8px; font-weight: 700; padding: .6rem; cursor: pointer; }
.chat-contact-close { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); padding: .6rem .9rem; cursor: pointer; }
.chat-input { display: flex; gap: .5rem; padding: .7rem 1rem .9rem; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; font: 600 .95rem 'Onest', sans-serif; color: var(--ink);
  background: rgba(20, 34, 52, .9); border: 1px solid var(--line); border-radius: 8px;
  padding: .65rem .9rem; outline: none;
}
.chat-input input:focus { border-color: var(--acid); }
.chat-input button { background: none; border: 0; color: var(--acid); cursor: pointer; }
.chat-resize-handle { position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; cursor: nwse-resize; border-left: 2px solid var(--line); border-top: 2px solid var(--line); border-radius: 3px 0 0 0; }

/* Липкая кнопка «Заказать звонок» (fab из base) */
.fab-call {
  position: fixed; left: 18px; bottom: 18px; z-index: 110;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--acid); color: #04270F; display: grid; place-items: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6), 0 0 22px rgba(70, 242, 126, .4);
  animation: fabpulse 3s ease-in-out infinite;
}
@keyframes fabpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .fab-call { animation: none; } }
