:root {
  --bg: #05030a;
  --panel: rgba(18, 9, 30, 0.86);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5efff;
  --muted: #c9bdd9;
  --pink: #ff49d5;
  --violet: #a75aff;
  --ok-bg: rgba(16, 185, 129, 0.14);
  --ok-line: rgba(16, 185, 129, 0.45);
  --ok-text: #c6ffe4;
  --err-bg: rgba(239, 68, 68, 0.14);
  --err-line: rgba(239, 68, 68, 0.45);
  --err-text: #ffd1d1;
  --hint-bg: rgba(56, 189, 248, 0.12);
  --hint-line: rgba(56, 189, 248, 0.4);
  --hint-text: #d2f3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(55vw 62vh at 52% 56%, rgba(214, 76, 255, 0.36) 0%, rgba(146, 28, 155, 0.22) 40%, rgba(8, 5, 12, 0) 74%),
    radial-gradient(38vw 40vh at 8% 22%, rgba(223, 63, 255, 0.22) 0%, rgba(12, 9, 19, 0) 78%),
    radial-gradient(42vw 46vh at 96% 82%, rgba(191, 39, 198, 0.2) 0%, rgba(8, 6, 12, 0) 72%),
    var(--bg);
  overflow-x: hidden;
}

body.wf-preload {
  overflow-y: hidden;
}

