/* Telegram auth overlay */
.tg-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  pointer-events: none;
}

.tg-auth-modal.is-open {
  display: flex;
  pointer-events: auto;
}

.tg-auth-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: tgBackdropIn 0.22s ease-out;
}

.tg-auth-modal__win {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: tgModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tg-auth-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #707579;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tg-auth-modal__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

.tg-auth-modal__win iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #fff;
}

@keyframes tgBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tgModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-height: 780px) {
  .tg-auth-modal__win iframe {
    height: calc(100vh - 56px);
  }
}
