:root {
  --auth-text: #ffffff;
  --auth-primary: #d1511b;
  --auth-primary-hover: #b54517;
  --auth-danger: #fecaca;
  --auth-danger-bg: rgba(127, 29, 29, 0.42);
  --auth-success: #bbf7d0;
  --auth-success-bg: rgba(20, 83, 45, 0.42);
  --auth-muted: rgba(255, 255, 255, 0.72);
  --auth-border: rgba(255, 255, 255, 0.15);
  --auth-input-bg: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", system-ui, sans-serif;
  background: linear-gradient(145deg, #0a0a2a 0%, #020160 100%);
  color: var(--auth-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* fixed — не увеличивает высоту документа (absolute + inset:-50% давал лишний скролл) */
body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("https://kiberpride.ru/wp-content/themes/kiberpride/assets/images/header-logo-small.svg");
  background-size: 140px auto;
  background-repeat: repeat;
  transform: rotate(15deg);
  opacity: 0.04;
  animation: auth-float 60s linear infinite;
  pointer-events: none;
}

body.auth-page > * {
  position: relative;
  z-index: 1;
}

@keyframes auth-float {
  0% {
    transform: rotate(15deg) translate(0, 0);
  }
  100% {
    transform: rotate(15deg) translate(-5%, -5%);
  }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 36px 34px 30px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  animation: auth-card-in 420ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes auth-card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card--wide {
  max-width: 520px;
}

.auth-logo {
  max-width: 148px;
  max-height: 44px;
  width: auto;
  height: auto;
  margin: 0 auto 18px;
  display: block;
  object-fit: contain;
  opacity: 0;
  animation: auth-fade-in 360ms cubic-bezier(0.23, 1, 0.32, 1) 80ms forwards;
}

.auth-card h1,
.auth-lead {
  opacity: 0;
  animation: auth-fade-in 360ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.auth-card h1 {
  animation-delay: 120ms;
}

.auth-lead {
  animation-delay: 160ms;
}

.auth-field,
.auth-check,
.auth-banner {
  opacity: 0;
  animation: auth-fade-in 320ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.auth-field:nth-of-type(1) { animation-delay: 200ms; }
.auth-field:nth-of-type(2) { animation-delay: 240ms; }
.auth-field:nth-of-type(3) { animation-delay: 280ms; }
.auth-field:nth-of-type(4) { animation-delay: 320ms; }
.auth-field:nth-of-type(5) { animation-delay: 360ms; }
.auth-field:nth-of-type(6) { animation-delay: 400ms; }
.auth-check { animation-delay: 420ms; }
.auth-banner { animation-delay: 180ms; }

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

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.auth-lead {
  margin: 0 0 24px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 8px 10px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  border: 1px solid var(--auth-border);
  border-radius: 40px;
  padding: 0 20px;
  height: 50px;
  font-size: 14px;
  background: var(--auth-input-bg);
  color: #fff;
  font-family: inherit;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(209, 81, 27, 0.2);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--auth-muted);
}

.auth-check input {
  margin-top: 3px;
  accent-color: var(--auth-primary);
}

.auth-check a {
  color: #ffb088;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-check a:hover {
  color: #ffd0b8;
}

.auth-banner {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.auth-banner--err {
  background: var(--auth-danger-bg);
  color: var(--auth-danger);
  border: 1px solid rgba(254, 202, 202, 0.35);
}

.auth-banner--ok {
  background: var(--auth-success-bg);
  color: var(--auth-success);
  border: 1px solid rgba(187, 247, 208, 0.35);
}

.auth-btn {
  width: 100%;
  border: none;
  border-radius: 40px;
  height: 50px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--auth-primary);
  color: #fff;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 8px 16px -6px rgba(209, 81, 27, 0.4);
  transition: background 160ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 160ms cubic-bezier(0.23, 1, 0.32, 1);
  font-family: inherit;
  opacity: 0;
  animation: auth-fade-in 320ms cubic-bezier(0.23, 1, 0.32, 1) 440ms forwards;
}

.auth-btn:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 20px -8px rgba(209, 81, 27, 0.6);
}

.auth-btn:active {
  transform: scale(0.97);
  box-shadow: 0 6px 12px -6px rgba(209, 81, 27, 0.45);
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: none;
  text-transform: none;
  font-size: 14px;
  height: 44px;
}

.auth-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.auth-links {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  opacity: 0;
  animation: auth-fade-in 320ms cubic-bezier(0.23, 1, 0.32, 1) 480ms forwards;
}

.auth-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-links a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .auth-card {
    max-width: 100%;
    padding: 30px 20px;
    border-radius: 28px;
  }
  .auth-logo {
    max-width: 128px;
    max-height: 38px;
  }
  .auth-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page::before {
    animation: none;
  }
  .auth-card,
  .auth-logo,
  .auth-card h1,
  .auth-lead,
  .auth-field,
  .auth-check,
  .auth-banner,
  .auth-btn,
  .auth-links {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .auth-btn {
    transition: none;
  }
}
