/* Страница входа. Цвета — те же токены, что в кабинете (style.css). */
:root {
  --navy: #17202e; --accent: #2f6fed; --accent-soft: #e8f0fe;
  --text: #1d2330; --muted: #6b7280; --line: #e5e7eb; --bg: #eef1f6;
  --ok: #e3f4e1; --ok-t: #1f7a34; --bad: #fbe0e0; --bad-t: #b42323;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  display: grid; place-items: center; min-height: 100vh; padding: 24px; }
button, input, textarea { font: inherit; color: inherit; }

.page { width: 100%; max-width: 1280px; min-height: min(760px, calc(100vh - 48px)); display: grid; grid-template-columns: 1.55fr 1fr;
  background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 60px rgba(23, 32, 46, .12); }

/* ---- левая часть ---- */
.promo { position: relative; overflow: hidden; color: #fff; padding: 56px 52px 36px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 85% 15%, #2f6fed 0%, rgba(47,111,237,0) 60%),
              radial-gradient(80% 70% at 10% 100%, #1e3f8a 0%, rgba(30,63,138,0) 70%), var(--navy); }
/* картинка-подложка: сверху затемнение, чтобы заголовок читался на любом фоне */
.promo.has-bg { background: linear-gradient(180deg, rgba(23,32,46,.82) 0%, rgba(23,32,46,.35) 38%, rgba(23,32,46,.15) 70%, rgba(23,32,46,.55) 100%),
  var(--bg-img) center / cover no-repeat, var(--navy); }
.promo h1 { margin: 0; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; }
.promo .lead { margin: 18px 0 0; font-size: clamp(16px, 1.35vw, 20px); color: #c9d6ee; max-width: 30em; }

.scene { position: relative; flex: 1; min-height: 360px; margin: 28px 0 12px; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wires path { fill: none; stroke: rgba(143, 179, 255, .55); stroke-width: 1.5; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.wires circle { fill: #8fb3ff; }

.tile { position: absolute; background: rgba(255,255,255,.97); color: var(--text); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 14px 40px rgba(5, 12, 30, .35); display: flex; gap: 12px; align-items: center; animation: float 7s ease-in-out infinite; }
.tile b { font-weight: 600; }
.tile p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; }

.t-listing { left: 0; top: 4%; width: 46%; max-width: 280px; }
.t-listing .ph { width: 74px; height: 74px; flex-shrink: 0; border-radius: 10px; object-fit: cover; display: block; background: #dde3ec; }
.t-title { font-size: 14px; }
.t-price { font-size: 19px; font-weight: 700; margin: 2px 0 6px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.chip.ok { background: var(--ok); color: var(--ok-t); }

.t-chat { right: 0; top: 0; width: 46%; max-width: 300px; flex-direction: column; align-items: stretch; gap: 8px; animation-delay: -2s; }
.msg { display: flex; flex-direction: column; max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.msg time { font-size: 10.5px; opacity: .65; margin-top: 2px; }
.msg.in { background: #f1f3f7; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.out time { text-align: right; opacity: .8; }

.t-agent { left: 26%; top: 48%; width: auto; min-width: 280px; animation-delay: -4s; }
.spark { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2f6fed, #6c9bff); animation: glow 2.8s ease-in-out infinite; }
/* орбита: точка бегает вокруг пульсирующего ядра — помощник «думает» над ответом */
.spark svg { overflow: visible; }
.spark .orbit { transform-origin: 12px 12px; animation: spin 3s linear infinite; }
.spark .core { transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-in-out infinite; }
.t-agent b { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.online { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ok-t); background: var(--ok); padding: 2px 9px 2px 7px; border-radius: 999px; }
.online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22a447; animation: blink 1.6s ease-in-out infinite; }
.typing { display: flex; align-items: baseline; gap: 2px; }
.dots { display: inline-flex; gap: 3px; margin-left: 4px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,111,237,.45); } 50% { box-shadow: 0 0 0 8px rgba(47,111,237,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }

.t-lead { left: 4%; bottom: 0; width: auto; min-width: 340px; animation-delay: -1s; }
.lead-ic { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; color: var(--ok-t); background: var(--ok); }
.t-lead b { display: flex; align-items: center; gap: 8px; }
.chip.new { background: var(--bad); color: var(--bad-t); font-size: 11.5px; padding: 1px 8px; }
/* кнопка-картинка (не нажимается): по ней пробегает блик */
.take { margin-left: auto; flex-shrink: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 13px; color: #fff; background: var(--accent);
  position: relative; overflow: hidden; white-space: nowrap; }
.take::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .tile, .spark, .spark .orbit, .spark .core, .online::before, .dots i, .take::after { animation: none; } }

.promo-foot { margin: 0; display: flex; align-items: center; gap: 14px; color: #9fb2d6; font-size: 14px; }
.promo-foot span { width: 32px; height: 1.5px; background: #9fb2d6; }

/* ---- правая часть: форма ---- */
.side { display: flex; flex-direction: column; padding: 48px 56px 28px; }
.form-wrap { flex: 1; width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--accent); margin-bottom: 36px; }
.brand span { color: var(--text); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0 0 22px; font-size: 30px; text-align: center; font-weight: 700; }

.note { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.note.ok { background: var(--ok); color: var(--ok-t); }
.note.bad { background: var(--bad); color: var(--bad-t); }

.login { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px 0 16px; border: 1.5px solid var(--line); border-radius: 12px;
  color: #8a94a6; transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,111,237,.12); color: var(--accent); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); }
.field input::placeholder { color: #8a94a6; }
.eye { border: 0; background: none; padding: 4px; cursor: pointer; color: #8a94a6; line-height: 0; border-radius: 8px; }
.eye:hover, .eye.on { color: var(--accent); }
.row-end { display: flex; justify-content: flex-end; margin-top: -4px; }

.primary { height: 56px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .05s; }
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }

.link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link.small { font-size: 14px; }

/* вторая кнопка: тот же размер, что «Войти», но спокойнее — главное действие остаётся одно */
.secondary { width: 100%; height: 56px; margin-top: 14px; border: 1.5px solid var(--accent); border-radius: 12px; background: #fff; color: var(--accent);
  font-size: 17px; font-weight: 600; cursor: pointer; transition: background .15s; }
.secondary:hover { background: var(--accent-soft); }

.support { margin: 22px auto 0; display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 16px; font-weight: 500; padding: 8px 12px; border-radius: 10px; }
.support:hover { background: var(--accent-soft); }

.foot { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }

/* ---- окно обращения ---- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(23,32,46,.3); }
dialog::backdrop { background: rgba(23, 32, 46, .5); }
dialog form { position: relative; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
dialog h3 { margin: 0; font-size: 22px; padding-right: 30px; }
dialog .muted { margin: -6px 0 4px; color: var(--muted); font-size: 14px; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
dialog input, dialog textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 15px; outline: 0; resize: vertical; }
dialog input:focus, dialog textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,111,237,.12); }
dialog .primary { height: 50px; margin-top: 4px; }
.x { position: absolute; top: 18px; right: 18px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 6px; line-height: 0; border-radius: 8px; }
.x:hover { background: #f1f3f7; }

/* ---- невысокие экраны (ноутбуки, масштаб 125–150%): ужимаемся по вертикали ---- */
@media (min-width: 1001px) and (max-height: 920px) {
  body { padding: 14px; }
  .page { min-height: calc(100vh - 28px); }
  .promo { padding: 36px 44px 24px; }
  .promo h1 { font-size: clamp(30px, 3vw, 44px); }
  .promo .lead { margin-top: 12px; font-size: 17px; }
  .scene { min-height: 300px; margin: 18px 0 8px; }
  .tile { padding: 11px 14px; }
  .t-listing .ph { width: 60px; height: 60px; }
  .side { padding: 30px 48px 18px; }
  .brand { margin-bottom: 20px; }
  h2 { font-size: 26px; margin-bottom: 16px; }
  .login { gap: 11px; }
  .field, .primary { height: 50px; }
  .secondary { height: 50px; margin-top: 11px; }
  .support { margin-top: 10px; }
  .foot { margin-top: 12px; padding-top: 12px; }
}
@media (min-width: 1001px) and (max-height: 760px) {
  .scene { min-height: 250px; }
  .promo-foot { display: none; }
}

/* ---- телефон и узкие экраны ---- */
@media (max-width: 1000px) {
  .page { grid-template-columns: 1fr; min-height: 0; }
  .promo { padding: 32px 28px; }
  .scene, .promo-foot { display: none; }
  .side { padding: 36px 28px 24px; }
  .brand { margin-bottom: 24px; }
}
@media (max-width: 560px) {
  body { padding: 0; align-items: start; }
  .page { border-radius: 0; box-shadow: none; }
  .promo { padding: 26px 16px; }
  .side { padding: 28px 16px 20px; }
  h2 { font-size: 26px; }
}
