.auth-login {
  --auth-bg: #f7f7f4;
  --auth-surface: #ffffff;
  --auth-ink: #17171a;
  --auth-muted: #67676f;
  --auth-subtle: #94949b;
  --auth-border: #cecec9;
  --auth-border-hover: #a7a6aa;
  --auth-accent: #6558d9;
  --auth-accent-soft: rgba(101, 88, 217, 0.16);
  --auth-button: #1b1b1f;
  --auth-button-hover: #303036;
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth-login::after {
  position: absolute;
  inset: 0 31.5% 0 auto;
  width: 1px;
  background: rgba(23, 23, 26, 0.07);
  content: "";
  pointer-events: none;
}

.auth-login__header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 38px 48px;
}

.auth-login__brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.105em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-login__logo {
  width: 24px;
  height: 24px;
}

.auth-login__header-link,
.auth-login__text-link {
  color: var(--auth-ink);
  font-weight: 560;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.auth-login__header-link {
  font-size: 13px;
}

.auth-login__header-link:hover,
.auth-login__text-link:hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

.auth-login__main {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: minmax(48px, 1fr) minmax(340px, 400px) minmax(96px, 0.86fr);
  align-items: center;
  padding: 112px 48px 64px;
}

.auth-login__content {
  grid-column: 2;
  width: 100%;
}

.auth-login__intro h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(2rem, 2.4vw, 2.25rem);
  font-weight: 620;
  letter-spacing: -0.038em;
  line-height: 1.14;
}

.auth-login__intro p {
  margin: 12px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.55;
}

.auth-login__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 42px;
}

.auth-login__fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-login__field label,
.auth-login__label-row label {
  display: block;
  margin: 0 0 9px;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 590;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

.auth-login__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.auth-login__label-row label {
  margin-bottom: 9px;
}

.auth-login__text-link {
  flex: none;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.35;
}

.auth-login__field input[type="email"],
.auth-login__field input[type="password"],
.auth-login__field input[type="text"] {
  display: block;
  width: 100%;
  height: 52px;
  margin: 0;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  box-shadow: 0 1px 1px rgba(23, 23, 26, 0.025);
  color: var(--auth-ink);
  font-size: 15px;
  line-height: 1;
  padding: 0 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-login__field input::placeholder {
  color: var(--auth-subtle);
  opacity: 1;
}

.auth-login__field input:hover {
  border-color: var(--auth-border-hover);
}

.auth-login__field input:focus {
  border-color: var(--auth-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

.auth-login__password {
  position: relative;
}

.auth-login__password input[type="password"],
.auth-login__password input[type="text"] {
  padding-right: 48px;
}

.auth-login__password-toggle {
  position: absolute;
  inset: 0 5px 0 auto;
  display: inline-flex;
  width: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--auth-subtle);
  cursor: pointer;
  padding: 0;
  transition: color 150ms ease;
}

.auth-login__password-toggle:hover {
  color: var(--auth-ink);
}

.auth-login__password-toggle:focus-visible,
.auth-login__header-link:focus-visible,
.auth-login__text-link:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
}

.auth-login__eye,
.auth-login__eye-off {
  width: 19px;
  height: 19px;
}

.auth-login__eye-off,
.auth-login__password-toggle[aria-pressed="true"] .auth-login__eye {
  display: none;
}

.auth-login__password-toggle[aria-pressed="true"] .auth-login__eye-off {
  display: block;
}

.auth-login__remember {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.4;
}

.auth-login__remember label {
  margin: 0;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0;
  line-height: inherit;
}

.auth-login__remember input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--auth-border);
  border-radius: 4px;
  background-color: var(--auth-surface);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
  color: var(--auth-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-login__remember input[type="checkbox"]:hover {
  border-color: var(--auth-border-hover);
}

.auth-login__remember input[type="checkbox"]:checked {
  border-color: var(--auth-accent);
  background-color: var(--auth-accent);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3E%3C/svg%3E");
}

.auth-login__remember input[type="checkbox"]:focus {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
  box-shadow: none;
}

.auth-login__submit {
  display: flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-button);
  border-radius: 8px;
  background: var(--auth-button);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.005em;
  line-height: 1;
  padding: 0 20px;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.auth-login__submit:hover:not(:disabled) {
  border-color: var(--auth-button-hover);
  background: var(--auth-button-hover);
}

.auth-login__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--auth-bg), 0 0 0 5px var(--auth-accent);
}

.auth-login__submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.auth-login__message {
  border: 1px solid;
  border-radius: 7px;
  padding: 13px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-login__message p {
  margin: 0;
}

.auth-login__message a {
  display: inline-block;
  margin-top: 4px;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-login__message--error {
  border-color: #e4b8b8;
  background: #fff4f3;
  color: #8b2929;
}

.auth-login__message--success {
  border-color: #afd2bf;
  background: #f2faf5;
  color: #246541;
}

.dark .auth-login {
  --auth-bg: #101114;
  --auth-surface: #18191d;
  --auth-ink: #f4f4f2;
  --auth-muted: #a4a4aa;
  --auth-subtle: #74747d;
  --auth-border: #38393f;
  --auth-border-hover: #575860;
  --auth-accent: #9589f5;
  --auth-accent-soft: rgba(149, 137, 245, 0.19);
  --auth-button: #f1f1ef;
  --auth-button-hover: #ffffff;
}

.dark .auth-login::after {
  background: rgba(255, 255, 255, 0.08);
}

.dark .auth-login__submit {
  color: #17171a;
}

.dark .auth-login__message--error {
  border-color: #663b3b;
  background: #281a1b;
  color: #f1a4a4;
}

.dark .auth-login__message--success {
  border-color: #345d48;
  background: #17251d;
  color: #91d1ac;
}

@media (max-width: 767px) {
  .auth-login {
    overflow: auto;
  }

  .auth-login::after {
    display: none;
  }

  .auth-login__header {
    padding: 24px;
  }

  .auth-login__logo {
    width: 22px;
    height: 22px;
  }

  .auth-login__brand {
    gap: 9px;
    font-size: 12px;
  }

  .auth-login__main {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    align-items: flex-start;
    padding: clamp(132px, 20vh, 180px) 24px 48px;
  }

  .auth-login__content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

  .auth-login__intro h1 {
    font-size: 30px;
  }

  .auth-login__form {
    margin-top: 36px;
  }
}

@media (max-width: 380px) {
  .auth-login__header,
  .auth-login__main {
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-login__header-link {
    font-size: 12px;
  }
}

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