body[data-page="login"],
body[data-page="register"] {
  overflow: hidden;
}

.auth-page {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 1100;
}

.auth-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px 16px 24px;
  overflow: auto;
}

.auth-card {
  position: relative;
  width: min(100%, 460px);
  display: grid;
  gap: 18px;
  padding: 34px 34px 30px;
  z-index: 1;
  overflow: hidden;
  box-shadow: var(--shadow-floating);
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 19, 36, 0.44);
  backdrop-filter: blur(14px);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  z-index: 2;
}

.auth-close:hover {
  color: var(--text);
  background: var(--surface);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -20px -28px auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.18), transparent 62%);
  pointer-events: none;
}

.auth-card-header {
  position: relative;
  display: grid;
  gap: 10px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(108, 99, 255, 0.1);
}

.auth-eyebrow.register {
  color: var(--mint);
  background: rgba(0, 201, 167, 0.1);
}

.auth-card-header h1 {
  margin: 0;
  font-family: "Onest", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.auth-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

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

.auth-field span {
  font-size: 13px;
  font-weight: 700;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.auth-input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 0 44px 0 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
  outline: 0;
}

.auth-input-wrap input:focus {
  border-color: rgba(108, 99, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 28px rgba(108, 99, 255, 0.24);
}

.auth-submit.register-submit {
  background: linear-gradient(135deg, var(--mint), #00a98c);
  box-shadow: 0 16px 28px rgba(0, 201, 167, 0.2);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-oauth {
  display: grid;
  gap: 12px;
}

.auth-oauth-btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
}

.auth-footer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 760px) {
  .auth-shell {
    padding: 0;
    align-items: end;
  }

  .auth-card {
    width: min(100%, 100vw);
    border-radius: 20px 20px 0 0;
    padding: 22px 18px 20px;
    max-height: calc(100dvh - var(--nav-h) - 8px);
    overflow: auto;
  }

  .auth-card-header h1 {
    font-size: 24px;
  }
}
