/* Auth pages — Polowina (цвета логотипа) */

:root {
  --pw-blue: #626cff;
  --pw-red: #ff3471;
  --pw-accent: #ff3471;
  --pw-accent-dark: #e02863;
  --pw-ink: #1C1917;
  --pw-muted: #78716C;
  --pw-line: rgba(98, 108, 255, 0.18);
  --pw-panel: rgba(255, 255, 255, 0.82);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body.pw-auth {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--pw-ink);
  background: #F5F6FF;
  overflow-x: hidden;
}

.pw-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 12% 8%, rgba(255, 52, 113, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 18%, rgba(98, 108, 255, 0.32), transparent 50%),
    radial-gradient(ellipse 60% 45% at 48% 100%, rgba(98, 108, 255, 0.18), transparent 55%),
    linear-gradient(165deg, #FFF7FA 0%, #EEF0FF 48%, #F7F8FF 100%);
  animation: pw-bg-shift 14s ease-in-out infinite alternate;
}

.pw-auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: soft-light;
}

@keyframes pw-bg-shift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to { filter: hue-rotate(-6deg) saturate(1.06); }
}

.pw-auth-top {
  position: relative;
  z-index: 2;
  padding: 1.35rem 1.5rem 0;
  display: flex;
  justify-content: center;
  animation: pw-fade-up 0.7s ease both;
}

.pw-auth-brand img {
  display: block;
  height: 30px;
  width: auto;
  transition: transform 0.35s ease;
}

.pw-auth-brand:hover img {
  transform: scale(1.03);
}

.pw-auth-stage {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 90px);
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.pw-auth-panel {
  width: min(440px, 100%);
  padding: 2.4rem 2rem 2.1rem;
  background: var(--pw-panel);
  border: 1px solid var(--pw-line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 24px 60px rgba(98, 108, 255, 0.12);
  animation: pw-fade-up 0.85s 0.08s ease both;
}

.pw-auth-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--pw-red), var(--pw-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pw-auth-panel h1 {
  margin: 0 0 0.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--pw-ink);
}

.pw-auth-lead {
  margin: 0 0 1.75rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--pw-muted);
  font-weight: 400;
}

.pw-auth-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--pw-red);
  color: #fff !important;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none !important;
  text-shadow: none;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, filter 0.2s ease;
}

.pw-auth-cta .pw-btn__ico {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.pw-auth-cta:hover {
  background: var(--pw-accent-dark, #e02863);
  color: #fff !important;
  filter: brightness(1.03);
}

.pw-auth-cta:active {
  transform: translateY(0);
}

.pw-auth-alt {
  margin: 1.4rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--pw-muted);
}

.pw-auth-alt a {
  color: var(--pw-blue);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pw-auth-alt a:hover {
  color: var(--pw-red);
  border-bottom-color: var(--pw-red);
}

.pw-auth-error {
  margin: 0 0 1.1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 52, 113, 0.1);
  border: 1px solid rgba(255, 52, 113, 0.28);
  color: #c41d55;
  font-size: 0.92rem;
  line-height: 1.4;
}

.pw-login-form {
  display: grid;
  gap: 1rem;
}

.pw-field {
  display: grid;
  gap: 0.4rem;
}

.pw-field span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #44403C;
}

.pw-field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(98, 108, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--pw-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pw-field input::placeholder {
  color: #A8A29E;
}

.pw-field input:focus {
  outline: none;
  border-color: rgba(98, 108, 255, 0.65);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(98, 108, 255, 0.14);
}

.pw-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pw-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--pw-muted);
  cursor: pointer;
  user-select: none;
}

.pw-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--pw-blue);
}

.pw-auth-forgot {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pw-blue);
  text-decoration: none;
}

.pw-auth-forgot:hover {
  color: var(--pw-red);
  text-decoration: underline;
}

@keyframes pw-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .pw-auth-panel {
    padding: 1.85rem 1.25rem 1.7rem;
    border-radius: 18px;
  }

  .pw-auth-panel h1 {
    font-size: 20px;
  }

  .pw-login-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pw-auth-bg,
  .pw-auth-top,
  .pw-auth-panel,
  .pw-auth-cta,
  .pw-auth-brand img {
    animation: none !important;
    transition: none !important;
  }
}
