/* =========================================================
   lygrax pages — аккаунт (вход, регистрация, сброс пароля)
   ========================================================= */

.auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

/* ---------- illustration ---------- */
.auth__art {
  position: relative;
  overflow: hidden;
  background: #0037ff;
}

.auth__art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
}

/* ---------- pane ---------- */
.auth__pane {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 96px 40px 56px;
}

.auth__logo {
  position: absolute;
  top: 34px;
  left: 38px;
  display: inline-flex;
  line-height: 0;
}

.auth__logo img {
  display: block;
  width: 72px;
  height: 21px;
}

.auth__panel {
  width: min(100%, 418px);
}

/* ---------- views ---------- */
.auth-view[hidden] {
  display: none;
}

.auth-view {
  animation: auth-in 0.28s ease both;
}

@keyframes auth-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-view__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 28px;
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.3;
  transition: color 0.18s ease;
}

.auth-view__back:hover {
  color: var(--white);
}

.auth-view__back svg {
  flex: 0 0 auto;
}

.auth-title {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

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

.auth-text {
  max-width: 400px;
  margin-top: 10px;
  color: #9b9b9b;
  font-size: 15px;
  line-height: 1.5;
}

.auth-text strong {
  color: var(--white);
  font-weight: 400;
  word-break: break-word;
}

.auth-view__head + .auth-form,
.auth-view__head + .auth-actions {
  margin-top: 26px;
}

/* ---------- tabs ---------- */
.auth-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 3px;
  border-radius: 8px;
  background: #323232;
}

.auth-tab {
  padding: 10px 12px;
  border-radius: 5px;
  color: var(--white);
  font-size: 14px;
  line-height: 14px;
  white-space: nowrap;
  transition: background 0.18s ease;
}

.auth-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab.is-active {
  background: #505050;
}

/* ---------- form ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

.auth-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #555555;
  border-radius: 8px;
  background: transparent;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.auth-field:hover {
  border-color: #6b6b6b;
}

.auth-field:focus-within {
  border-color: #9a9a9a;
  background: rgba(255, 255, 255, 0.02);
}

.auth-field.is-invalid {
  border-color: #ff5c75;
}

.auth-field.is-invalid:focus-within {
  border-color: #ff5c75;
}

.auth-field__icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  opacity: 0.95;
}

.auth-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 16px;
  outline: none;
}

.auth-field input::placeholder {
  color: #c0c0c0;
  opacity: 1;
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  box-shadow: 0 0 0 1000px #1e1e1e inset;
}

.auth-error {
  margin: 0;
  padding-left: 2px;
  color: #ff8a9a;
  font-size: 12px;
  line-height: 1.35;
}

.auth-error[hidden] {
  display: none;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 4px;
  color: #c0c0c0;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.auth-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-check__box {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid #555555;
  border-radius: 4px;
  color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.auth-check:hover .auth-check__box {
  border-color: #7a7a7a;
}

.auth-check input:checked + .auth-check__box {
  border-color: #f9f9f9;
  background: #f9f9f9;
  color: #1e1e1e;
}

.auth-check input:focus-visible + .auth-check__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-check.is-invalid .auth-check__box {
  border-color: #ff5c75;
}

.auth-check a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-check a:hover {
  color: var(--pink);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0;
}

.auth-row--end {
  justify-content: flex-end;
}

.auth-actions + .auth-note {
  margin-top: 14px;
}

.auth-link {
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.3;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.auth-link:hover {
  color: var(--white);
  border-bottom-color: var(--accent);
}

/* ---------- buttons ---------- */
.auth-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #f9f9f9;
  color: #1e1e1e;
  font: inherit;
  font-size: 16px;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.auth-btn:hover {
  background: var(--white);
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn[disabled],
.auth-btn[aria-busy="true"] {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

.auth-btn--ghost {
  border-color: #555555;
  background: transparent;
  color: var(--white);
}

.auth-btn--ghost:hover {
  border-color: #8a8a8a;
  background: rgba(255, 255, 255, 0.06);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* ---------- notes / status ---------- */
.auth-note {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-left: 2px solid #6b6b6b;
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.04);
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.45;
}

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

.auth-note--error {
  border-left-color: #ff5c75;
  color: #ffb3bf;
}

.auth-note--ok {
  border-left-color: #4fd39a;
  color: #b6efd3;
}

/* ---------- misc ---------- */
.auth-hint {
  margin-top: 20px;
  color: #7f7f7f;
  font-size: 12px;
  line-height: 1.45;
}

.auth-hint a {
  color: #c0c0c0;
  border-bottom: 1px solid transparent;
}

.auth-hint a:hover {
  color: var(--white);
  border-bottom-color: var(--accent);
}

.auth__foot {
  position: absolute;
  bottom: 28px;
  left: 38px;
  right: 38px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #6f6f6f;
  font-size: 12px;
  line-height: 1.4;
}

.auth__foot a {
  color: #8f8f8f;
  transition: color 0.18s ease;
}

.auth__foot a:hover {
  color: var(--white);
}

.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;
}

/* =========================================================
   responsive
   ========================================================= */
@media (max-width: 1100px) {
  .auth__pane {
    padding: 88px 32px 48px;
  }

  .auth__logo {
    top: 28px;
    left: 32px;
  }

  .auth__foot {
    left: 32px;
    right: 32px;
    bottom: 22px;
  }
}

@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth__art {
    display: none;
  }

  .auth__pane {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 104px 24px 56px;
  }

  .auth__logo {
    top: 26px;
    left: 24px;
  }

  .auth__panel {
    width: min(100%, 420px);
  }

  .auth__foot {
    position: static;
    display: flex;
    width: min(100%, 420px);
    justify-content: space-between;
    margin-top: 48px;
    padding: 0;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .auth__pane {
    padding: 92px 18px 36px;
  }

  .auth__logo {
    top: 22px;
    left: 18px;
  }

  .auth__logo img {
    width: 64px;
    height: 19px;
  }

  .auth-title {
    font-size: 23px;
  }

  .auth-btn {
    font-size: 15px;
  }

  .auth__foot {
    flex-direction: column;
    gap: 6px;
    margin-top: 40px;
  }
}

@media (max-height: 640px) and (max-width: 900px) {
  .auth__pane {
    align-items: flex-start;
    padding-top: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-view {
    animation: none;
  }

  .auth-btn,
  .auth-tab,
  .auth-field,
  .auth-link {
    transition: none;
  }
}

/* ---------- print ---------- */
@media print {
  .auth__art,
  .auth__foot {
    display: none !important;
  }

  .auth {
    display: block;
    min-height: 0;
  }

  .auth__pane {
    padding: 0;
  }

  .auth__logo {
    position: static;
    margin-bottom: 40px;
  }

  .auth-view[hidden] {
    display: none !important;
  }
}

/* While registration is closed, the form gives way to the line that says so. */
.auth-form[hidden] {
  display: none;
}
