:root {
  --bg: #0e0e10;
  --panel: #161618;
  --panel-2: #1d1d20;
  --panel-3: #27272b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #ededea;
  --muted: #9c9ca3;
  --dim: #5c5c64;
  --inv-bg: #ececea;
  --inv-text: #131315;
  --inv-muted: #5f5f66;
  --r-lg: 32px;
  --r-md: 24px;
  --r-sm: 16px;
  --danger: #ff6b6b;
  --danger-line: rgba(255, 107, 107, 0.28);
  --danger-bg: rgba(255, 107, 107, 0.09);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Onest", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  font-family: "Unbounded", "Onest", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--inv-bg);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  transition: 0.2s;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 14px;
}

.btn-light {
  background: var(--inv-bg);
  color: var(--inv-text);
}

.btn-light:hover {
  background: #fff;
}

.btn-light:active {
  background: #dededb;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.btn-block {
  width: 100%;
  margin-top: 6px;
  padding: 16px 26px;
  font-size: 15.5px;
}

.auth-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.logo-mark {
  display: block;
  flex-shrink: 0;
}

.auth-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 56px;
}

.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(640px 320px at 50% 0%, rgba(255, 255, 255, 0.055), transparent 70%);
}

.auth-inner {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.auth-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 5vw, 38px);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.auth-head {
  text-align: center;
  margin-bottom: 26px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(22, 22, 24, 0.6);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--inv-bg);
  display: inline-block;
}

.auth-title {
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.auth-lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.auth-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-alert p {
  min-width: 0;
  overflow-wrap: break-word;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim);
  padding-left: 4px;
}

.field-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 0;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.field-box:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.field-box:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.field-input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 8px 0 18px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.3;
}

.field-input::placeholder {
  color: var(--dim);
}

.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--panel-2) inset;
  box-shadow: 0 0 0 1000px var(--panel-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease;
}

.field-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--dim);
  transition: 0.2s;
}

.field-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.field-toggle[aria-pressed="true"] {
  color: var(--inv-bg);
  background: rgba(255, 255, 255, 0.08);
}

.auth-note {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.auth-note a {
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  transition: 0.2s;
}

.auth-note a:hover {
  border-bottom-color: var(--text);
}

.auth-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 26px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.auth-footer a {
  transition: 0.2s;
}

.auth-footer a:hover {
  color: var(--text);
}

@media (max-width: 520px) {
  .auth-header {
    padding: 16px;
  }

  .auth-main {
    align-items: flex-start;
    padding: 4px 14px 40px;
  }

  .auth-card {
    border-radius: var(--r-md);
  }

  .auth-card::before {
    left: 18px;
    right: 18px;
  }

  .btn-block {
    padding: 15px 24px;
  }

  .auth-footer {
    padding: 16px 16px 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-card {
    animation: card-in 0.5s ease both;
  }

  @keyframes card-in {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
