:root {
  color-scheme: dark;
  --auth-bg: #111315;
  --auth-panel: #1c1f24;
  --auth-panel-2: #23272d;
  --auth-line: #333842;
  --auth-text: #f6f7f9;
  --auth-muted: #9da4af;
  --auth-accent: #4f7bff;
  --auth-red: #ff5c68;
  --auth-green: #36d07d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 12%, rgba(79, 123, 255, 0.16), transparent 34rem),
    var(--auth-bg);
  background-size:
    40px 40px,
    40px 40px,
    auto,
    auto;
  color: var(--auth-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
}

.auth-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--auth-line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--auth-panel) 92%, transparent);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.auth-head {
  display: grid;
  gap: 20px;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--auth-line);
}

.auth-brand {
  display: inline-grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

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

.auth-brand span {
  display: block;
  font-size: 15px;
  font-weight: 760;
}

.auth-brand small {
  display: block;
  margin-top: 2px;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 620;
}

.auth-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-head p {
  max-width: 34ch;
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 24px 28px 28px;
}

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

.auth-field span,
.auth-field > label {
  color: color-mix(in srgb, var(--auth-text) 74%, var(--auth-muted));
  font-size: 12px;
  font-weight: 680;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  outline: 0;
  background: var(--auth-panel-2);
  color: var(--auth-text);
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  padding: 0 14px;
}

.auth-field input:focus {
  border-color: color-mix(in srgb, var(--auth-accent) 76%, var(--auth-line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-accent) 16%, transparent);
}

.auth-password-control {
  position: relative;
  min-width: 0;
}

.auth-password-control input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--auth-line) 82%, var(--auth-text) 8%);
  border-radius: 9px;
  background: color-mix(in srgb, var(--auth-panel) 82%, var(--auth-panel-2));
  color: color-mix(in srgb, var(--auth-text) 78%, var(--auth-muted));
  transform: translateY(-50%);
}

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

.auth-password-eye-slash {
  opacity: 0;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--auth-accent) 42%, var(--auth-line));
  color: var(--auth-text);
}

.auth-password-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 16%, transparent);
}

.auth-password-toggle[aria-pressed="true"] {
  color: var(--auth-accent);
}

.auth-password-toggle[aria-pressed="true"] .auth-password-eye-slash {
  opacity: 1;
}

.auth-password-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.auth-submit {
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

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

.auth-forgot,
.auth-back {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--auth-accent) 82%, var(--auth-text));
  font: inherit;
  font-size: 12px;
  font-weight: 680;
}

.auth-forgot:hover,
.auth-back:hover {
  color: var(--auth-text);
}

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

.auth-recovery-head h2,
.auth-recovery-head p {
  margin: 0;
}

.auth-recovery-head h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.auth-recovery-head p {
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 560;
  line-height: 1.45;
}

.auth-form[hidden] {
  display: none;
}

.auth-status {
  min-height: 18px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.4;
}

.auth-status.error {
  color: var(--auth-red);
}

.auth-status.success {
  color: var(--auth-green);
}

@media (max-width: 520px) {
  .auth-page {
    align-items: stretch;
    padding: 14px;
  }

  .auth-card {
    align-self: center;
    border-radius: 18px;
  }

  .auth-head,
  .auth-form {
    padding-left: 20px;
    padding-right: 20px;
  }
}
