/* =========================================================
   AniLog — модальное окно: панель, шапка и сетка
   ========================================================= */

/* ---------- Модальное окно ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 24px;
  visibility: hidden;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0s linear 0.34s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.22s ease, visibility 0s linear 0s;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.76);
  backdrop-filter: blur(10px) saturate(80%);
  -webkit-backdrop-filter: blur(10px) saturate(80%);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  outline: none;
  max-height: min(900px, calc(100dvh - 48px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 90% 55% at 90% 0%, rgba(139, 92, 246, 0.12), transparent 58%),
    linear-gradient(155deg, rgba(23, 24, 38, 0.98), rgba(10, 11, 19, 0.995));
  box-shadow:
    0 55px 145px rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition:
    transform 0.34s var(--ease-out),
    opacity 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Узкая панель модалки аккаунта и импорта. В широкой модалке отступы несёт
   .modal__main — здесь их нет, поэтому паддинг живёт на самой панели:
   без него контент липнет к скруглённым углам и выглядит «пожёванным». */
.modal__panel--view {
  width: min(720px, 100%);  /* после базового .modal__panel — иначе каскад перебивает ширину */
}

.modal__panel--narrow {
  width: min(460px, 100%);
  padding: 30px 30px 26px;
  border-radius: 22px;
}

.modal__panel--narrow .modal__header {
  margin-bottom: 16px;
}

.modal__panel::-webkit-scrollbar {
  width: 7px;
}

.modal__panel::-webkit-scrollbar-track {
  background: transparent;
}

.modal__panel::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  width: 38px;
  height: 38px;
}

.modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.37fr) minmax(240px, 0.73fr);
}

.modal__main {
  padding: 38px 38px 32px;
}

.modal__header .eyebrow {
  margin-bottom: 13px;
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.modal__subtitle {
  max-width: 420px;
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
