/* Слой регистрации на новом лендинге (#registration, открывается кнопкой «Выбрать набор»).
   Структура — как у старого лендинга: слева «Вернуться назад» и «Выбранный вход»,
   справа форма (её рисует packs-registration-3.js). Подключается после styles-12.css
   и new-landing-2.css. Класс .glass здесь не используется намеренно: reveal-2.js и
   glass-2.js обрабатывают .glass при загрузке, а слой в это время скрыт. */

/* Свой фон: слой перекрывает лендинг целиком, а фон страницы (body::before) под ним */
.registration {
  background: #0b2a55 url("images/page-background-2.png") center / cover no-repeat;
}

.join-page {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 24px 0 64px;
}

.join-layout {
  display: grid;
  gap: 16px;
}

/* --- Стеклянные карточки */

.join-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  background: rgba(231, 237, 248, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(110%);
  backdrop-filter: blur(24px) saturate(110%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.join-aside {
  display: grid;
  gap: 16px;
  align-content: start;
}

/* --- «Вернуться назад» */

.join-card--back {
  padding: 0;
}

.join-card--back .registration__back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: inherit;
  color: #fff;
  font-size: 16px;
  transition: background 0.2s ease;
}

.join-card--back .registration__back:hover {
  background: rgba(231, 237, 248, 0.1);
}

.registration__back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- «Выбранный вход» */

.join-choice {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
}

.join-choice__label {
  grid-column: 1 / -1;
  color: #c5e3fe;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.join-choice__image {
  grid-row: 2 / span 2;
  width: 88px;
  height: 88px;
  margin-top: 16px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.9);
}

.join-choice__image[hidden] {
  display: none;
}

.join-choice__product {
  align-self: end;
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.join-choice__change {
  align-self: start;
  justify-self: start;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c5e3fe;
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.join-choice__change:hover {
  color: #fff;
}

/* --- Панель с формой */

.join-panel .registration__eyebrow {
  color: #c5e3fe;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.join-panel .registration__title {
  width: auto;
  margin-top: 10px;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* Поля: в styles-12.css они тёмные под старый тёмный фон — на голубом стекле
   делаем их полупрозрачными с тёмно-синим тоном */
.join-panel .registration-form {
  margin-top: 28px;
}

.join-panel .registration-form label {
  color: #dbeeff;
  font-weight: 400;
}

.join-panel .registration-form input,
.join-panel .registration-form select {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.28);
  background-color: rgba(6, 26, 58, 0.42);
  color: #fff;
}

.join-panel .registration-form select option {
  background: #0b2a55;
  color: #fff;
}

.join-panel .registration-form input:hover,
.join-panel .registration-form select:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.join-panel .registration-form input:focus,
.join-panel .registration-form select:focus {
  border-color: #c5e3fe;
  box-shadow: 0 0 0 3px rgba(197, 227, 254, 0.3);
}

/* Ошибки: розовый текст на голубом стекле не читается — текст белый, а ошибку
   обозначают красная рамка поля и красная точка перед сообщением */
.join-panel .registration-form__field.is-invalid label {
  color: #fff;
}

.join-panel .registration-form__field.is-invalid input,
.join-panel .registration-form__field.is-invalid select {
  border-color: #ff5c70;
  color: #fff;
  box-shadow: 0 0 0 1px #ff5c70;
}

.join-panel .registration-form__field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 13px;
}

.join-panel .registration-form__field-error::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5c70;
}

.join-panel .registration-form__field-error[hidden] {
  display: none;
}

.join-panel .registration-form__error {
  padding: 12px 16px;
  border: 1px solid rgba(255, 92, 112, 0.6);
  border-radius: 14px;
  background: rgba(90, 10, 30, 0.45);
  color: #fff;
  font-size: 14px;
}

.join-panel .registration-form__error[hidden] {
  display: none;
}

/* margin-top у .button в styles-12.css — под кнопку в hero, в форме он не нужен */
.join-panel .registration-form__submit .button {
  margin-top: 0;
  min-height: 60px;
  font-size: 18px;
  white-space: normal;
  text-align: center;
}

/* --- Планшеты: «Назад» полосой сверху, под ней «Выбранный вход», форма в две колонки */

@media (min-width: 600px) {
  .join-page {
    width: min(100% - 48px, 1180px);
    padding-top: 32px;
  }

  .join-card {
    border-radius: 32px;
  }

  .join-choice,
  .join-panel {
    padding: 32px;
  }

  .join-choice {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .join-choice__image {
    width: 96px;
    height: 96px;
  }

  .join-panel .registration__title {
    font-size: 34px;
  }

  .join-panel .registration-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .join-panel .registration-form__error,
  .join-panel .registration-form__submit {
    grid-column: 1 / -1;
  }
}

/* --- Десктоп: как на старом лендинге — колонка 360px слева, форма справа */

@media (min-width: 1024px) {
  .join-page {
    padding-top: 64px;
    padding-bottom: 96px;
  }

  .join-layout {
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
  }

  .join-aside {
    position: sticky;
    top: 24px;
    grid-template-columns: minmax(0, 1fr);
  }

  .join-card {
    border-radius: 40px;
  }

  .join-choice {
    display: block;
    padding: 32px;
  }

  .join-choice__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-top: 20px;
    border-radius: 24px;
  }

  .join-choice__product {
    margin-top: 20px;
    font-size: 30px;
  }

  .join-choice__change {
    margin-top: 16px;
    font-size: 16px;
  }

  .join-panel {
    padding: 48px;
  }

  .join-panel .registration__title {
    font-size: 40px;
  }
}

/* «Перейти в магазин без регистрации» — под кнопкой регистрации */
.join-panel .registration-form__submit .registration__shop-link {
  display: flex;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  font-size: 17px;
}
