/**
 * Abakan Online — компактная гостевая карточка входа на странице /profil.
 * Стили изолированы .ao-user-profile--guest и не меняют авторизованное состояние.
 */

.ao-user-profile--guest .ao-user-profile__grid {
  grid-template-columns: minmax(0, 1fr) minmax(392px, 424px);
  gap: 32px;
}

.ao-user-profile--guest .ao-user-profile__account-inner {
  padding: 24px;
}

/* В гостевой карточке отдельная иконка профиля лишняя. */
.ao-user-profile--guest .ao-user-profile__account-icon {
  display: none;
}

.ao-user-profile--guest .ao-user-profile__account h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.ao-user-profile--guest .ao-user-profile__account > .ao-user-profile__account-inner > p {
  margin-bottom: 20px;
}

.ao-user-profile--guest .ao-user-profile__native-login form,
.ao-user-profile--guest .ao-user-profile__native-login fieldset {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.ao-user-profile--guest .ao-login-card__credentials {
  display: grid;
  gap: 12px;
}

.ao-user-profile--guest .ao-login-card__credentials .control-group {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ao-user-profile--guest .ao-login-card__credentials label {
  font-size: 13px;
}

.ao-user-profile--guest .ao-login-card__credentials input[type="text"],
.ao-user-profile--guest .ao-login-card__credentials input[type="email"],
.ao-user-profile--guest .ao-login-card__credentials input[type="password"] {
  min-height: 46px;
}

/* Подсказка об обязательном поле показывается только после фактической ошибки. */
.ao-user-profile--guest .ao-user-profile__native-login .form-control-feedback {
  display: none;
  margin-top: 4px;
  color: #a33b47;
  font-size: 12px;
  line-height: 1.4;
}

.ao-user-profile--guest .ao-user-profile__native-login .control-group:has(.invalid) .form-control-feedback {
  display: block;
}

/* Запомнить + восстановление пароля в одной компактной строке. */
.ao-user-profile--guest .ao-login-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.ao-user-profile--guest .ao-login-card__meta .form-check {
  min-width: 0;
}

.ao-user-profile--guest .ao-login-card__meta label,
.ao-user-profile--guest .ao-login-card__reset {
  font-size: 12px;
  line-height: 1.35;
}

.ao-user-profile--guest .ao-login-card__reset,
.ao-user-profile--guest .ao-login-card__registration a,
.ao-user-profile--guest .ao-login-card__recovery-secondary a {
  color: var(--ao-accent);
  font-weight: 600;
  text-decoration: none;
}

.ao-user-profile--guest .ao-login-card__reset:hover,
.ao-user-profile--guest .ao-login-card__reset:focus-visible,
.ao-user-profile--guest .ao-login-card__registration a:hover,
.ao-user-profile--guest .ao-login-card__registration a:focus-visible,
.ao-user-profile--guest .ao-login-card__recovery-secondary a:hover,
.ao-user-profile--guest .ao-login-card__recovery-secondary a:focus-visible {
  color: var(--ao-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Основной вход и Social Auth компактно стоят рядом на десктопе. */
.ao-user-profile--guest .ao-login-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.ao-user-profile--guest .ao-login-card__submit {
  flex: 0 1 136px;
  width: auto;
  min-height: 46px;
}

.ao-user-profile--guest .ao-login-card__social {
  flex: 1 1 200px;
  min-width: 0;
}

.ao-user-profile--guest .ao-login-card__social .socialauth-login {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: #fff;
  color: var(--ao-text);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.ao-user-profile--guest .ao-login-card__social .socialauth-login:hover,
.ao-user-profile--guest .ao-login-card__social .socialauth-login:focus-visible {
  border-color: #cbd5e6;
  background: #f7f9fd;
  color: var(--ao-text);
}

.ao-user-profile--guest .ao-login-card__social .socialauth-login--yandex::before,
.ao-user-profile--guest .ao-login-card__social .socialauth-login--vk::before {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.ao-user-profile--guest .ao-login-card__social .socialauth-login--yandex::before {
  content: "Я";
  background: #fc3f1d;
  font-size: 12px;
}

.ao-user-profile--guest .ao-login-card__social .socialauth-login--vk::before {
  content: "VK";
  background: #0077ff;
  font-size: 8px;
  letter-spacing: -0.04em;
}

/* WebAuthn и другие дополнительные способы входа остаются вторичными. */
.ao-user-profile--guest .ao-login-card__secondary-auth {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.ao-user-profile--guest .ao-login-card__secondary-auth .btn {
  width: auto;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ao-accent);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.ao-user-profile--guest .ao-login-card__secondary-auth .btn:hover,
.ao-user-profile--guest .ao-login-card__secondary-auth .btn:focus-visible {
  background: var(--ao-accent-soft);
  color: var(--ao-accent-dark);
}

.ao-user-profile--guest .ao-login-card__secondary-auth svg {
  width: 18px;
  height: 18px;
}

.ao-user-profile--guest .ao-login-card__social .btn:focus-visible,
.ao-user-profile--guest .ao-login-card__secondary-auth .btn:focus-visible,
.ao-user-profile--guest .ao-login-card__submit:focus-visible,
.ao-user-profile--guest .ao-login-card a:focus-visible {
  outline: 3px solid rgba(39, 87, 215, 0.18);
  outline-offset: 2px;
}

/* Регистрация и восстановление логина — компактная нижняя группа без дублирующего текста. */
.ao-user-profile--guest .ao-login-card__registration {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ao-border);
  font-size: 12px;
  line-height: 1.4;
}

.ao-user-profile--guest .ao-login-card__recovery-secondary {
  margin-top: 8px;
  text-align: center;
}

.ao-user-profile--guest .ao-login-card__recovery-secondary a,
.ao-user-profile--guest .ao-login-card__registration a {
  font-size: 12px;
}

@media (max-width: 991.98px) {
  .ao-user-profile--guest .ao-user-profile__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    width: 100%;
  }

  /* На мобильной/планшетной ширине сначала показываем вход, затем избранное. */
  .ao-user-profile--guest .ao-user-profile__account {
    order: -1;
    width: 100%;
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__main {
    order: 0;
    width: 100%;
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__favorites {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__section-heading,
  .ao-user-profile--guest .ao-user-profile__empty,
  .ao-user-profile--guest .ao-user-profile__favorites-list {
    width: 100%;
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__empty {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .ao-user-profile--guest .ao-user-profile__empty > .icon-heart {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .ao-user-profile--guest .ao-user-profile__empty > div {
    min-width: 0;
  }

  .ao-user-profile--guest .ao-user-profile__account-inner {
    padding: 24px;
  }
}

@media (max-width: 559.98px) {
  .ao-user-profile--guest .ao-user-profile__account-inner {
    padding: 18px;
  }

  .ao-user-profile--guest .ao-login-card__meta {
    align-items: flex-start;
  }

  .ao-user-profile--guest .ao-login-card__actions {
    flex-direction: column;
  }

  .ao-user-profile--guest .ao-login-card__submit,
  .ao-user-profile--guest .ao-login-card__social {
    width: 100%;
    flex: 1 1 auto;
  }

  .ao-user-profile--guest .ao-login-card__registration,
  .ao-user-profile--guest .ao-login-card__recovery-secondary {
    justify-content: center;
    text-align: center;
  }

  .ao-user-profile--guest .ao-user-profile__empty h3,
  .ao-user-profile--guest .ao-user-profile__empty p {
    overflow-wrap: anywhere;
  }
}


/* Joomla system messages: the fixed container stays click-through,
   while the alert itself and its close button remain interactive. */
#system-message-container joomla-alert,
#system-message-container joomla-alert .joomla-alert--close,
#system-message-container joomla-alert .joomla-alert-button--close {
  pointer-events: auto !important;
}
