/* ---------- Кот: заставка на входе, лапа за курсором и кот с советом дня ---------- */
/* Цвета радуги и «матрицы» заданы в cat.js: они декоративные и к теме интерфейса не относятся. */

.auth-art { position: relative; }
.auth-card { position: relative; }

.nyan {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.nyan canvas { display: block; width: 100%; height: 100%; }

/* Содержимое левой панели входа лежит поверх заставки; саму заставку правило не трогает,
   иначе canvas стал бы элементом flex-раскладки и растянул страницу. */
.auth-art > *:not(.nyan) { position: relative; z-index: 1; }

/* ---------- Лапа, которая охотится за курсором (только мышь) ---------- */

.paw {
  position: absolute;
  width: 96px;
  height: 96px;
  left: 0;
  top: 0;
  margin: -48px 0 0 -48px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  z-index: 2;
  will-change: transform;
}

.paw.on { opacity: 1; }
.paw svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }

/* ---------- Кот с советом дня ---------- */

.catvisit {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.catvisit .cat-btn {
  pointer-events: auto;
  position: relative;
  width: 108px;
  height: 96px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: cat-in .45s cubic-bezier(.2, .9, .3, 1.3);
  transform-origin: bottom center;
}

.catvisit.leaving .cat-btn { animation: cat-out .35s ease-in forwards; }
.catvisit .cat-btn svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .5)); }
.catvisit .cat-btn:hover svg { transform: translateY(-3px); transition: transform .2s; }
.catvisit .cat-btn:focus-visible { outline: var(--focus-ring); outline-offset: 4px; border-radius: var(--radius-md); }

/* Значок диалога над котом */
.cat-bubble-ic {
  position: absolute;
  top: -6px;
  right: 2px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--accent-text);
  animation: cat-nudge 1.8s ease-in-out infinite;
}

.cat-bubble-ic svg { width: 16px; height: 16px; }

/* Само облачко с советом */
.cat-tip {
  pointer-events: auto;
  position: relative;
  width: min(300px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  animation: cat-in .3s ease-out;
}

.cat-tip::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-right: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
  transform: rotate(45deg);
}

.cat-tip b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); margin-bottom: 6px; padding-right: 22px; }
.cat-tip p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }

.cat-tip .cat-off { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.cat-tip .cat-off:hover { color: var(--accent-link); }

.cat-tip .cat-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.cat-tip .cat-close:hover { background: var(--surface-3); color: var(--text); }
.cat-tip .cat-close:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.cat-tip .cat-close svg { width: 15px; height: 15px; }

@keyframes cat-in { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes cat-out { to { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes cat-nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-4px); } 90% { transform: translateY(-1px); } }
@keyframes cat-tail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(14deg); } }
@keyframes cat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

.cat-tail { transform-origin: 18px 62px; animation: cat-tail 2.4s ease-in-out infinite; }
.cat-eyes { transform-origin: center; animation: cat-blink 5.5s ease-in-out infinite; }

@media (max-width: 860px) {
  /* На телефоне панель входа низкая: заставка идёт фоном, чтобы не спорить с текстом. */
  .nyan { opacity: .45; }
  .catvisit { right: 14px; bottom: 14px; }
  .catvisit .cat-btn { width: 84px; height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .catvisit .cat-btn, .cat-tip { animation: none; }
  .cat-bubble-ic, .cat-tail, .cat-eyes { animation: none; }
}
