/* OAuth-модалка (VK ID, Яндекс, Telegram, OK, MAX).
 * Палитра шаблона HotFlix: #1a191f / #222028 / акцент #f9ab00.
 * Классы с префиксом .oauth-modal, чтобы не задевать .sign__* из main.css.
 */

.sign__btn--social {
  gap: 10px;
  text-transform: none;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.sign__btn--social i {
  font-size: 18px;
}

.oauth-modal-open {
  overflow: hidden;
}

.oauth-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.oauth-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.oauth-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 10, 14, 0.78);
  backdrop-filter: blur(3px);
}

.oauth-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  background-color: #1a191f;
  border: 1px solid #222028;
  border-radius: 12px;
  padding: 26px 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s ease;
  outline: none;
}

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

.oauth-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b8b95;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.oauth-modal__close:hover,
.oauth-modal__close:focus-visible {
  color: #fff;
  background-color: #222028;
  outline: none;
}

.oauth-modal__close i {
  font-size: 20px;
}

.oauth-modal__title {
  margin: 0 0 6px;
  padding-right: 32px;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
}

.oauth-modal__subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #8b8b95;
}

.oauth-modal__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oauth-modal__provider {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.oauth-modal__provider:hover {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.oauth-modal__provider:focus-visible {
  outline: 2px solid #f9ab00;
  outline-offset: 2px;
}

.oauth-modal__provider.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
  transform: none;
}

.oauth-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.16);
}

.oauth-modal__icon i {
  font-size: 20px;
  line-height: 1;
}

.oauth-modal__icon--text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.oauth-modal__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.oauth-modal__label {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oauth-modal__hint {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.78);
}

.oauth-modal__arrow {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.7;
}

.oauth-modal__provider--vk { background-color: #0077ff; }
.oauth-modal__provider--yandex { background-color: #fc3f1d; }
.oauth-modal__provider--telegram { background-color: #229ed9; }
.oauth-modal__provider--ok { background-color: #ee8208; }
.oauth-modal__provider--max { background-image: linear-gradient(135deg, #2e7cf6, #7b61ff); }

.oauth-modal__notice {
  display: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.oauth-modal__notice.is-visible {
  display: block;
}

.oauth-modal__notice--error {
  background-color: rgba(223, 74, 50, 0.14);
  border: 1px solid rgba(223, 74, 50, 0.45);
  color: #ffb4a8;
}

.oauth-modal__notice--info {
  background-color: rgba(249, 171, 0, 0.1);
  border: 1px solid rgba(249, 171, 0, 0.35);
  color: #f3d08a;
}

.oauth-modal__note {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #6f6f79;
  text-align: center;
}

/* Тост о результате входа — вне диалога, чтобы пережить закрытие модалки. */
.oauth-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1090;
  transform: translate(-50%, 16px);
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background-color: #222028;
  border: 1px solid #2e2d36;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.oauth-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.oauth-toast--error {
  border-color: rgba(223, 74, 50, 0.55);
}

@media (max-width: 420px) {
  .oauth-modal {
    padding: 12px;
  }

  .oauth-modal__dialog {
    padding: 22px 16px 16px;
  }

  .oauth-modal__title {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oauth-modal,
  .oauth-modal__dialog,
  .oauth-modal__provider,
  .oauth-toast {
    transition: none;
  }
}
