/* Авторизация — new-design/Auth.dc.html */

.nd-auth-centered {
  display: flex;
  justify-content: center;
  padding: 40px 16px 24px;
  min-height: calc(100vh - var(--nd-header-h));
}

.nd-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.nd-auth-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--nd-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 26px/1 var(--nd-font);
  flex: none;
}

.nd-auth-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nd-auth-h1 {
  margin: 18px 0 0;
  font: 500 26px/32px var(--nd-font);
}

.nd-auth-lead {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--nd-text-2);
  max-width: 36ch;
  text-wrap: pretty;
}

.nd-auth-error {
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FDECEE;
  color: #B32330;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.nd-auth-form {
  width: 100%;
}

.nd-auth-form .portal-auth-form {
  display: none;
}

.nd-auth-form .portal-vk-one-tap {
  margin-top: 20px;
}

.nd-auth-note {
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #F7F8FA;
  font-size: 14px;
  line-height: 20px;
  color: var(--nd-text-2);
  text-align: left;
}

.nd-auth-terms {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: #9AA3AD;
  max-width: 38ch;
}

body.nd .nd-auth-terms a {
  color: var(--nd-accent);
}

body.nd .nd-auth-terms a:hover {
  color: var(--nd-accent-hover);
}

/* Кнопки для вошедшего пользователя */
.nd-auth-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

body.nd .nd-auth-actions .nd-btn {
  min-height: 48px;
  height: auto;
  padding: 0 16px;
  font-size: 16px;
  border-radius: 12px;
}

body.nd .nd-auth-actions .nd-btn--primary {
  background: var(--nd-accent);
  border-color: var(--nd-accent);
  color: #fff;
}

body.nd .nd-auth-actions .nd-btn--primary:hover {
  background: var(--nd-accent-hover);
  border-color: var(--nd-accent-hover);
}

body.nd .nd-auth-actions .nd-btn--logout {
  background: #F2F3F5;
  border-color: transparent;
  color: var(--nd-text);
  cursor: pointer;
}

body.nd .nd-auth-actions .nd-btn--logout:hover {
  background: #E8EAEE;
  border-color: transparent;
}

/* Адаптив ≤700px */
@media (max-width: 700px) {
  .nd-auth-centered {
    padding: 24px 12px 16px;
  }

  .nd-auth-card {
    padding: 24px 16px;
  }

  .nd-auth-h1 {
    margin-top: 12px;
    font-size: 22px;
    line-height: 28px;
  }

  .nd-auth-lead {
    font-size: 14px;
    line-height: 20px;
  }

  .nd-auth-mark {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  body.nd .nd-auth-actions .nd-btn {
    min-height: 44px;
    font-size: 15px;
  }
}

/* ≤400px */
@media (max-width: 400px) {
  .nd-auth-card {
    padding: 20px 12px;
  }

  .nd-auth-h1 {
    margin-top: 10px;
    font-size: 20px;
    line-height: 26px;
  }

  .nd-auth-lead {
    font-size: 13px;
    line-height: 18px;
  }

  .nd-auth-mark {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .nd-auth-error,
  .nd-auth-note {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 18px;
  }

  .nd-auth-form .portal-vk-one-tap {
    margin-top: 16px;
  }

  .nd-auth-note {
    margin-top: 12px;
  }

  .nd-auth-terms {
    margin-top: 12px;
    font-size: 12px;
    line-height: 16px;
  }

  .nd-auth-actions {
    margin-top: 16px;
    gap: 6px;
  }

  body.nd .nd-auth-actions .nd-btn {
    min-height: 40px;
    font-size: 14px;
  }
}

/* Скрытое сообщение от VK (data-vk-auth-message) */
.auth-note[hidden] {
  display: none;
}

.auth-note:not([hidden]) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FDECEE;
  color: #B32330;
  font-size: 14px;
  line-height: 20px;
}
