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

.auth-header {
  position: sticky;
  top: 20px;
  z-index: 20;
  width: min(1320px, calc(100% - 40px));
  min-height: 78px;
  margin: 20px auto 0;
  padding: 12px 18px 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--white);
  border-radius: 38px;
  box-shadow: 0 14px 40px rgba(31, 31, 31, 0.06);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
}

.auth-logo img {
  width: 156px;
  height: auto;
  display: block;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.auth-header-actions a {
  color: var(--black);
  text-decoration: none;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--purple);
  color: var(--white) !important;
}

.auth-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 16px auto 70px;
  padding-top: 0;
}

/* ── Auth notice banner (pending app / return) ─── */
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(680px, 100%);
  margin: 0 auto 20px;
  padding: 16px 20px;
  background: var(--lime);
  border-radius: 18px;
}

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

.auth-notice-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--black);
  color: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}

.auth-notice-body { flex: 1; }

.auth-notice-body b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--black);
}

.auth-notice-body p {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--black);
  opacity: 0.75;
}

.auth-notice-body p b { display: inline; margin-bottom: 0; }

.auth-card {
  min-height: 620px;
  padding: clamp(32px, 4vw, 64px);
  display: block;
  background:
    linear-gradient(118deg, rgba(123, 77, 255, 0.04) 0%, rgba(180, 255, 43, 0.44) 100%),
    var(--white);
  border: 1.5px solid rgba(180, 255, 43, 0.45);
  border-radius: 48px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/on admin settings page.webp') center center / cover no-repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.auth-copy {
  max-width: 580px;
  margin-bottom: 28px;
}

.auth-panel {
  max-width: 100%;
}

.hp-wrap {
  display: none;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--black);
  font-weight: 900;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 24px 0 16px;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 900;
}

.auth-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
}

.auth-panel {
  padding: 24px;
  background: var(--white);
  border-radius: 30px;
  box-shadow: 0 24px 80px rgba(31, 31, 31, 0.1);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  background: var(--soft);
  border-radius: 999px;
}

.auth-tabs button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--black);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--purple);
  color: var(--white);
}

.auth-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(123, 77, 255, 0.08);
  color: var(--purple);
  font-weight: 800;
  line-height: 1.35;
}

.auth-alert.is-error {
  background: rgba(214, 48, 49, 0.1);
  color: #b42323;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: grid;
  gap: 14px;
}

/* Регистрация — 2 колонки */
[data-auth-form="register"].active {
  grid-template-columns: 1fr 1fr;
}

[data-auth-form="register"] .auth-field-full,
[data-auth-form="register"] .auth-consent,
[data-auth-form="register"] .auth-consent-error,
[data-auth-form="register"] .auth-submit {
  grid-column: 1 / -1;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label > span:first-child,
.auth-consent span {
  font-size: 14px;
  font-weight: 900;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  color: var(--black);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--purple);
  background: var(--white);
}

.auth-form small {
  min-height: 16px;
  color: #b42323;
  font-size: 12px;
  font-weight: 800;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 108px;
}

.password-wrap button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 86px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--purple);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.auth-consent {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 12px;
  border-radius: 16px;
  background: var(--soft);
}

.auth-consent input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin-top: 1px;
  accent-color: var(--purple);
}

.auth-consent a {
  color: var(--purple);
}

.auth-submit {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: var(--black);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.auth-submit:hover:not([disabled]) {
  background: var(--black);
  color: var(--white);
}

.auth-submit[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.auth-divider {
  position: relative;
  margin: 20px 0;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  background: var(--white);
}

.oauth-grid {
  display: grid;
  gap: 10px;
}

.oauth-btn {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.oauth-btn:hover {
  background: var(--soft);
  border-color: var(--purple);
  color: var(--purple);
}

.oauth-btn img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.not-found-main {
  width: min(1020px, calc(100% - 40px));
  margin: 36px auto 80px;
  padding: clamp(34px, 7vw, 86px);
  border-radius: 48px;
  background: var(--white);
  text-align: center;
}

.not-found-code {
  margin: 0;
  font-size: clamp(86px, 18vw, 210px);
  line-height: 0.9;
  font-weight: 900;
  color: var(--purple);
}

.not-found-main h1 {
  margin: 12px 0 14px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1;
}

.not-found-main p {
  margin: 0 auto 28px;
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.not-found-actions a {
  min-height: 54px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--lime);
  color: var(--black);
  text-decoration: none;
  font-weight: 900;
}

.not-found-actions a:last-child {
  background: var(--purple);
  color: var(--white);
}

@media (max-width: 900px) {
  .auth-card {
    min-height: auto;
    padding: clamp(24px, 4vw, 40px);
  }

  .auth-copy h1 {
    font-size: clamp(28px, 8vw, 48px);
    margin: 16px 0 12px;
  }

  .auth-copy p {
    font-size: 15px;
  }

  .auth-copy {
    margin-bottom: 20px;
  }

  .auth-panel {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .auth-card::before {
    display: none;
  }

  .auth-header {
    top: 12px;
    width: min(100% - 20px, 560px);
    min-height: 66px;
    padding: 10px 12px 10px 18px;
    border-radius: 30px;
  }

  .auth-logo img {
    width: 132px;
  }

  .auth-header-actions a:first-child {
    display: none;
  }

  .auth-back {
    min-height: 44px;
    padding: 0 18px;
  }

  .auth-shell {
    width: min(100% - 20px, 560px);
    margin: 11px auto 44px;
  }

  .auth-card {
    padding: 18px;
    border-radius: 30px;
    gap: 18px;
  }

  .auth-panel {
    padding: 14px;
    border-radius: 24px;
  }

  .auth-tabs button,
  .auth-submit,
  .oauth-btn {
    min-height: 48px;
  }

  [data-auth-form="register"].active {
    grid-template-columns: 1fr;
  }

  [data-auth-form="register"] .auth-field-full,
  [data-auth-form="register"] .auth-consent,
  [data-auth-form="register"] .auth-consent-error,
  [data-auth-form="register"] .auth-submit {
    grid-column: auto;
  }
}
