/* =====================================================================
 * Сторінка входу/реєстрації (нова верстка).
 * Головний спосіб — телефон + SMS-код; email з паролем лишається як
 * альтернатива і живе під перемикачем.
 * ===================================================================== */

/* auth.css підключається і на старих сторінках кабінету, тому не покладаємось
   на глобальний reset із base.css. */
.auth,
.auth *,
.auth *::before,
.auth *::after {
  box-sizing: border-box;
}

.auth {
  padding: 40px 0 72px;
  /* Той самий гексагональний патерн, що на medik8.com/account/login.
     Картинка майже біла, тому текст і поля лишаються контрастними. */
  background-color: #f2f2f2;
  background-image: url("../images/auth-bg.jpg");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
}

@media (min-width: 768px) {
  .auth {
    padding: 64px 0 96px;
  }
}

.auth__grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 1024px) {
  .auth__grid {
    flex-direction: row;
    gap: 0;
  }

  .auth__col {
    width: 50%;
    padding: 0 64px;
  }

  .auth__col + .auth__col {
    border-left: 1px solid #e3e3e3;
  }
}

.auth__col {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

/* /register-site: на мобільному реєстрація над входом. */
@media (max-width: 1023px) {
  .auth__grid--register-first #auth-register {
    order: -1;
  }
}

/* Одноколонкові сторінки (новий пароль) — по центру, без роздільника. */
.auth__col--single {
  max-width: 460px;
}

@media (min-width: 1024px) {
  .auth__col--single {
    width: 100%;
    padding: 0;
  }
}

.auth__title {
  margin: 0 0 32px;
  font: 400 32px/1.2 Prata, Arial, Helvetica, sans-serif;
  text-align: center;
  letter-spacing: .5px;
}

@media (min-width: 768px) {
  .auth__title {
    font-size: 42px;
    margin-bottom: 40px;
  }
}

.auth__subtitle {
  margin: -16px 0 24px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: #6b6b6b;
}

/* ── Поля ───────────────────────────────────────────────────────────── */
.auth__field {
  margin-bottom: 16px;
}

.auth__input {
  box-sizing: border-box;
  width: 100%;
  padding: 16px 20px;
  font: 300 16px/1.25 Montserrat, Arial, Helvetica, sans-serif;
  color: #262626;
  background-color: #fff;
  border: 1px solid #262626;
  border-radius: 8px;
}

.auth__input::placeholder {
  color: #8b8b8b;
}

.auth__input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.auth__input.has-error {
  border-color: #b50414;
}

.auth__input--code {
  text-align: center;
  letter-spacing: 8px;
  font-size: 22px;
}

.auth__pass {
  position: relative;
}

.auth__pass .auth__input {
  padding-right: 92px;
}

.auth__pass-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  color: #6b6b6b;
}

/* Приманка для ботів — прибрана з очей і з фокусу, але не display:none:
   частина ботів свідомо пропускає приховані таким чином поля. */
.auth__hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth__field-error {
  display: block;
  margin: 6px 2px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #b50414;
}

.auth__field-error:empty {
  display: none;
}

.auth__offer {
  margin-bottom: 20px;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.5;
  background: #f4f7f5;
  border: 1px solid #a9d3c1;
  border-radius: 8px;
}

.auth__offer[hidden] {
  display: none;
}

.auth__offer p {
  margin: 0 0 12px;
}

.auth__offer .auth__submit {
  margin: 0 0 10px;
}

.auth__hint {
  margin: -8px 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b6b6b;
}

/* ── Кнопки ─────────────────────────────────────────────────────────── */
.auth__submit {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 18px 32px;
  margin: 8px 0 16px;
  font: 400 14px/1.2 Montserrat, Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  color: #fff;
  background-color: #000;
  border: 1px solid #000;
  border-radius: 5px;
  cursor: pointer;
  transition: all .1s ease-in;
}

.auth__submit:hover {
  color: #000;
  background-color: #fff;
}

.auth__submit[disabled] {
  opacity: .5;
  cursor: default;
}

.auth__submit[disabled]:hover {
  color: #fff;
  background-color: #000;
}

.auth__link {
  display: inline-block;
  font-size: 13px;
  color: #262626;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.auth__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

/* ── Перемикач способу входу ────────────────────────────────────────── */
.auth__switcher {
  display: flex;
  margin-bottom: 24px;
  border: 1px solid #262626;
  border-radius: 8px;
  overflow: hidden;
}

.auth__switcher button {
  flex: 1;
  padding: 12px 8px;
  font: 400 12px/1.2 Montserrat, Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #fff;
  border: none;
  cursor: pointer;
}

.auth__switcher button.is-active {
  background: #000;
  color: #fff;
}

/* ── Повідомлення ───────────────────────────────────────────────────── */
.auth__message {
  margin-bottom: 16px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 8px;
}

.auth__message--error {
  color: #7d0310;
  background: #fdecee;
  border: 1px solid #f0b7bd;
}

.auth__message--success {
  color: #0a3526;
  background: #eaf5f0;
  border: 1px solid #a9d3c1;
}

/* ── Крок з кодом ───────────────────────────────────────────────────── */
.auth__step[hidden],
.auth__panel[hidden] {
  display: none;
}

.auth__code-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #6b6b6b;
}

.auth__resend-note {
  font-size: 12px;
  line-height: 1.4;
  color: #6b6b6b;
}

.auth__resend-note[hidden] {
  display: none;
}

/* ── Чекбокси згоди ─────────────────────────────────────────────────────
   Нативний input ховаємо, бокс і галочку малюємо псевдоелементами — так само,
   як на medik8.com: квадрат 16×16 з рамкою #a7a7a7 і «пташка» з двох бордерів,
   повернута на -45°. Через сусідній селектор, а не :has(), щоб працювало
   і в старих браузерах. */
.auth__agree {
  position: relative;
  display: block;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #4a4a4a;
  cursor: pointer;
}

.auth__agree input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.auth__agree span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid #a7a7a7;
  transition: border-color .1s ease-in;
}

.auth__agree span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 9px;
  height: 5px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg);
  opacity: 0;
  transition: opacity .1s ease-in;
}

.auth__agree input:checked + span::after {
  opacity: 1;
}

.auth__agree:hover span::before,
.auth__agree input:focus-visible + span::before {
  border-color: #000;
}

/* Обовʼязкова згода, яку не поставили. */
.auth__agree.has-error {
  color: #b50414;
}

.auth__agree.has-error span::before {
  border-color: #b50414;
}

.auth__agree a {
  text-decoration: underline;
}
