/* Страница входа / регистрации — компактнее, темнее, инверт-пилюли */

body.page-auth {
  background: #000;
}

.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 48px;
  position: relative;
  z-index: 1;
}

.auth-page__card {
  width: 100%;
  max-width: 560px;
  padding: 28px 28px 30px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Регистрация — блок плавно становится шире */
.auth-page__card.is-register {
  max-width: 620px;
}

.auth-page__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Плашка на всю ширину карточки — Onder + «Регистрация» влезают */
.auth-page__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  width: 100%;
  margin: 0 auto 20px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.auth-page__tabs-thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  /* колонки 1fr / 1.2fr → доли ~45.45% / 54.55% */
  width: calc((100% - 10px) * 1 / 2.2);
  height: calc(100% - 10px);
  border-radius: 999px;
  background: #fff;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
}

.auth-page__tabs[data-active="register"] .auth-page__tabs-thumb {
  width: calc((100% - 10px) * 1.2 / 2.2);
  transform: translateX(calc(100% * 1 / 1.2));
}

.auth-page__tab {
  appearance: none;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: 'Onder', var(--font-main, sans-serif);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-transform: none;
  white-space: nowrap;
  text-align: center;
  padding: 12px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  transition: color 0.25s ease;
}

.auth-page__tab:hover,
.auth-page__tab:focus-visible {
  color: #fff;
  outline: none;
}

.auth-page__tab.is-active {
  color: rgba(0, 0, 0, 0.9);
}

.auth-page__subtitle {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
}

.auth-page__panel {
  display: none;
}

.auth-page__panel.is-active {
  display: block;
  animation: auth-panel-in 0.3s ease;
}

@keyframes auth-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-page__field {
  margin-bottom: 12px;
}

.auth-page__field label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-page__field input[type="email"],
.auth-page__field input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  /* убирает жёлтый/синий фон автозаполнения браузера */
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
}

.auth-page__field input::placeholder {
  color: rgba(255, 255, 255, 0.38);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.38);
}

.auth-page__field input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.auth-page__field input:-webkit-autofill,
.auth-page__field input:-webkit-autofill:hover,
.auth-page__field input:-webkit-autofill:focus,
.auth-page__field input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* «перекрашиваем» фон автозаполнения через длинный transition */
  -webkit-box-shadow: 0 0 0 1000px #141416 inset !important;
  box-shadow: 0 0 0 1000px #141416 inset !important;
  transition: background-color 99999s ease-in-out 0s;
}

.auth-page__notice {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.auth-page__notice a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.auth-page__notice a:hover {
  text-decoration: underline;
}

.auth-page__submit {
  width: 100%;
  margin-top: 18px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: 'Onder', var(--font-main, sans-serif);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.auth-page__submit:hover:not(:disabled),
.auth-page__submit:focus-visible:not(:disabled) {
  background: #fff;
  color: rgba(0, 0, 0, 0.9);
  border-color: #fff;
  outline: none;
}

.auth-page__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-page__message {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.auth-page__message.is-error {
  display: block;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #fecaca;
}

.auth-page__message.is-success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

@media (max-width: 520px) {
  .auth-page {
    padding: 20px 12px 40px;
  }

  .auth-page__card {
    padding: 18px 16px 20px;
    border-radius: 16px;
  }
}
