/*
 * Login and registration (/login, /register — docs/redesign/SCREENS.md §6): the landing's hero
 * composition (pages.css .hero, .hero-card) with «Вход» / «Регистрация» tabs in the glass card.
 * ≤ 760 the illustration half is hidden and the card turns into a solid card under the header.
 */

.hero--auth .hero__art {
  min-height: clamp(600px, calc(100dvh - 142px), 720px);
}

@media (min-width: 1440px) {
  .hero--auth .hero__art {
    min-height: clamp(600px, calc(100dvh - 142px), 720px);
  }
}

/* One view at a time (the login view fits the first screen; registration makes the card taller). */
.auth-card .hero-view {
  padding-top: 32px;
}

.auth-card:focus {
  outline: none;
}

/* login.js picks the tab from the address (/login or /register) before the card shows, so
   /register never flashes the login form; without a script the card appears after 2 s (and at
   once with <noscript>). */
.auth-card:not(.is-ready) .hero-card__tabs,
.auth-card:not(.is-ready) .auth-view:not([hidden]) {
  visibility: hidden;
  animation: pg-reveal 0s linear 2s forwards;
}

.auth-form {
  gap: 16px;
}

/* Errors that belong to no field: danger-soft block, radius 12, 13 px danger text. */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-12);
  background-color: var(--danger-soft-solid);
  color: var(--danger-text);
  font-size: var(--fs-13);
  line-height: 1.5;
}

.auth-alert > .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.auth-alert > span {
  min-width: 0;
}

.auth-plan {
  margin: 0;
}

/* «Забыли пароль?…», «Создавая аккаунт…»: 12 px, centred. */
.auth-note {
  color: var(--text-muted);
  font-size: var(--fs-12);
  line-height: 1.6;
  text-align: center;
  text-wrap: balance;
}

.auth-note a {
  color: var(--accent-text);
  text-decoration-line: underline;
  text-underline-offset: 3px;
}

/* «Войти» inside the «этот e-mail уже зарегистрирован» error. */
.field__error .btn--link {
  --btn-fs: var(--fs-12);
  padding-block: 0;
  text-decoration-line: underline;
}

/* «Продолжить без регистрации»: the glass pill sized by its words. */
.hero-card__slot > .auth-guest {
  width: auto;
  min-width: 176px;
  padding-right: 18px;
}

@media (max-width: 760px) {
  .hero--auth .hero__art {
    display: none;
  }

  /* A solid card: the glass-local colours give way to the page ones. */
  .hero--auth .hero-card {
    --text-muted: inherit;
    --border-strong: inherit;
    --input-bg: inherit;
    --accent-text: inherit;
    min-height: 0;
    padding: 23px 24px 28px;
    border-color: var(--card-border);
    border-radius: var(--r-25);
    background: var(--surface-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }

  .auth-card .hero-view {
    padding-top: 24px;
  }

  .hero-card__slot > .auth-guest {
    --btn-bg: var(--surface-raised);
    --btn-bg-hover: var(--hover-bg);
    --btn-fg: var(--text);
    --btn-fg-hover: var(--text);
    --btn-border: var(--border);
    box-shadow: none;
  }

  .hero-card__slot > .auth-guest .btn__symbol {
    background: var(--surface-accent);
    color: var(--accent-text);
    box-shadow: none;
  }
}

@media (max-width: 360px) {
  .hero--auth .hero-card {
    padding-inline: 20px;
  }

  .hero-card__slot > .auth-guest {
    min-width: 0;
    max-width: 100%;
  }
}