body.wf-preload .page > * {
  opacity: 0.84;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.64s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.64s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.wf-page-ready .page > * {
  opacity: 1;
  transform: none;
}

body.wf-page-ready .page > *:nth-child(1) {
  transition-delay: 0ms;
}

body.wf-page-ready .page > *:nth-child(2) {
  transition-delay: 110ms;
}

body.wf-page-ready .page > *:nth-child(3) {
  transition-delay: 220ms;
}

body.wf-page-leaving {
  overflow-x: hidden;
  overflow-y: hidden;
}

body.wf-page-leaving .page > * {
  opacity: 0.92 !important;
  transform: translate3d(0, 4px, 0) !important;
  transition-duration: 210ms !important;
  transition-delay: 0ms !important;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  z-index: 3;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(26, 11, 42, 0.72);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(1220px, calc(100% - 42px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 206px;
  max-width: 44vw;
  height: auto;
  display: block;
}

.menu {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-menu-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 133, 225, 0.46);
  background: linear-gradient(138deg, rgba(255, 76, 188, 0.26), rgba(125, 44, 232, 0.2));
  box-shadow:
    0 16px 28px -20px rgba(204, 56, 188, 0.72),
    0 0 0 1px rgba(255, 181, 239, 0.16) inset;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  color: #ffd7f8;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff73d0 0%, #f472b6 40%, #d946ef 100%);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.46);
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
  transform-origin: center;
}

.mobile-menu-overlay {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

.nav-buy-form {
  margin: 0;
}

.header-nav-link {
  color: rgba(250, 235, 255, 0.95);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(244, 114, 182, 0.22);
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.header-nav-link:hover {
  color: #fff7fc;
  text-shadow: 0 0 18px rgba(232, 121, 249, 0.42);
}

.header-nav-link.nav-divider {
  margin-right: 4px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.header-auth-link {
  color: rgba(237, 231, 248, 0.86);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.header-auth-link:hover {
  color: #fff6fc;
}

.header-auth-link.is-active {
  color: #ffb6eb;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 2px;
  text-decoration-color: #f472b6;
}

.premium-btn {
  border: 1px solid rgba(253, 242, 248, 0.5);
  background: linear-gradient(116deg, #9d174d 0%, #a21caf 36%, #7e22ce 68%, #5b21b6 100%);
  color: #fff7fb;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow:
    0 16px 32px -18px rgba(106, 18, 115, 0.64),
    0 0 0 1px rgba(255, 245, 252, 0.1) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.premium-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 44px -18px rgba(212, 53, 184, 0.58),
    0 0 0 1px rgba(255, 239, 252, 0.2) inset;
}

.auth-main {
  width: min(1220px, calc(100% - 42px));
  margin: 0 auto;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 34px 0 56px;
}

.auth-card {
  width: min(560px, 100%);
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(33, 14, 54, 0.92), rgba(13, 9, 24, 0.92)),
    var(--panel);
  box-shadow:
    0 26px 60px -30px rgba(206, 62, 219, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  padding: 30px;
  backdrop-filter: blur(8px);
}

.auth-kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8b7ef;
}

.auth-title {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3.8vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.auth-intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.auth-note {
  margin: 14px 0 0;
  border-radius: 14px;
  border: 1px solid var(--hint-line);
  background: var(--hint-bg);
  color: var(--hint-text);
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-back-link {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(236, 228, 252, 0.86);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-back-link:hover {
  color: #fff6fc;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

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

.auth-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(244, 235, 255, 0.93);
}

.auth-field input:not([type="checkbox"]) {
  width: 100%;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 7, 15, 0.7);
  color: #fff8ff;
  padding: 12px 13px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:not([type="checkbox"]):focus {
  border-color: rgba(202, 148, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(186, 104, 255, 0.18);
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrap input:not([type="checkbox"]) {
  padding-right: 78px;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(23, 14, 35, 0.84);
  color: rgba(255, 236, 250, 0.94);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.auth-password-toggle:hover {
  border-color: rgba(255, 172, 241, 0.6);
  background: rgba(39, 22, 58, 0.92);
  color: #fff8ff;
}

.auth-password-toggle:focus-visible {
  outline: 2px solid rgba(202, 148, 255, 0.72);
  outline-offset: 2px;
}


.auth-alert {
  margin: 0;
  border-radius: 13px;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.55;
}

.auth-alert.is-error {
  border: 1px solid var(--err-line);
  background: var(--err-bg);
  color: var(--err-text);
}

.auth-alert.is-success {
  border: 1px solid var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.auth-alert.is-debug {
  border: 1px solid var(--hint-line);
  background: var(--hint-bg);
  color: var(--hint-text);
  font-size: 0.78rem;
}

.auth-submit {
  border: 1px solid rgba(253, 242, 248, 0.5);
  border-radius: 13px;
  background: linear-gradient(116deg, #f43f8d 0%, #e879f9 38%, #a855f7 66%, #7c3aed 100%);
  color: #fff7fb;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow:
    0 20px 36px -20px rgba(134, 25, 143, 0.72),
    0 0 0 1px rgba(255, 240, 251, 0.25) inset;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 26px 42px -20px rgba(192, 38, 211, 0.66),
    0 0 0 1px rgba(255, 240, 251, 0.35) inset;
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.auth-small-copy {
  margin: 18px 0 0;
  color: rgba(233, 224, 248, 0.76);
  font-size: 0.82rem;
}

.auth-small-copy a,
.auth-switch a {
  color: #f7d7ff;
  text-decoration: none;
  font-weight: 700;
}

.auth-small-copy a:hover,
.auth-switch a:hover {
  color: #fff4ff;
}

.auth-switch {
  margin: 16px 0 0;
  color: rgba(238, 228, 251, 0.9);
  font-size: 0.94rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .topbar-inner,
  .auth-main {
    width: min(1220px, calc(100% - 30px));
  }

  .menu {
    gap: 11px;
  }

  .header-nav-link,
  .premium-btn {
    font-size: 0.84rem;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-topbar-height: 86px;
  }

  .topbar-inner {
    min-height: 0;
    padding: 12px 0;
    gap: 10px;
  }

  .brand img {
    width: clamp(120px, 39vw, 170px);
  }

  .menu {
    gap: 8px;
  }

  .header-nav-link,
  .premium-btn {
    font-size: 0.79rem;
  }

  .auth-main {
    padding: 22px 0 34px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 20px;
  }
}

@media (max-width: 980px) {
  :root {
    --mobile-topbar-height: 92px;
  }

  .topbar-inner {
    position: relative;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    position: relative;
    z-index: 52;
  }

  .mobile-menu-overlay {
    display: block;
    position: fixed;
    top: var(--mobile-topbar-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 54;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(5, 2, 12, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 320ms ease,
      background-color 320ms ease;
  }

  .menu {
    position: fixed;
    top: var(--mobile-topbar-height);
    right: 0;
    width: min(86vw, 340px);
    height: calc(100dvh - var(--mobile-topbar-height));
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    flex-wrap: nowrap;
    background:
      linear-gradient(160deg, rgba(26, 8, 44, 0.97), rgba(9, 7, 18, 0.97)),
      rgba(20, 8, 32, 0.95);
    border-left: 1px solid rgba(255, 170, 233, 0.26);
    box-shadow: -18px 0 34px -22px rgba(5, 2, 12, 0.8);
    transform: translate3d(108%, 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 320ms ease;
    z-index: 50;
  }

  .menu .header-nav-link,
  .menu .header-auth-link {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 4px;
  }

  .menu .header-auth-link {
    color: rgba(247, 225, 255, 0.92);
  }

  .menu .header-nav-link.nav-divider {
    margin-right: 0;
    padding-right: 4px;
    border-right: 0;
  }

  .menu .nav-buy-form {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .menu .premium-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.99rem;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
    background: rgba(5, 2, 12, 0.22);
    pointer-events: auto;
  }

  body.mobile-menu-open .menu {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.2);
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.wf-preload .page > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .premium-btn,
  .auth-submit,
  .auth-field input,
  .auth-password-toggle {
    transition: none;
  }

  .mobile-menu-overlay,
  .menu,
  .mobile-menu-toggle span {
    transition: none !important;
  }
}
