:root {
  --auth-accent: #d20f1f;
  --auth-accent-rgb: 210, 15, 31;
}

html:has(body.auth-body),
body.auth-body {
  min-height: 100%;
}

html[data-theme="light"] body.auth-body,
body.auth-body {
  min-height: 100dvh;
  background-color: #f5eee6;
  background-image:
    linear-gradient(90deg, rgba(250, 247, 242, 0.08), rgba(250, 247, 242, 0.02)),
    url("/static/reg-bg-light.avif");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color: #17171b;
  overflow: hidden;
}

html[data-theme="dark"] body.auth-body {
  background-color: #101010;
  background-image:
    linear-gradient(90deg, rgba(8, 8, 9, 0.04), rgba(8, 8, 9, 0.12)),
    url("/static/reg-bg-dark.avif");
  color: #f7f4f2;
}

body.auth-body::before,
body.auth-body::after {
  display: none;
}

.auth-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.auth-topbar {
  width: var(--site-fluid-content-width);
  min-height: 88px;
  margin: 0 auto;
  padding: 0;
  gap: 24px;
}

.auth-topbar .brand {
  color: #17171b;
  gap: 14px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-topbar .brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

html[data-theme="dark"] .auth-topbar .brand {
  color: #f7f4f2;
}

.auth-topbar .header-menu {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(32px, 4.5vw, 70px);
  margin-inline: auto;
}

.auth-topbar .header-menu .ghost-btn {
  position: relative;
  min-height: auto;
  padding: 12px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #242329;
  font-size: 17px;
  font-weight: 600;
}

html[data-theme="dark"] .auth-topbar .header-menu .ghost-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.auth-topbar .header-menu .ghost-btn::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  height: 2px;
  border-radius: 99px;
  background: var(--auth-accent);
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
}

.auth-topbar .header-menu .ghost-btn:hover,
.auth-topbar .header-menu .ghost-btn:focus-visible,
.auth-topbar .header-menu .ghost-btn.is-active {
  color: var(--auth-accent);
  transform: none;
}

.auth-topbar .header-menu .ghost-btn:hover::after,
.auth-topbar .header-menu .ghost-btn:focus-visible::after,
.auth-topbar .header-menu .ghost-btn.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.auth-topbar .site-header-controls {
  gap: 12px;
}

