:root {
  --auth-ink: #07164f;
  --auth-muted: #5c6885;
  --auth-line: #dce4fb;
  --auth-primary: #3158ff;
  --auth-violet: #7b38ff;
  --auth-rose: #c433ad;
  --auth-surface: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f6f8ff;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(49, 88, 255, 0.12), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(196, 51, 173, 0.1), transparent 34%),
    #f7f9ff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.auth-page-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
}

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

.auth-page-logo img {
  display: block;
  width: 210px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.auth-page-back {
  color: #26345f;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.auth-page-back:hover,
.auth-page-back:focus-visible {
  color: var(--auth-violet);
}

.auth-page-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 92px 20px 24px;
}

.auth-page-shell {
  display: grid;
  grid-template-columns: minmax(270px, 0.88fr) minmax(390px, 1.12fr);
  width: min(960px, 100%);
  min-height: 550px;
  overflow: hidden;
  border: 1px solid rgba(220, 228, 251, 0.96);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(31, 46, 112, 0.16);
}

.auth-page-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px 38px;
  color: #ffffff;
  background: linear-gradient(145deg, #07164f, #273ba5 56%, #7036c8);
}

.auth-page-story::after {
  content: "";
  position: absolute;
  inset: auto -65px -80px auto;
  width: 230px;
  height: 230px;
  border: 42px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.auth-page-kicker {
  display: block;
  margin-bottom: 12px;
  color: #dce4ff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-page-story h1 {
  max-width: 410px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

.auth-page-story p {
  max-width: 430px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.65;
}

.auth-coin-control {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 176px;
  height: 176px;
  border: 0;
  padding: 0;
  cursor: grab;
  background: transparent;
  perspective: 900px;
  touch-action: none;
}

.auth-coin-control:active {
  cursor: grabbing;
}

.auth-coin {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotateX(var(--coin-x, -10deg)) rotateY(var(--coin-y, 0deg));
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 25px rgba(3, 9, 39, 0.34));
}

.auth-coin img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.auth-coin img:last-child {
  transform: rotateY(180deg);
}

.auth-page-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 44px;
}

.auth-page-form-panel > section {
  width: 100%;
}

[data-auth-panel][hidden],
[data-user-reset-request-fields][hidden],
[data-user-reset-complete-fields][hidden] {
  display: none !important;
}

.auth-page-form-panel h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.12;
}

.auth-page-intro {
  margin: 9px 0 24px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-page-form {
  display: grid;
  gap: 15px;
}

.auth-reset-password-fields {
  display: grid;
  gap: 13px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.auth-page-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.auth-page-field > span {
  color: #28365f;
  font-size: 12px;
  font-weight: 800;
}

.auth-page-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--auth-ink);
  background: #fbfcff;
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-page-field input:focus {
  border-color: #8b6cff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(123, 56, 255, 0.11);
}

.auth-page-password {
  position: relative;
}

.auth-page-password input {
  padding-right: 46px;
}

.auth-password-toggle,
.auth-captcha-refresh {
  display: inline-grid;
  place-items: center;
  border: 0;
  color: #536080;
  cursor: pointer;
  background: transparent;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
}

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

.auth-page-inline-actions button,
.auth-page-switch button {
  border: 0;
  padding: 0;
  color: var(--auth-violet);
  cursor: pointer;
  background: transparent;
  font: inherit;
  font-weight: 850;
}

.auth-page-inline-actions button {
  min-height: 28px;
  font-size: 13px;
}

.auth-page-inline-actions button:hover,
.auth-page-inline-actions button:focus-visible,
.auth-page-switch button:hover,
.auth-page-switch button:focus-visible {
  color: var(--auth-rose);
}

.auth-captcha-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.auth-captcha-box {
  display: grid;
  grid-template-columns: 160px 42px;
  gap: 8px;
  width: 210px;
  height: 48px;
}

.auth-captcha-box img {
  display: block;
  width: 160px;
  height: 48px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  object-fit: contain;
  background: #f5f8ff;
}

.auth-captcha-refresh {
  width: 42px;
  height: 48px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #ffffff;
}

.auth-captcha-refresh:hover,
.auth-captcha-refresh:focus-visible {
  color: var(--auth-violet);
  border-color: #cab8ff;
}

.auth-captcha-refresh.is-loading i {
  animation: auth-captcha-spin 700ms linear infinite;
}

.auth-captcha-refresh:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-page-submit {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  padding: 0 20px;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-violet) 58%, var(--auth-rose));
  box-shadow: 0 14px 28px rgba(78, 68, 224, 0.22);
  font: inherit;
  font-weight: 850;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.auth-page-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(78, 68, 224, 0.3);
}

.auth-page-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-page-status {
  min-height: 21px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.auth-page-status.is-success {
  color: #087443;
}

.auth-page-switch {
  margin: 4px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
  text-align: center;
}

.auth-page-switch a {
  color: var(--auth-violet);
  font-weight: 850;
  text-decoration: none;
}

@keyframes auth-captcha-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .auth-page-header {
    width: calc(100% - 28px);
    min-height: 66px;
  }

  .auth-page-logo img {
    width: 168px;
    height: 48px;
  }

  .auth-page-back {
    font-size: 0;
  }

  .auth-page-back::after {
    content: "Home";
    font-size: 13px;
  }

  .auth-page-main {
    padding: 76px 12px 16px;
  }

  .auth-page-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 18px;
  }

  .auth-page-story {
    min-height: 142px;
    padding: 24px 24px 20px;
  }

  .auth-page-story h1 {
    padding-right: 112px;
    font-size: 28px;
  }

  .auth-page-story p {
    margin-top: 10px;
    padding-right: 92px;
    font-size: 13px;
    line-height: 1.5;
  }

  .auth-coin-control {
    position: absolute;
    right: 14px;
    bottom: 8px;
    width: 112px;
    height: 112px;
  }

  .auth-page-form-panel {
    padding: 24px 20px;
  }

  .auth-page-intro {
    margin-bottom: 18px;
  }
}

@media (max-width: 480px) {
  .auth-form-grid,
  .auth-captcha-row {
    grid-template-columns: 1fr;
  }

  .auth-captcha-box {
    width: 210px;
  }

  .auth-page-story h1 {
    font-size: 25px;
  }

  .auth-page-story p {
    max-width: 230px;
    padding-right: 0;
  }

  .auth-page-form {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