.auth-topbar .lang-switch-select {
  min-width: 88px;
  height: 46px;
  padding: 0 38px 0 18px;
  border-radius: 999px;
  background-position: calc(100% - 19px) 20px, calc(100% - 13px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-color: rgba(255, 255, 255, 0.86);
  border-color: rgba(38, 35, 34, 0.12);
  color: #17171b;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(44, 31, 27, 0.08);
}

html[data-theme="dark"] .auth-topbar .lang-switch-select {
  background-color: rgba(24, 23, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.auth-topbar .theme-switch {
  width: 58px;
  height: 46px;
  border-radius: 999px;
  border-color: rgba(38, 35, 34, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(44, 31, 27, 0.08);
}

html[data-theme="dark"] .auth-topbar .theme-switch {
  background: rgba(24, 23, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

.auth-topbar .theme-switch-track {
  display: block;
}

.auth-topbar .theme-switch-icon {
  position: absolute;
  inset: 0;
  color: #1e1d21;
  opacity: 0;
}

.auth-topbar .theme-switch-icon svg {
  width: 21px;
  height: 21px;
}

.auth-topbar .theme-switch[data-theme-state="light"] .theme-switch-icon-moon,
.auth-topbar .theme-switch[data-theme-state="dark"] .theme-switch-icon-sun {
  color: inherit;
  opacity: 1;
}

html[data-theme="dark"] .auth-topbar .theme-switch-icon {
  color: #fff;
}

.auth-topbar .theme-switch-thumb {
  display: none;
}

.auth-topbar .mobile-theme-switch { display: none; }

.auth-center {
  min-width: 0;
  min-height: 0;
  padding: clamp(10px, 2.4vh, 24px) 0 clamp(18px, 4vh, 38px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-card-pro {
  width: min(calc(100vw - 32px), clamp(520px, 30vw, 680px));
  max-height: 100%;
  padding: clamp(22px, 3.2vh, 30px);
  border: 1px solid rgba(var(--auth-accent-rgb), 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #17171b;
  box-shadow: 0 28px 70px rgba(77, 49, 39, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.56) inset;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow: auto;
  scrollbar-width: none;
}

.auth-card-pro::-webkit-scrollbar {
  display: none;
}

html[data-theme="dark"] .auth-card-pro {
  border-color: rgba(233, 62, 62, 0.28);
  background: rgba(20, 19, 21, 0.95);
  color: #f7f4f2;
  box-shadow: 0 30px 74px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

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

.auth-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 16px;
  color: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.auth-card-brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(35, 32, 34, 0.08);
  border-radius: 16px;
  background: #f3f1ef;
}

html[data-theme="dark"] .auth-mode-tabs {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.auth-mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6c686b;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

html[data-theme="dark"] .auth-mode-tab {
  color: rgba(255, 255, 255, 0.6);
}

.auth-mode-tab.is-active {
  background: #fff;
  color: var(--auth-accent);
  box-shadow: 0 5px 16px rgba(50, 35, 30, 0.1);
}

html[data-theme="dark"] .auth-mode-tab.is-active {
  background: #28262a;
  color: #ff6b69;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
}

.auth-mode-tab:focus-visible,
.auth-password-toggle:focus-visible,
.auth-back-link:focus-visible,
.auth-inline-link:focus-visible,
.auth-resend-link:focus-visible {
  outline: 3px solid rgba(var(--auth-accent-rgb), 0.2);
  outline-offset: 2px;
}

.auth-card-pro.is-reset .auth-mode-tabs {
  display: none;
}

.auth-pro-panels {
  margin-top: 20px;
}

.auth-pro-panel,
.auth-step {
  display: none;
}

.auth-pro-panel.is-active,
.auth-step.is-active {
  display: grid;
}

.auth-pro-panel.is-active {
  gap: 18px;
  animation: auth-panel-in 200ms ease-out;
}

.auth-step.is-active {
  gap: 18px;
  animation: auth-panel-in 200ms ease-out;
}

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

.auth-panel-head {
  display: grid;
  gap: 7px;
  text-align: center;
}

.auth-panel-head h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-panel-head p {
  margin: 0;
  color: #777278;
  font-size: 14px;
  line-height: 1.4;
}

html[data-theme="dark"] .auth-panel-head p {
  color: rgba(255, 255, 255, 0.58);
}

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

.auth-card-pro label {
  display: grid;
  gap: 7px;
  color: #504d52;
  font-size: 13px;
  font-weight: 800;
}

html[data-theme="dark"] .auth-card-pro label {
  color: rgba(255, 255, 255, 0.72);
}

.auth-card-pro input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(42, 38, 40, 0.13);
  border-radius: 14px;
  padding: 0 15px;
  background: #fbfaf9;
  color: #17171b;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

html[data-theme="light"] .auth-card-pro input {
  border-color: rgba(42, 38, 40, 0.13);
  background: #fbfaf9;
  color: #17171b;
}

html[data-theme="dark"] .auth-card-pro input {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  box-shadow: none;
}

.auth-card-pro input::placeholder {
  color: rgba(23, 23, 27, 0.36);
}

html[data-theme="dark"] .auth-card-pro input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.auth-card-pro input:focus {
  border-color: rgba(var(--auth-accent-rgb), 0.64);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), 0.09);
}

html[data-theme="dark"] .auth-card-pro input:focus {
  background: rgba(255, 255, 255, 0.09);
}

.auth-password-field {
  position: relative;
  display: block;
}

.auth-password-field input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #777278;
  cursor: pointer;
  transform: translateY(-50%);
}

html[data-theme="dark"] .auth-password-toggle {
  color: rgba(255, 255, 255, 0.58);
}

.auth-password-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 9px;
  width: 20px;
  height: 2px;
  border-radius: 9px;
  background: currentColor;
  transform: rotate(-45deg);
}

.auth-card-pro .btn {
  min-height: 50px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
}

.auth-card-pro .btn-primary {
  border-color: #c90c1a;
  background: linear-gradient(180deg, #e31a28, #bf0915);
  box-shadow: 0 13px 25px rgba(var(--auth-accent-rgb), 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-action-row {
  display: flex;
  gap: 10px;
}

.auth-action-row-single .btn {
  width: 100%;
}

.auth-inline-link-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -7px;
}

.auth-inline-link,
.auth-resend-link,
.auth-back-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--auth-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

html[data-theme="dark"] .auth-inline-link,
html[data-theme="dark"] .auth-resend-link,
html[data-theme="dark"] .auth-back-link {
  color: #ff7774;
}

.auth-back-link {
  justify-self: start;
  margin-bottom: 2px;
}

.auth-bottom-note {
  margin: 0;
  color: #777278;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

html[data-theme="dark"] .auth-bottom-note {
  color: rgba(255, 255, 255, 0.58);
}

.auth-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #969197;
  font-size: 11px;
  font-weight: 800;
}

.auth-stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 1px;
  background: rgba(38, 35, 38, 0.14);
}

html[data-theme="dark"] .auth-stepper li:not(:last-child)::after {
  background: rgba(255, 255, 255, 0.12);
}

.auth-stepper span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(38, 35, 38, 0.15);
  border-radius: 50%;
  background: #fff;
  color: #767176;
}

html[data-theme="dark"] .auth-stepper span {
  border-color: rgba(255, 255, 255, 0.14);
  background: #29272b;
  color: rgba(255, 255, 255, 0.62);
}

.auth-stepper li.is-active,
.auth-stepper li.is-complete {
  color: var(--auth-accent);
}

.auth-stepper li.is-active span,
.auth-stepper li.is-complete span {
  border-color: var(--auth-accent);
  background: var(--auth-accent);
  color: #fff;
}

.auth-otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.auth-card-pro .auth-otp-cell {
  min-height: 50px;
  padding: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.auth-hidden-code {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.auth-code-timer {
  min-height: 18px;
  margin: -5px 0 0;
  font-size: 12px;
  text-align: center;
}

.auth-resend-link {
  justify-self: center;
}

.auth-resend-link:disabled {
  color: #9b979b;
  cursor: default;
  opacity: 0.72;
}

.auth-notice,
.auth-card-pro .message {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.auth-card-pro .message {
  display: none;
}

.auth-card-pro .message.is-visible,
.auth-card-pro .message.ok,
.auth-card-pro .message.error {
  display: block;
}

.auth-card-pro .message.ok,
.auth-notice-ok {
  border: 1px solid rgba(31, 155, 91, 0.18);
  background: rgba(31, 155, 91, 0.09);
  color: #197d4b;
}

.auth-card-pro .message.error {
  border: 1px solid rgba(var(--auth-accent-rgb), 0.18);
  background: rgba(var(--auth-accent-rgb), 0.08);
  color: #c31925;
}

.auth-authorized-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-authorized-notice .btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-height: 780px) and (min-width: 761px) {
  .auth-center { padding: 6px 0 16px; }
  .auth-card-pro { padding: 19px 24px; }
  .auth-card-brand { display: none; }
  .auth-pro-panels { margin-top: 15px; }
  .auth-pro-panel.is-active,
  .auth-step.is-active { gap: 14px; }
  .auth-flow-form { gap: 11px; }
  .auth-card-pro input,
  .auth-card-pro .btn { min-height: 46px; }
  .auth-card-pro .auth-otp-cell { min-height: 46px; }
}

@media (max-width: 1180px) {
  .auth-topbar { width: var(--site-fluid-content-width); }
}

@media (max-width: 900px) {
  .auth-topbar {
    width: var(--site-fluid-content-width);
    min-height: 82px;
    gap: 14px;
  }

  .auth-topbar .brand { margin-right: auto; }
  .auth-topbar .site-header-controls { order: 2; }
  .auth-topbar .site-header-controls > .theme-switch { display: none; }

}

@media (max-width: 760px) {
  body.auth-body {
    overflow-y: auto;
    background-attachment: scroll;
    background-position: 64% center;
  }

  .auth-shell {
    min-height: 100dvh;
    height: auto;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .auth-topbar {
    width: var(--site-fluid-content-width);
    min-height: 84px;
    gap: 10px;
  }

  .auth-topbar .brand { gap: 11px; }
  .auth-topbar .brand span { font-size: 25px; }

  .auth-topbar .brand img {
    width: 42px;
    height: 42px;
  }

  .auth-topbar .site-header-controls .desktop-locale-switch { display: inline-flex; }
  .auth-topbar .lang-switch-select { min-width: 76px; height: 46px; padding-left: 15px; }
  .auth-center {
    min-height: calc(100dvh - 84px);
    padding: 14px 22px 22px;
    overflow: visible;
  }

  .auth-card-pro {
    width: min(440px, 100%);
    max-height: none;
    padding: 22px;
    border-radius: 22px;
    overflow: visible;
  }
}

@media (max-width: 420px) {
  body.auth-body { background-position: 68% center; }
  .auth-card-pro { padding: 19px 17px 21px; border-radius: 20px; }
  .auth-card-brand { margin-bottom: 13px; }
  .auth-pro-panels { margin-top: 16px; }
  .auth-pro-panel.is-active,
  .auth-step.is-active { gap: 15px; }
  .auth-panel-head h2 { font-size: 29px; }
  .auth-card-pro input,
  .auth-card-pro .btn { min-height: 48px; }
  .auth-otp-row { gap: 5px; }
  .auth-card-pro .auth-otp-cell { min-height: 46px; border-radius: 12px; }
}

@media (min-width: 1181px) and (min-height: 781px) {
  .auth-center {
    padding-top: 20px;
    padding-bottom: 38px;
  }

  .auth-card-pro {
    padding: 40px;
    border-radius: 26px;
  }

  .auth-card-brand {
    gap: 10px;
    margin-bottom: 20px;
    font-size: 17px;
  }

  .auth-card-brand img {
    width: 34px;
    height: 34px;
  }

  .auth-mode-tabs {
    gap: 5px;
    padding: 5px;
    border-radius: 17px;
  }

  .auth-mode-tab {
    min-height: 54px;
    border-radius: 13px;
    font-size: 16px;
  }

  .auth-pro-panels {
    margin-top: 24px;
  }

  .auth-pro-panel.is-active,
  .auth-step.is-active {
    gap: 22px;
  }

  .auth-panel-head {
    gap: 8px;
  }

  .auth-panel-head h2 {
    font-size: clamp(42px, 2.2vw, 48px);
  }

  .auth-panel-head p,
  .auth-bottom-note,
  .auth-notice,
  .auth-stepper,
  .auth-inline-link,
  .auth-resend-link,
  .auth-back-link {
    font-size: 16px;
  }

  .auth-flow-form {
    gap: 18px;
  }

  .auth-card-pro label {
    gap: 8px;
    font-size: 14px;
  }

  .auth-card-pro input,
  .auth-card-pro .btn {
    min-height: 58px;
    border-radius: 15px;
    font-size: 17px;
  }

  .auth-card-pro input {
    padding-inline: 18px;
  }

  .auth-password-field input {
    padding-right: 56px;
  }

  .auth-password-toggle {
    right: 8px;
    width: 42px;
    height: 42px;
  }

  .auth-password-toggle svg {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-pro-panel.is-active,
  .auth-step.is-active {
    animation: none;
  }

  .auth-mode-tab,
  .auth-topbar .header-menu .ghost-btn::after,
  .auth-card-pro input {
    transition: none;
  }
}
